feat(app): exclude org-wide admin groups from aggregated member lists#131
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sre-adminsandcloud-engineering-adminsare org-wide admin subgroups composedinto ~every workgroup (they're
childOf~100 groups), so their users flood everyworkgroup's aggregated Members card. This excludes those two groups' users from
a group's aggregated member list — except when viewing those groups, or their
parent workgroups (
cloud-engineering/sre), directly.Frontend display only — no catalog, relation, ownership, or permission changes.
How
packages/app/src/components/catalog/workgroupMembers.ts— a pure helper(
aggregateMembers) mirroring the org plugin's direct + descendant aggregation(BFS over
RELATION_PARENT_OF, members viarelations.memberof), but pruningthe excluded admin-group branches during the descent when
shouldPrune(root).Prune-descent semantics: a person reachable only via an excluded admin group is
dropped; a person who is also a genuine direct/other-subgroup member still shows.
packages/app/src/components/catalog/WorkgroupMembersListCard.tsx— renders theresult; replaces the stock
MembersListCardinside the existingTypeAwareMembersListCardinoverrides/org.tsx(aggregated = spec.type === 'workgroup').Verification
Unit tests cover the pruning (incl. the "also a direct member still shows" case) and
the component asserts a pruned-branch user is not rendered. Non-excluded groups'
aggregated counts stay algorithmically identical to the stock card.
tsc, lint,prettier clean; app builds.
Notes (optional follow-ups, from review)
shouldPrune's parent-workgroup exemption is whole-tree, not per-branch (fine forthese admin-org pages).
Tablerender intentionally drops the stock avatar-grid + aggregate/directtoggle; search + pagination preserved. Parity is a follow-up if wanted.