OSPRH-33339: Add rebasebot post-rebase hook script - #428
Conversation
|
@dlaw4608: This pull request references OSPRH-33339 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a strict Bash post-rebase hook that runs vendoring and generation targets, conditionally stages and commits changes after each target, supports optional author metadata, and invokes the workflow through ChangesRebasebot post-rebase automation
🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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 `@hack/rebasebot-helpers/post-rebase.sh`:
- Around line 19-21: Update the automated commit flow around the git status
check and first make invocation so pre-existing worktree changes cannot enter
generated commits: require a clean worktree before running the initial make, or
capture and stage only each target’s newly produced diff instead of using git
add -A. Preserve committing generated changes while excluding unrelated user or
rebase modifications.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ac6322e4-9994-43ce-b88b-d04ba8b37737
📒 Files selected for processing (1)
hack/rebasebot-helpers/post-rebase.sh
| if [[ -n $(git status --porcelain) ]]; then | ||
| git add -A | ||
| git commit "${author_flag[@]}" -q -m "$commit_message" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Prevent unrelated changes from entering generated commits.
git add -A stages the entire worktree, so any pre-existing user or rebase changes are included in the next automated commit. Require a clean worktree before the first make, or track and stage only the diff produced by each target.
Proposed guard
main(){
+ if [[ -n "$(git status --porcelain)" ]]; then
+ echo "post-rebase hook requires a clean worktree" >&2
+ return 1
+ fi
+
make full-vendoring🤖 Prompt for 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.
In `@hack/rebasebot-helpers/post-rebase.sh` around lines 19 - 21, Update the
automated commit flow around the git status check and first make invocation so
pre-existing worktree changes cannot enter generated commits: require a clean
worktree before running the initial make, or capture and stage only each
target’s newly produced diff instead of using git add -A. Preserve committing
generated changes while excluding unrelated user or rebase modifications.
This script is invoked by rebasebot via --post-rebase-hook to run `make merge-bot` after a rebase, replacing the merge-bot --run-make flag. Signed-off-by: Daniel Lawton <dlawton@redhat.com>
3bc009c to
640e5ad
Compare
|
@dlaw4608: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Adds
hack/rebasebot-helpers/post-rebase.sh, a post-rebase hook script for ShiftStacks migration frommerge-bottorebasebot.This replaces the merge-bot
--run-makeflag which ranmake merge-botafter each rebase. The script runsmake merge-bot(full-vendoring, generate, generate-openshift) and commits the results, following the pattern used bycluster-capi-operator.
The rebasebot periodic configs in openshift/release will reference this script via:
--post-rebase-hook git:dest/main:hack/rebasebot-helpers/post-rebase.shThe
git:dest/main:prefix fetches the script from main, so all release branch jobs (4.16 through 5.1) will use it without needing the script on each branch.Summary by CodeRabbit