Skip to content

Separate automation author routing from approval policy - #342

Merged
trask merged 9 commits into
mainfrom
trask-maintenance-bot-authors
Sep 4, 2026
Merged

Separate automation author routing from approval policy#342
trask merged 9 commits into
mainfrom
trask-maintenance-bot-authors

Conversation

@trask

@trask trask commented Sep 2, 2026

Copy link
Copy Markdown
Member

Prevents unattended automation PRs from routing dashboard work to an author that cannot respond. Copilot-delegated PRs can still route to a human recovered from an assignee or the first commit's committer.

Dependabot, Renovate, otelbot, and opentelemetrybot keep the one-approval maintenance threshold. Other automation uses the repository's configured approval count.

Dashboard state advances to version 15. When the dashboard loads state from versions 11 through 13, it derives a missing author_can_act value and drops stale author routes that conflict with it. Version 14 remains reserved for #343 and is regenerated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

The focused implementation matches the stated routing behavior and includes coverage at evaluation and routing boundaries.

Pull request overview

Recognizes known maintenance bots across GitHub identity formats so automation PRs route to reviewers and maintainers rather than their bot author.

Changes:

  • Canonicalizes app and bot login wrappers.
  • Adds opentelemetrybot as a maintenance identity.
  • Tests routing with failing CI, author feedback, and approval progression.
File summaries
File Description
pull_request_evaluation.py Normalizes identities and classifies maintenance bots.
test_pull_request_evaluation.py Covers identity forms and end-to-end routing.
test_routing_decision.py Verifies bot PRs never route to their author.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 2, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on maintainers · refreshed 2026-09-04 06:51 UTC

Merge when ready.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41074282-3988-4c4d-829c-fcefcebfcf69
@trask trask changed the title Fix maintenance bot author recognition Separate automation author routing from approval policy Sep 2, 2026
@trask
trask requested a balanced review from Copilot September 2, 2026 20:30
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41074282-3988-4c4d-829c-fcefcebfcf69

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.

🟡 Changes recommended

Bare renovate and otelbot users are incorrectly granted maintenance-bot approval policy.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/scripts/pull-request-dashboard/pull_request_evaluation.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41074282-3988-4c4d-829c-fcefcebfcf69

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.

🟢 Approval recommended

The implementation consistently separates author capability from approval policy and includes targeted regression coverage.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41074282-3988-4c4d-829c-fcefcebfcf69

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.

🟢 Approval recommended

The implementation consistently separates both policies and includes focused regression and migration coverage.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

🟡 Changes recommended

The dashboard state version must be incremented to prevent older workers from restoring obsolete routing during rollout.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/scripts/pull-request-dashboard/state.py
Advance dashboard state to version 15 without reusing the independent version 14 schema. Migrate production versions through author identity inference and regenerate unknown version 14 state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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

Compatible legacy caches can retain an author route for unattended automation until reevaluation.

Review details

Suppressed comments (1)

.github/scripts/pull-request-dashboard/state.py:819

  • Accepting versions 11–13 preserves each cached StoredDashboardResult.route unchanged. For example, the new v13 fixture decodes author_can_act=False for app/dependabot but still leaves its stored route as author; dashboard rendering, status comments, and nudge delivery consume that route directly, so work can continue to be routed to the unavailable bot until backfill reevaluates that PR. Please migrate cached author routes for unattended authors to at least approver, or regenerate these older versions instead of accepting them.
        compatible_versions=(11, 12, 13),
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Discard compatible cached results that cannot reconcile an author route with the inferred or explicit author capability. Preserve human and explicit actionable-author routes for migration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@trask
trask requested a balanced review from Copilot September 2, 2026 21:07

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.

🟢 Approval recommended

The policy separation, migration behavior, and key automation identity cases are consistently implemented and covered by focused tests.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

🟡 Changes recommended

The routing documentation incorrectly omits the Copilot-delegation exception.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread .github/scripts/pull-request-dashboard/RATIONALE.md Outdated
Comment thread pull-request-dashboard/README.md Outdated
Copilot comment:

“Automation-authored PRs never route to their author” incorrectly includes Copilot-delegated PRs, whose effective author is deliberately recovered and can receive the author route. Qualify this as unattended automation and document the delegation exception.

Copilot comment:

This states that every automation-authored PR avoids the author route, but Copilot-delegated PRs intentionally route to the recovered human author. Please distinguish unattended automation from delegated Copilot authors so the documented policy matches the implementation and PR description.

Analysis: Both documents described the rule too broadly. The implementation excludes unattended automation from author routing, but it recovers a human assignee or the first commit's human committer for a Copilot-delegated pull request. The revised text states both cases.

Upsides: The policy documentation now matches the author recovery logic and tells operators when a Copilot-authored pull request can return to a person.

Downsides: The documentation now includes the two inputs used to recover the human author.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

The implementation matches the stated routing policy and includes focused migration and regression coverage.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Review finding:

This PR deletes the comment that recorded how GitHub reports Copilot logins: `gh pr view`'s `author` field uses the `app/<slug>` form, while the commits endpoint's `committer.login` field can return the bare `copilot` slug. The replacement constants still depend on that knowledge. `_COPILOT_PR_AUTHOR_IDENTITIES` keeps both `copilot-swe-agent` and the bare `copilot`, and `_COPILOT_COMMITTER_IDENTITIES` exists as a separate one-element set only because of the committer shape, yet nothing in the file explains either fact any more. A reader cannot tell why the two sets differ or why bare `copilot` is listed as a pull request author identity, and could reasonably merge them or drop the bare entry. Fix: restore a short comment above these constants stating the two API shapes and why the committer set stays separate.

Analysis: The two Copilot slugs come from two different GitHub endpoints, and no amount of reading the code recovers that. `normalize_author_identity` strips the `app/` prefix and the `[bot]` suffix, which explains the shape of each entry but not why `copilot-swe-agent` and `copilot` are both author identities while only `copilot` is a committer identity. The restored comment records the endpoint behavior, says which set covers which endpoint, and notes that the entries are already normalized.

Upsides: A reader can tell why the two sets differ and will not merge them or drop the bare `copilot` entry, which would let a Copilot-authored PR be recovered as if a human had written it.

Downsides: No material downside identified.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

The routing and migration behavior is consistent with the stated policy and covered by focused tests.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@trask
trask marked this pull request as ready for review September 2, 2026 22:00
@trask
trask requested a review from a team as a code owner September 2, 2026 22:00
@trask
trask requested a review from adrielp September 2, 2026 22:00
@trask
trask marked this pull request as draft September 2, 2026 23:03
@trask
trask marked this pull request as ready for review September 3, 2026 15:15
@trask
trask merged commit f301607 into main Sep 4, 2026
7 checks passed
@trask
trask deleted the trask-maintenance-bot-authors branch September 4, 2026 17:01
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.

3 participants