Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
809db23
feat: add server-side search and pagination for the Groups page
aqandrew Jul 28, 2026
2b74eff
chore: make gen
aqandrew Jul 28, 2026
78e2ec2
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Jul 28, 2026
9800357
test: remove ExtraColon test case
aqandrew Jul 28, 2026
7febaf7
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Jul 28, 2026
cf77b53
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Jul 28, 2026
e18e043
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Jul 28, 2026
e0e1f90
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Jul 29, 2026
c0fe385
fix(coderd/database): always scope paginated groups to the organization
aqandrew Aug 5, 2026
484f2c1
test(enterprise/coderd): assert paginated groups organization isolation
aqandrew Aug 5, 2026
67c5778
refactor(coderd/database): rename query to GetGroupsByOrganizationIDP…
aqandrew Aug 5, 2026
457bbb0
docs(enterprise/coderd): document org-wide read on paginated groups e…
aqandrew Aug 5, 2026
d2c3757
Merge remote-tracking branch 'origin/main' into aqandrew/devex-434-gr…
aqandrew Aug 5, 2026
790cdcf
feat(coderd/searchquery): support colon-containing group search via f…
aqandrew Aug 5, 2026
d2a68f4
feat(coderd/database): support after_id keyset pagination for groups
aqandrew Aug 5, 2026
b2d9fae
feat(enterprise/coderd): stop hydrating member rosters in paginated g…
aqandrew Aug 5, 2026
1952875
docs(enterprise/coderd): document q syntax and empty roster on pagina…
aqandrew Aug 6, 2026
e6b97a4
refactor(codersdk): use slim group summaries in paginated response
aqandrew Aug 6, 2026
c275054
feat(site): add server-side search and pagination for groups page (#2…
aqandrew Aug 6, 2026
3afa0ed
Revert "feat(site): add server-side search and pagination for groups …
aqandrew Aug 10, 2026
0e1a7fd
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Aug 10, 2026
aa946e8
Merge branch 'main' into aqandrew/devex-434-groups-search-pagination-…
aqandrew Aug 10, 2026
dbe2e2f
fix(codersdk): decode paginated groups response with ReadBodyAsJSON
aqandrew Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

109 changes: 109 additions & 0 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions coderd/database/db2sdk/db2sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,24 @@ func Group(row database.GetGroupsRow, members []database.GroupMember, totalMembe
}
}

// PaginatedGroup converts a group row into the slim summary returned by the
// paginated groups endpoint, which omits the member roster and carries only
// the total member count.
func PaginatedGroup(row database.GetGroupsRow, totalMemberCount int) codersdk.PaginatedGroup {
return codersdk.PaginatedGroup{
ID: row.Group.ID,
Name: row.Group.Name,
DisplayName: row.Group.DisplayName,
OrganizationID: row.Group.OrganizationID,
AvatarURL: row.Group.AvatarURL,
TotalMemberCount: totalMemberCount,
QuotaAllowance: int(row.Group.QuotaAllowance),
Source: codersdk.GroupSource(row.Group.Source),
OrganizationName: row.OrganizationName,
OrganizationDisplayName: row.OrganizationDisplayName,
}
}

func TemplateInsightsParameters(parameterRows []database.GetTemplateParameterInsightsRow) ([]codersdk.TemplateParameterUsage, error) {
// Use a stable sort, similarly to how we would sort in the query, note that
// we don't sort in the query because order varies depending on the table
Expand Down
11 changes: 11 additions & 0 deletions coderd/database/dbauthz/dbauthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -3901,6 +3901,17 @@ func (q *querier) GetGroups(ctx context.Context, arg database.GetGroupsParams) (
return fetchWithPostFilter(q.auth, policy.ActionRead, q.db.GetGroups)(ctx, arg)
}

func (q *querier) GetGroupsByOrganizationIDPaginated(ctx context.Context, arg database.GetGroupsByOrganizationIDPaginatedParams) ([]database.GetGroupsByOrganizationIDPaginatedRow, error) {
// Required to have permission to read all groups in the organization. This
// mirrors PaginatedOrganizationMembers: a single org-wide read check with no
// per-row post-filter, so that SQL LIMIT/OFFSET and COUNT(*) OVER() stay
// consistent across pages.
if err := q.authorizeContext(ctx, policy.ActionRead, rbac.ResourceGroup.InOrg(arg.OrganizationID)); err != nil {
return nil, err
}
return q.db.GetGroupsByOrganizationIDPaginated(ctx, arg)
}

func (q *querier) GetHealthSettings(ctx context.Context) (string, error) {
// No authz checks
return q.db.GetHealthSettings(ctx)
Expand Down
13 changes: 13 additions & 0 deletions coderd/database/dbauthz/dbauthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2353,6 +2353,19 @@ func (s *MethodTestSuite) TestOrganization() {

check.Args(arg).Asserts(mem, policy.ActionRead)
}))
s.Run("GetGroupsByOrganizationIDPaginated", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) {
o := testutil.Fake(s.T(), faker, database.Organization{})
g := testutil.Fake(s.T(), faker, database.Group{OrganizationID: o.ID})
arg := database.GetGroupsByOrganizationIDPaginatedParams{OrganizationID: o.ID, LimitOpt: 0}
rows := []database.GetGroupsByOrganizationIDPaginatedRow{{
Group: g,
OrganizationName: o.Name,
OrganizationDisplayName: o.DisplayName,
Count: 1,
}}
dbm.EXPECT().GetGroupsByOrganizationIDPaginated(gomock.Any(), arg).Return(rows, nil).AnyTimes()
check.Args(arg).Asserts(rbac.ResourceGroup.InOrg(o.ID), policy.ActionRead).Returns(rows)
}))
s.Run("PaginatedOrganizationMembers", s.Mocked(func(dbm *dbmock.MockStore, faker *gofakeit.Faker, check *expects) {
o := testutil.Fake(s.T(), faker, database.Organization{})
u := testutil.Fake(s.T(), faker, database.User{})
Expand Down
8 changes: 8 additions & 0 deletions coderd/database/dbmetrics/querymetrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions coderd/database/dbmock/dbmock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/querier.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading