Skip to content

APO-12488: Credit Support team issues on person metrics - #526

Closed
bkraeling wants to merge 1 commit into
mainfrom
claude/apo-12488-sup-team-person-metrics
Closed

APO-12488: Credit Support team issues on person metrics#526
bkraeling wants to merge 1 commit into
mainfrom
claude/apo-12488-sup-team-person-metrics

Conversation

@bkraeling

Copy link
Copy Markdown
Contributor

🐛 Issue

Closes APO-12488.

Every Linear query in Bug Board filters on the single team in linear_team_key (APO). Work tracked on the Support team (SUP-…, where EASE issues live) never reaches any person-card metric — All Work Done, Time to Completion, Priority Bugs Fixed, Priority Bug Time to Fix, or the σ comparisons built from them. An engineer who fixes an Urgent EASE issue gets the same credit as one who did nothing.

Separately, a "priority bug" is defined as priority ≤ 2 and a label named exactly Bug. Support's equivalent label is Issue, so even with the team filter widened, an Urgent SUP issue would count toward All Work Done but not Priority Bugs Fixed.

Concrete case: SUP-708 (Urgent, label Issue, assigned to brandon) will earn zero credit when it moves to Done.

✏️ Solution

  • Add linear_team_keys (list) to config.yml. get_linear_team_keys() always puts the primary linear_team_key first and de-duplicates. Only the two person-scoped queries (get_open_issues_for_person, get_completed_issues_for_person) switch to team: { key: { in: $team_keys } }.
  • Keep every team-wide query (homepage priority stats, leaderboard, projects, regressions, stale-issue reminders) on the primary team. Adding Support issues to those views is a separate product decision.
  • Add bug_labels (default ["Bug"]) and a shared is_priority_bug() helper in person_stats.py, used by both _build_person_context and issue_card_values so the two copies of the filter can't drift. Priority semantics are unchanged (priority <= 2); only the label set is configurable.
  • Configure linear_team_keys: [APO, SUP] and bug_labels: [Bug, Issue]. Because the person queries run for every engineer, this credits everyone's Support work, not just one person's.
  • README documents the three config keys and which pages each affects.

🔬 To Test

  1. ruff check . && mypy . && python -m unittest discover -s tests -p 'test_*.py' → all green.
  2. python -c "import config; print(config.get_linear_team_keys(), config.get_bug_label_names())"['APO', 'SUP'] ['Bug', 'Issue'].
  3. In a review app (or locally with LINEAR_API_KEY), open /team/brandon?days=30. The All Work Done header link should open a Linear list that includes any SUP-… issues brandon completed in the window alongside the APO-… ones. Before this change that list was APO-only.
  4. Move SUP-708 to Done (it is Urgent + Issue), reload /team/brandon: All Work Done and Priority Bugs Fixed each increase by 1, and SUP-708 appears in both header links.
  5. Open / and /team: homepage priority stats and the team table are unchanged (they still query APO only).

Automated result: 217 tests pass (9 new), ruff and mypy report 0 issues. Steps 1–2 verified locally. Steps 3–5 need a review app or a local LINEAR_API_KEY — none was available in this environment, so the live team.key in [...] query has not been exercised against Linear yet.

📸 Screenshots

Not applicable — no visible UI change; the existing cards show larger numbers.

Person-card metrics (All Work Done, Time to Completion, Priority Bugs
Fixed, Priority Bug Time to Fix) only ever read the single team in
`linear_team_key`, so work tracked on the Support team (SUP-*, used for
EASE) was invisible. Separately, "priority bug" required a label named
exactly `Bug`, but Support's equivalent label is `Issue`.

- Add `linear_team_keys` (list, primary team always first) and switch the
  two person-scoped queries to `team.key in $team_keys`. Team-wide pages
  (homepage stats, leaderboard, projects, regressions) still use the
  primary team.
- Add `bug_labels` (default `[Bug]`) and a shared `is_priority_bug`
  helper used by both the person context and `issue_card_values`.
- Configure `[APO, SUP]` and `[Bug, Issue]`; document both keys.

Closes APO-12488

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

APO-12488

@redreceipt
redreceipt temporarily deployed to bug-board-claude-apo-12-hcpgss September 3, 2026 15:13 Inactive

@mary-pr-poppins mary-pr-poppins left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Mary PR Poppins — Approve

This PR updates person-scoped Linear metrics to include configured team keys and configurable bug labels, with focused tests covering the new config helpers, query filters, and priority-bug classification behavior. Looks clean across security, correctness, maintainability, and repo-history context — no high-conviction issues found.

@bkraeling
bkraeling marked this pull request as ready for review September 3, 2026 15:53
Copilot AI lite review requested due to automatic review settings September 3, 2026 15:53

@redreceipt redreceipt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tool is my dashboard for apollos only, I have intentionally kept out other teams. I don't want ease or legacy stuff in here

@redreceipt redreceipt closed this Sep 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes the live Linear GraphQL filter semantics (team.key in [...]) without an integration run against Linear, so there’s residual risk of runtime query incompatibility despite unit-test coverage.

Pull request overview

This PR extends Bug Board’s person-scoped Linear issue queries to include multiple teams (e.g., APO + SUP) so Support-team work contributes to person metrics, and it makes the “priority bug” label(s) configurable to account for Support’s Issue label.

Changes:

  • Add linear_team_keys (list) and bug_labels to configuration, with helpers in config.py.
  • Update linear/issues.py person-scoped queries to filter by team.key in $team_keys instead of a single team key.
  • Centralize “priority bug” logic via person_stats.is_priority_bug() and add unit tests for the new config-driven behavior.
File summaries
File Description
app.py Switches person-context “priority bugs” computation to use shared helper.
config.py Adds get_linear_team_keys() and get_bug_label_names() helpers.
config.yml Configures linear_team_keys: [APO, SUP] and bug_labels: [Bug, Issue].
linear/issues.py Updates person-scoped Linear queries to include multiple teams via in filter.
person_stats.py Adds is_priority_bug() and reuses it from issue_card_values().
README.md Documents the new config keys and their intended scope.
tests/test_config.py Adds unit coverage for new config helpers.
tests/test_linear_issues.py Updates query assertions/variables for team_keys and adds open-issues coverage.
tests/test_linear_issue_state_filters.py Updates patches to use get_linear_team_keys().
tests/test_person_stats.py Adds tests ensuring configurable bug labels affect metrics as intended.
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app.py
if issue.get("priority", 5) <= 2
and any(lbl.get("name") == "Bug" for lbl in issue.get("labels", {}).get("nodes", []))
]
priority_bugs = [issue for issue in completed_items if is_priority_bug(issue)]

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Security Agent completed with no findings; Cursor Bugbot was not present on this PR. Not approving because open changes-requested feedback requires human resolution before merge. No reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@bkraeling

Copy link
Copy Markdown
Contributor Author

this tool is my dashboard for apollos only, I have intentionally kept out other teams. I don't want ease or legacy stuff in here

Are they not also being used to generate the metrics on the people pages? Basically what I'm taking away from this is that if an urgent EASE bug comes up (as it did yesterday) that it should not factor in to the priority bugs fixed metric. Is that correct?

@redreceipt

redreceipt commented Sep 4, 2026 via email

Copy link
Copy Markdown
Member

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.

4 participants