Skip to content

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

Open
purp wants to merge 6 commits into
NVIDIA:mainfrom
purp:feat/5259-label-accepted-work/purp
Open

purp wants to merge 6 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 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)

Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@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
purp added 2 commits November 4, 2026 17:02
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 marked this pull request as draft November 4, 2026 18:34
@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.

Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@purp purp changed the title feat(review): automatically label PRs for accepted work feat(review): label new PRs using shared accepted-work checks Nov 4, 2026
@purp purp changed the title feat(review): label new PRs using shared accepted-work checks feat(review): automatically label new PRs for accepted work Nov 5, 2026
Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@purp
purp marked this pull request as ready for review November 9, 2026 17:53

This branch has not been deployed

No deployments
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.

2 participants