-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-28871] Default startIndex and count values on SCIM groups list API #6648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6648 +/- ##
=======================================
Coverage 53.28% 53.28%
=======================================
Files 1906 1907 +1
Lines 84973 84979 +6
Branches 7639 7639
=======================================
+ Hits 45275 45282 +7
Misses 37944 37944
+ Partials 1754 1753 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Claude finished @kspearrin's task —— View job Code Review Complete
SummaryThis PR successfully mirrors the Users list API pattern for the Groups list API by introducing default values through a query param model. The implementation is clean and consistent with existing patterns. FindingsFinding 1: ❌ Missing integration test for default parameter behavior (bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/GroupsControllerTests.cs) The reviewer correctly identified that an integration test mirroring the Users API test is missing. The Users API has Suggested test implementation[Fact]
public async Task GetList_SearchDisplayNameWithoutOptionalParameters_Success()
{
var organizationId = ScimApplicationFactory.TestOrganizationId1;
string filter = "displayName eq Test Group 2";
int? itemsPerPage = null;
int? startIndex = null;
var expectedResponse = new ScimListResponseModel<ScimGroupResponseModel>
{
ItemsPerPage = 50, //default value
TotalResults = 1,
StartIndex = 1, //default value
Resources = new List<ScimGroupResponseModel>
{
new ScimGroupResponseModel
{
Id = ScimApplicationFactory.TestGroupId2,
DisplayName = "Test Group 2",
ExternalId = "B",
Schemas = new List<string> { ScimConstants.Scim2SchemaGroup }
}
},
Schemas = new List<string> { ScimConstants.Scim2SchemaListResponse }
};
var context = await _factory.GroupsGetListAsync(organizationId, filter, itemsPerPage, startIndex);
Assert.Equal(StatusCodes.Status200OK, context.Response.StatusCode);
var responseModel = JsonSerializer.Deserialize<ScimListResponseModel<ScimGroupResponseModel>>(context.Response.Body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
AssertHelper.AssertPropertyEqual(expectedResponse, responseModel);
}This test should be added after line 176 in GroupsControllerTests.cs to verify that the default values (StartIndex=1, Count=50) are correctly applied when parameters are omitted. Good Practices
PR Title and Description Assessment💭 The PR title and description meet minimum requirements but could be enhanced: Current title: Suggested improvement: Current objective: Adequately explains the issue and solution, but could benefit from:
|
r-tome
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I think we should also add an integration test to cover what we're fixing here. There’s an identical case tested in UsersController that we can mirror


🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-28871
📔 Objective
If no query params were provided, no results were returned from the SCIM Groups list API. This is because the Groups
GetUsersListAsyncquery did not support default values forstartIndexorcount. This PR adds default values forstartIndex(1) andcount(50) through a new query params model class, similar to what we do on the Users list API.