Skip to content

feat(review): automatically label new PRs for accepted work - #5260

Merged
purp merged 8 commits into
NVIDIA:mainfrom
purp:feat/5259-label-accepted-work/purp
Nov 11, 2026
Merged

purp merged 8 commits into
NVIDIA:mainfrom
purp:feat/5259-label-accepted-work/purp

Conversation

@purp

@purp purp commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Deliver Part 1 of #5276: make accepted work explicit by adding a shared accepted-work library and using the existing Review Readiness tooling to label qualifying PRs with state:accepted when they open. This supplies the explicit acceptance signal for the later area/topic classification skill and agent. A PR qualifies if its author is a maintainer or has repository write access, or if it closes an accepted issue in this repository whose submitter or current assignee is the PR author.

New drafts and PRs awaiting area/topic classification can receive state:accepted; reviewer requests still wait for a ready, classified PR. Labeling is additive at creation: later events continue reviewer reconciliation but do not refresh or remove acceptance. Existing issue-acceptance and merge requirements continue to apply.

Related Issue

Part 1 of #5276; this PR does not close that issue. The remaining parts extract the /label-issue skill and then invoke its agent when an issue or PR receives state:accepted.

#5259 is superseded by #5276. Follow-up to #4863; reviewer permission removal was handled in #5257. Early issue classification and notification filtering remain in #5261.

Verified target-repository ADMIN access. This PR adds the explicit acceptance label; area/topic classification and migration are delivered separately under #5276.

Changes

  • Add label_accepted_work.py as an importable library: a pure predicate over supplied facts and a read-only GitHub adapter with an injected API callable. It has no CLI or label writes and propagates lookup failures.
  • Extend check_review_readiness.py and its existing workflow to add state:accepted on qualifying opened PRs, using trusted default-branch code and maintainer membership. Preserve preview support and reviewer reconciliation protections.
  • Protect the library/tests with CODEOWNERS and scope the reviewed trusted-trigger Zizmor exception to review-readiness.
  • Make CONTRIBUTING.md the canonical accepted-work definition. Explain why classification labels wait for acceptance to avoid noise in label-filtered Slack and other integration notifications; skills link to that definition.
  • Run the shared-library and review-readiness tests in branch CI.

Release Notes

Testing

  • 23 shared-library tests pass, covering privileged authors, accepted-issue submitters and assignees, unrelated/cross-repository issues, pagination, and API errors.

  • 43 review-readiness tests pass, including opening-time labeling, drafts, missing area labels, preview/idempotence, CLI roster loading, and preservation of reviewer protections.

  • Existing issue-acceptance tests (19) pass.

  • The workflow condition passes 10 event/draft/label cases, and its shell arguments enable acceptance labeling only for opened events. Shell, Python, and TOML syntax, documentation links, and git diff --check pass.

  • Read-only live previews exercise qualifying and nonqualifying PRs through the library; no PR labels were changed.

  • Final review reran all 85 focused tests (23 shared-library, 43 review-readiness, 19 issue-acceptance); all pass.

  • Ruff format/check, ty, Markdown/Mermaid lint, Actionlint with ShellCheck, and Zizmor with the repository configuration pass. The cleanup changes formatting and adds an explicit non-null assertion in a test; production Python ASTs are unchanged by the cleanup.

  • Every PR commit has a verified cryptographic signature and DCO sign-off.

  • The broad pre-commit hook completed Python format/lint, Markdown/Mermaid, Helm lint/docs, and license checks, then hit the command time limit during unrelated Rust lint compilation. This change uses the scoped verification policy in CONTRIBUTING.md; full PR CI remains separate.

  • Checks appropriate to the affected code and behavior pass (focused tests and lint pass; full PR CI is separate)

  • Unit tests added/updated

  • E2E tests added/updated (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

@purp purp added the area:build Related to CI/CD and builds label Nov 4, 2026
@purp
purp requested a review from a team as a code owner November 4, 2026 17:00
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@purp

purp commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Moving to draft to refine some bits here.

Comment thread .agents/skills/triage-issue/SKILL.md Resolved
Comment thread tasks/scripts/check_review_readiness.py Resolved
Comment thread CONTRIBUTING.md Resolved
@purp
purp force-pushed the feat/5259-label-accepted-work/purp branch from 2c1c701 to 2be2198 Compare November 11, 2026 14:26
elezar
elezar previously approved these changes Nov 11, 2026

@elezar elezar 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.

Let's get this in and iterate as required.

purp added 8 commits November 11, 2026 10:10
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@purp
purp force-pushed the feat/5259-label-accepted-work/purp branch from 2be2198 to dfb4ee5 Compare November 11, 2026 17:13
@purp
purp requested a review from elezar November 11, 2026 18:05
@purp
purp added this pull request to the merge queue Nov 11, 2026
Merged via the queue into NVIDIA:main with commit 86acdf9 Nov 11, 2026
91 of 92 checks passed
@purp
purp deleted the feat/5259-label-accepted-work/purp branch November 11, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build Related to CI/CD and builds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants