Skip to content

Add --exclude-team-prefixes: exclude noisy team-name prefixes from grouping - #201

Draft
shouze wants to merge 3 commits into
feat/team-hierarchy-pick-team-autofrom
feat/team-hierarchy-exclude-team-prefixes
Draft

Add --exclude-team-prefixes: exclude noisy team-name prefixes from grouping#201
shouze wants to merge 3 commits into
feat/team-hierarchy-pick-team-autofrom
feat/team-hierarchy-exclude-team-prefixes

Conversation

@shouze

@shouze shouze commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds --exclude-team-prefixes: filters teams matching given prefixes out of consideration before groupByTeamHierarchy runs, reducing ambiguous combined sections at the source rather than trying to resolve them after the fact.

  • src/group.ts: new pure excludeTeamsByPrefix(groups, excludePrefixes) — removes matching teams from each repo's teams list. Same case-sensitive startsWith semantics as --group-by-team-prefix's own matching, for consistency.
  • github-code-search.ts: new CLI flag (comma-separated, same parsing pattern as --exclude-repositories), applied right after team lists are attached and before groupByTeamHierarchy. Warns (no-op) when used without --group-by-team-prefix, mirroring --pick-team / --pick-team-auto.
  • src/output.ts / src/tui.ts: threaded excludeTeamPrefixes through ReplayOptions / buildReplayCommand / runInteractive so a session using the flag replays identically.
  • src/completions.ts: new completion entry.
  • Docs: new "Excluding noisy team prefixes" section in docs/usage/team-grouping.md and the CLI option row in docs/reference/cli-options.md.

A repo left with no matching team after exclusion falls into "other", exactly like a repo with no matching team today — no special-casing needed.

Closes #200. Depends on #198, #199 (branch is stacked on top of them).

How did you verify your code works?

  • New unit tests in src/group.test.ts for excludeTeamsByPrefix: removes matching teams, keeps non-matching teams, multiple prefixes, drops a repo's entire team list (falls to "other" once grouped), no-op with empty exclude list, purity/no-mutation.
  • New tests in src/output.test.ts / src/completions.test.ts for replay-command emission and completion scripts.
  • Manual smoke test: github-code-search help query shows the new flag with correct help text.
  • bun test (1006 passing), bun run lint, bun run format:check, bun run knip, bun run build.ts all green.

…ouping

Filters teams matching given prefixes out of consideration before
groupByTeamHierarchy runs, reducing ambiguous combined sections at
the source rather than trying to resolve them after the fact (e.g.
many chapter-validators-* sub-teams). A repo left with no matching
team after exclusion falls into 'other', same as today. Only applies
with --group-by-team-prefix; threaded through the replay command.

Closes #200
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Coverage after merging feat/team-hierarchy-exclude-team-prefixes into feat/team-hierarchy-pick-team-auto will be

96.86%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   aggregate.ts100%100%100%100%
   api-utils.ts93.20%100%93.75%93.13%101–103, 65, 73, 86–87, 91–92
   api.ts94.74%100%100%94.07%340–344, 405, 422, 63–69
   cache.ts94.67%100%100%94.29%139–141, 39
   completions.ts99.46%100%100%99.41%282
   group.ts99.11%100%98.25%99.28%511, 517, 596, 765
   output.ts99.38%100%95.83%99.66%88
   regex.ts99.39%100%100%99.34%329
   render.ts90.99%100%88.24%91.09%177, 201–206, 208–210, 212–213, 234, 427–428, 528–532, 562–569, 571–579, 581–584
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts88.38%100%94.44%87.89%128, 131, 133, 153, 167–168, 188–195, 198–204, 209, 214, 250–253
src/render
   filter-match.ts97.44%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.63%100%90.40%99.31%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.42%100%100%99.38%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🔦 Lighthouse Report

Page ⚡ Perf ♿ A11y 🛡️ BP 🔍 SEO Report
/github-code-search/getting-started/ 🟢 99 (≥96) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view
/github-code-search/ 🟢 96 (≥96) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view

Thresholds: Perf ≥ 96 · A11y ≥ 99 · BP ≥ 99 · SEO ≥ 99
commit d9c1eb0 · full workflow run

