Skip to content

[i,l,-r] Auto-narrow reviewers on empty picker selection (SECOP-952)#11

Draft
phosphore wants to merge 1 commit into
masterfrom
lorenzo/secop-952-auto-narrow-reviewers
Draft

[i,l,-r] Auto-narrow reviewers on empty picker selection (SECOP-952)#11
phosphore wants to merge 1 commit into
masterfrom
lorenzo/secop-952-auto-narrow-reviewers

Conversation

@phosphore

Copy link
Copy Markdown
Member

Why

When an MPA elevation request is submitted without picking specific reviewers, JoinOperation.propose falls back to the full policy ACL and SlackProposalHandler expands any group in it to individuals. So a role whose approver list names a broad group (e.g. engineering@roles.wave.com) DMs hundreds of people — far too loud. Tracked in SECOP-952.

What

GroupsResource.post now resolves an effective reviewer filter when the picker selection is empty:

  • Small, group-free approver set (≤ AUTO_NARROW_BROADCAST_LIMIT, no group): unchanged — DM everyone. Makes zero Cloud Identity calls (cheap guard).
  • Broad set (contains a group, or > limit direct approvers): narrow to the requester's suggested teammates from the existing ReviewerCandidates logic. Never fans out to the whole group.
  • Broad set with no teammate signal: reject with a BadRequest ("pick at least one reviewer") rather than broadcast. Same fail-safe if teammate resolution errors out (Cloud Identity outage / permission gap) — we'd rather ask than spam.

New constant AUTO_NARROW_BROADCAST_LIMIT = 15 (a generous single-team size).

This is server-side only — the authoritative spot, since the picker UI just supplies the selection. The picker already computes the suggested set; this reuses it for the empty-selection default.

Tests

Three new TestGroupsResource cases: null-filter (small set), narrow-to-suggested, and reject-rather-than-broadcast. Full unit suite green locally (1011 tests, 0 failures).

Notes / follow-ups

  • The frontend picker could also pre-check the suggested teammates so the narrowing is visible before submit (Phase 3 view.js) — out of scope here.
  • The 15 threshold is a judgment call; trivial to tune.

🤖 Generated with Claude Code

When an MPA elevation request was submitted without picking specific
reviewers, JoinOperation.propose fell back to the full policy ACL and
SlackProposalHandler expanded any group in it to individuals — so a
role whose approver list names a broad group (e.g.
engineering@roles.wave.com) DM'd hundreds of people.

GroupsResource.post now resolves an effective reviewer filter when the
selection is empty:
  - small, group-free approver set -> unchanged (DM everyone; no Cloud
    Identity calls);
  - broad set (contains a group, or > AUTO_NARROW_BROADCAST_LIMIT) ->
    narrow to the requester's suggested teammates from
    ReviewerCandidates;
  - broad set with no teammate signal -> reject with a BadRequest so the
    requester picks at least one reviewer, rather than broadcasting.
    Same fail-safe if teammate resolution errors out.

Adds three TestGroupsResource cases covering the null-filter, narrow,
and reject paths.
@phosphore phosphore changed the title Auto-narrow reviewers on empty picker selection (SECOP-952) [i,l,-r] Auto-narrow reviewers on empty picker selection (SECOP-952) Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant