-
Notifications
You must be signed in to change notification settings - Fork 23
github: split trailer addition from pull request merging #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a new "Add Trailer" workflow to append Acked-by/Tested-by trailers from issue comments or workflow_run events. Removes the "Apply PR" workflow and its .github/workflows/apply.sh script. Adds a new "Review" workflow that triggers on pull request review approvals. Updates check.yml and package.yml to skip specific jobs when the triggering actor is grout-bot. Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/add-trailer.yml(1 hunks).github/workflows/apply.sh(0 hunks).github/workflows/apply.yml(0 hunks).github/workflows/check.yml(3 hunks).github/workflows/package.yml(2 hunks).github/workflows/review.yml(1 hunks)
💤 Files with no reviewable changes (2)
- .github/workflows/apply.sh
- .github/workflows/apply.yml
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/add-trailer.yml
20-20: if: condition "${{ (github.event_name == 'issue_comment' && github.event.issue.pull_request\n && (contains(github.event.comment.body, 'Acked-by:') || contains(github.event.comment.body, 'Tested-by:')))\n|| (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }}\n" is always evaluated to true because extra characters are around ${{ }}
(if-cond)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: build-and-tests (clang-15, none, debugoptimized, ubuntu-22.04, false)
- GitHub Check: build-and-tests (clang-16, none, debugoptimized, ubuntu-24.04, false)
- GitHub Check: build-and-tests (gcc-13, none, debugoptimized, ubuntu-24.04, -Dfrr=enabled, false)
- GitHub Check: build-and-tests (clang-18, none, debugoptimized, ubuntu-24.04, false)
- GitHub Check: build-and-tests (gcc-14, address, debug, ubuntu-24.04, -Dfrr=enabled, true)
- GitHub Check: build-cross-aarch64
- GitHub Check: deb
- GitHub Check: rpm
🔇 Additional comments (6)
.github/workflows/check.yml (1)
21-21: Guard pattern is sound. Skipping resource-intensive jobs when grout-bot commits prevents CI waste during trailer amendments.Also applies to: 112-112, 152-152
.github/workflows/review.yml (1)
1-19: Minimal but functional. Serves as trigger for add-trailer workflow on approved reviews..github/workflows/package.yml (1)
17-17: Consistent with check.yml guards. Skips packaging when grout-bot commits trailers.Also applies to: 67-67
.github/workflows/add-trailer.yml (3)
96-114: Solid email resolution fallback. Gracefully handles missing emails by searching git history and shortlog, with clear error handling.
33-70: Trailer extraction logic is sound. Regex correctly parses acked/tested-by formats, and Reviewed-by construction from workflow actor is appropriate. UNKNOWN_EMAIL placeholder is resolved downstream.
79-85: Token-based checkout with correct persistence. Using TRAILER_BOT_TOKEN for push permissions andpersist-credentials: trueto retain auth for the force-push step.
Remove the apply workflow that rebased and merged pull requests in one step. Replace it with a workflow that only amends commits with trailers when reviews are approved or when trailer comments are posted. The new add-trailer workflow triggers on issue comments containing Acked-by or Tested-by trailers and on successful completion of the Review workflow (which runs when a pull request review is approved). It extracts or constructs the appropriate trailer, rebases all commits in the PR branch to append it, and force-pushes back to the PR branch. The force push is performed by a dedicated bot account with maintainer permissions. When the bot pushes, most CI checks are skipped to avoid redundant test runs. The actual merge is now done using the standard GitHub merge button instead of being automated, allowing maintainers to decide when to merge after trailers have been added. Signed-off-by: Robin Jarry <[email protected]>
71c18dc to
7c02267
Compare
Remove the apply workflow that rebased and merged pull requests in one step. Replace it with a workflow that only amends commits with trailers when reviews are approved or when trailer comments are posted.
The new add-trailer workflow triggers on issue comments containing Acked-by or Tested-by trailers and on successful completion of the Review workflow (which runs when a pull request review is approved). It extracts or constructs the appropriate trailer, rebases all commits in the PR branch to append it, and force-pushes back to the PR branch.
The force push is performed by a dedicated bot account with maintainer permissions. When the bot pushes, most CI checks are skipped to avoid redundant test runs.
The actual merge is now done using the standard GitHub merge button instead of being automated, allowing maintainers to decide when to merge after trailers have been added.
Summary by CodeRabbit
New Features
Chores