Replaces gamme- (Fulll-specific French term) with tribe- (Spotify
model terminology) across docs, CLI help text, and tests, and
genericizes explicit product/business squad names (squad-dashboard,
squad-billing, squad-demat, squad-accounting, squad-bank) to
squad-a/b/c/d. chapter- and its specialty names (chapter-backend,
chapter-architect, etc.) are kept as-is since they already read as
generic engineering domains, not organization-specific identifiers.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Coverage after merging feat/team-hierarchy-exclude-team-prefixes into feat/team-hierarchy-pick-team-auto will be

96.86%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   aggregate.ts100%100%100%100%
   api-utils.ts93.20%100%93.75%93.13%101–103, 65, 73, 86–87, 91–92
   api.ts94.74%100%100%94.07%340–344, 405, 422, 63–69
   cache.ts94.67%100%100%94.29%139–141, 39
   completions.ts99.46%100%100%99.41%282
   group.ts99.11%100%98.25%99.28%511, 517, 596, 765
   output.ts99.38%100%95.83%99.66%88
   regex.ts99.39%100%100%99.34%329
   render.ts90.99%100%88.24%91.09%177, 201–206, 208–210, 212–213, 234, 427–428, 528–532, 562–569, 571–579, 581–584
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts88.38%100%94.44%87.89%128, 131, 133, 153, 167–168, 188–195, 198–204, 209, 214, 250–253
src/render
   filter-match.ts97.44%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.63%100%90.40%99.31%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.42%100%100%99.38%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

…t sub-teams

- groupByTeamHierarchy now tries every level of a chain in order against
  what earlier levels of that same chain haven't claimed, so a repo
  matching only squad- (not tribe-) in a tribe-/squad- chain is captured
  directly instead of falling through to a later chain or 'other'.
- Overlapping single-team labels (e.g. tribe-a / tribe-a-p1) are now
  combined into one section ("tribe-a + tribe-a-p1"), like a multi-team
  combo, instead of nested into an extra heading level the declared
  chain didn't ask for. --pick-team / --pick-team-auto resolve it the
  same way as any other combo.
- bucketSingleLevel now drops a team that is a proper prefix-extension
  of another team already matched by the same repo (e.g.
  chapter-architect-a when chapter-architect is also present), reducing
  unwieldy N-way combos down to their genuinely distinct members before
  the label is even formed.

Removed the now-dead nestOverlappingLabels/assignLevels in favor of a
flat, union-find-based combineOverlappingLabels. Updated/added group.ts
tests to reproduce all 3 reported bugs and confirm the fixes, and
updated docs/usage/team-grouping.md accordingly.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Coverage after merging feat/team-hierarchy-exclude-team-prefixes into feat/team-hierarchy-pick-team-auto will be

96.78%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   aggregate.ts100%100%100%100%
   api-utils.ts93.20%100%93.75%93.13%101–103, 65, 73, 86–87, 91–92
   api.ts94.74%100%100%94.07%340–344, 405, 422, 63–69
   cache.ts94.67%100%100%94.29%139–141, 39
   completions.ts99.46%100%100%99.41%282
   group.ts98.69%100%98.28%98.78%278–280, 540, 546, 625, 794
   output.ts99.38%100%95.83%99.66%88
   regex.ts99.39%100%100%99.34%329
   render.ts90.99%100%88.24%91.09%177, 201–206, 208–210, 212–213, 234, 427–428, 528–532, 562–569, 571–579, 581–584
   scroll-cooldown.ts100%100%100%100%
   style.ts100%100%100%100%
   upgrade.ts88.38%100%94.44%87.89%128, 131, 133, 153, 167–168, 188–195, 198–204, 209, 214, 250–253
src/render
   filter-match.ts97.44%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.63%100%90.40%99.31%284–285
   layout-constants.ts100%100%100%100%
   mouse-hit.ts100%100%100%100%
   mouse.ts100%100%100%100%
   rows.ts99.42%100%100%99.38%239
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%
   team-pick.ts100%100%100%100%
   terminal.ts100%100%100%100%

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.

[10/10] --exclude-team-prefixes: exclude noisy team-name prefixes from grouping

1 participant