-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
When a repo (or individual extract) appears in a combined section like squad-frontend + squad-mobile, its ownership is ambiguous. github-issue-ops requires a single owner per item to route and assign issues without conflict.
#85 resolves this at the section level (one pick reassigns the entire section to a single team). This issue addresses the finer granularity: individually reassigning specific repos or extracts within a multi-team section to different teams.
Relationship to #85 — pick vs. dispatch
The two mechanisms are complementary and can be combined in the same replay command:
| Mechanism | Granularity | Flag | When to use |
|---|---|---|---|
--pick-team (#85) |
Whole section | --pick-team "A + B"=A |
All repos in the section belong to the same team |
--dispatch (#86) |
Individual repo or extract | --dispatch A=repoX --dispatch B=repoY |
Repos/extracts in the section belong to different teams |
--pick-team is applied first (on TeamSection[], before flattenTeamSections); --dispatch is applied second (on the flat RepoGroup[], after flattenTeamSections). A section resolved by --pick-team can still have individual repos/extracts overridden by --dispatch.
Proposed design
TUI — dispatch mode
A new dispatch mode toggled with t, available only when --group-by-team-prefix is active. In dispatch mode:
- Each repo/extract row in a multi-team section shows its candidate teams inline
- The user presses
1,2, … to assign the focused item to the nth candidate team - The item visually moves to that team's sub-section immediately
- Dispatch mode is exited with
Escapeortagain
CLI — --dispatch (repeatable)
github-code-search query "..." --org myorg \
--group-by-team-prefix squad- \
--pick-team "squad-frontend + squad-mobile"=squad-frontend \
--dispatch squad-mobile=repoA:src/critical.ts:0Format: --dispatch <team>=<refs> where <refs> is a comma-separated list of refs using the same format as --exclude-repositories and --exclude-extracts:
- repo short-name:
repoA - extract ref:
repoA:src/foo.ts:0
= is used as the team/refs separator because it never appears in team slugs or repo/extract refs. Multiple --dispatch flags are allowed (one per team), enabling mixed repo-level and extract-level dispatch in the same command.
New types in src/types.ts
// On RepoGroup
dispatchedTeam?: string; // repo-level team override
extractDispatchedTeam?: (string | undefined)[]; // per-extract override, parallel to extractSelectedImplementation order
- Add
dispatchedTeam/extractDispatchedTeamtoRepoGroupinsrc/types.ts - Add a pure helper in
src/group.ts:Parses each ref list, matches repos/extracts, sets the override fields, then re-runsapplyDispatch(groups: RepoGroup[], dispatches: Record<string, string[]>, org: string): RepoGroup[]
groupByTeamPrefixto produce updated sections. - Add
dispatches?: Record<string, string[]>toReplayOptionsinsrc/output.ts; emit one--dispatch <team>=<refs>line per entry inbuildReplayCommand - Add TUI dispatch mode in
src/tui.ts(keyt,1/2/…,Escape) - Add
--dispatch <spec>(repeatable) togithub-code-search.ts; apply afterflattenTeamSections(i.e. after--pick-teamhas already been applied)
Replay
The replay command emits one --dispatch <team>=<refs> flag per team that received dispatches, with all its refs comma-joined — after any --pick-team flags.
Acceptance criteria
- TUI dispatch mode (
t) allows assigning any repo or extract to one of its candidate teams -
--dispatchin non-interactive mode reproduces the same section layout as a TUI dispatch session -
--pick-teamand--dispatchcan be combined in the same command;--pick-teamis applied first - Dispatch overrides are reflected in both markdown and JSON output section headers
- The replay command round-trips: re-running it produces bit-identical output
-
bun test,bun run lint,bun run knipall pass -
bun run docs:buildcompletes without errors
Documentation
Three files must be updated. Follow the conventions in .github/instructions/documentation.instructions.md.
-
docs/usage/team-grouping.md— add a## Team dispatchsection after## Team pick mode(Team pick mode — p on a multi-team section header to assign it to a single team #85). Describe: the problem (ambiguous ownership at repo/extract granularity), the TUI dispatch mode (t,1/2/…,Escape), the--dispatch <team>=<refs>flag with a worked example combining it with--pick-team, and how the replay command encodes dispatches. -
docs/reference/keyboard-shortcuts.md— extend the## Team ownershipsection introduced in Team pick mode — p on a multi-team section header to assign it to a single team #85 with a### Dispatch mode bindingstable documentingt(toggle dispatch mode),1/2/… (assign to nth team), andEscape(exit dispatch mode). -
docs/reference/cli-options.md— add a--dispatch <spec>row in the## Search optionstable after--pick-team, noting it is repeatable, that refs follow the--exclude-repositories/--exclude-extractsformat, and linking to the team grouping usage page.