ci: auto-assign PR author on open#328
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds an Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-assign-author.yaml:
- Around line 42-46: Remove the pull-requests: write permission from the
workflow permissions block. Keep issues: write unchanged, since the auto-assign
job uses github.rest.issues.addAssignees(...) for this operation.
- Around line 62-73: Before the github.rest.issues.addAssignees call in the
workflow’s assignment logic, fetch the issue’s current assignees from the live
API and skip assignment when any are present. Use the live response for the
preservation check instead of relying on pr.assignees from the opened event
snapshot, while retaining the existing author assignment behavior when no
assignees exist.
- Around line 68-77: Wrap the addAssignees call and its non-assignable-user
check in try/catch within the workflow step. In the catch handler, issue a
core.warning that includes the PR number and author, then rethrow the error or
explicitly preserve best-effort behavior according to the step’s intended
contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 04446222-4458-4d0b-96e2-054d2e2e694a
📒 Files selected for processing (1)
.github/workflows/auto-assign-author.yaml
5b91369 to
bb27c9a
Compare
|
Addressed all three:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/auto-assign-author.yaml:
- Around line 33-35: Update the concurrency group in the auto-assign workflow
and the corresponding configuration in assign.yaml to use the same PR-assignment
group prefix, while retaining each workflow’s appropriate event number
expression (including github.event.issue.number in assign.yaml), so both
workflows serialize per issue or pull request.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 2165b47e-30cd-4d3b-8140-1fb35bb1959c
📒 Files selected for processing (1)
.github/workflows/auto-assign-author.yaml
8df226f to
5b2d918
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/assign.yaml:
- Around line 43-46: Update .github/workflows/assign.yaml lines 43-46 and its
trigger condition around the “Issues only” comment to allow assignment commands
on pull-request comments while retaining the shared concurrency group. In
.github/workflows/auto-assign-author.yaml lines 17-18, preserve the handoff
claim only after PR comments are accepted; lines 33-35 require no direct change
because the shared concurrency group will provide the intended serialization.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: c35c17b3-27ae-4b97-b75f-b9186854224e
📒 Files selected for processing (2)
.github/workflows/assign.yaml.github/workflows/auto-assign-author.yaml
|
Addressed: both assignment workflows now share one concurrency group ( (The same fix for the packages repo landed separately in NVIDIA/nodewright-packages#105, since its auto-assign PR had already merged.) |
b75cf0f to
b1e975b
Compare
|
Good catch — this exposes that the earlier concurrency finding rested on a false premise. So I've reverted the coupling rather than expand |
Add a workflow that assigns the author to their own PR when it is opened, so every PR has a clear owner. Bots and PRs already assigned are skipped. Contributors can still reassign with /assign. Uses pull_request_target so it also works for fork PRs; the job never checks out or runs PR code. Signed-off-by: Brian Lockwood <lockwobr@gmail.com>
b1e975b to
b3dd0ed
Compare
## What Corrects the header comment in `auto-assign-author.yaml`. It claimed contributors can hand a PR off with `/assign`, but `assign.yaml` only runs on **issue** comments — it excludes PRs via `!github.event.issue.pull_request`. The comment now says PR reassignment is done from the GitHub UI. No behavior change; comment-only. ## Background This PR originally proposed sharing a concurrency group between `assign.yaml` and `auto-assign-author.yaml`. That was based on a false premise (that `/assign` runs on PRs): since `/assign` is issue-only and auto-assign is PR-only, the two never operate on the same target and can't race, so the coupling was dropped. The mirror change on the operator repo (NVIDIA/nodewright#328) likewise reverted the coupling. Signed-off-by: Brian Lockwood <lockwobr@gmail.com>
What
Adds an
Auto-Assign PR Authorworkflow that assigns the author to their own PR when it is opened, so every PR has a clear owner from the start.Why
Complements the existing self-service
assign.yaml(/assign): rather than requiring a manual claim, the author is set automatically on open. They (or a maintainer) can still reassign with/assign @useror/unassign.Design notes
addAssigneessilently drops users without repo access, so the workflow logs a warning if the author couldn't be assigned.pull_request_targetso it also works for fork PRs (the read-onlypull_requesttoken can't assign). This is safe: the job never checks out or executes PR code — it only calls the assignee API with the event payload.github-scriptpinned to the same SHA used by the other workflows.