Skip to content

OSPRH-33339: Add rebasebot post-rebase hook script - #428

Open
dlaw4608 wants to merge 1 commit into
openshift:mainfrom
shiftstack:rebasebot-hook-script
Open

OSPRH-33339: Add rebasebot post-rebase hook script#428
dlaw4608 wants to merge 1 commit into
openshift:mainfrom
shiftstack:rebasebot-hook-script

Conversation

@dlaw4608

@dlaw4608 dlaw4608 commented Jul 29, 2026

Copy link
Copy Markdown

Adds hack/rebasebot-helpers/post-rebase.sh, a post-rebase hook script for ShiftStacks migration from merge-bot to rebasebot.

This replaces the merge-bot --run-make flag which ran make merge-bot after each rebase. The script runs make merge-bot (full-vendoring, generate, generate-openshift) and commits the results, following the pattern used by
cluster-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.sh

The 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

  • Chores
    • Added an automated post-rebase hook that runs required merge-bot generation steps.
    • Ensures the working tree is clean before proceeding, and fails fast if preconditions aren’t met.
    • If changes are produced, stages them and creates a quiet commit with a standardized UPSTREAM: <drop>: Run make merge-bot message, using optional author details from environment settings.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 29, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown

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

Details

In response to this:

Adds hack/rebasebot-helpers/post-rebase.sh, a post-rebase hook script for ShiftStacks migration from merge-bot to rebasebot.

This replaces the merge-bot --run-make flag which ran make merge-bot after each rebase. The script runs make merge-bot (full-vendoring, generate, generate-openshift) and commits the results, following the pattern used by
cluster-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.sh

The 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.

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.

@openshift-ci
openshift-ci Bot requested review from gryf and mandre July 29, 2026 13:50
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: daf65e7b-80c6-446a-b005-33d578fc8566

📥 Commits

Reviewing files that changed from the base of the PR and between 3bc009c and d220e35.

📒 Files selected for processing (1)
  • hack/rebasebot-helpers/post-rebase.sh

Walkthrough

Adds a strict Bash post-rebase hook that verifies a clean worktree, runs make merge-bot, and conditionally commits resulting changes using optional rebasebot author metadata.

Changes

Rebasebot post-rebase automation

Layer / File(s) Summary
Merge-bot execution and generated-change commit
hack/rebasebot-helpers/post-rebase.sh
The hook rejects dirty worktrees, runs make merge-bot, and quietly commits any resulting changes with the fixed upstream message and optional author settings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: jira/valid-reference

Suggested reviewers: mandre, gryf


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
No-Weak-Crypto ❓ Inconclusive pending investigation need evidence
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a rebasebot post-rebase hook script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Only a shell hook was added; no Ginkgo tests or test titles changed, so the stability check is not applicable.
Test Structure And Quality ✅ Passed PR only adds a shell hook script; no Ginkgo tests were added or modified to review.
Microshift Test Compatibility ✅ Passed Only a shell hook was added; no Ginkgo tests or MicroShift-sensitive APIs/features were introduced.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only adds a shell hook; no Ginkgo e2e tests or test files were changed.
Topology-Aware Scheduling Compatibility ✅ Passed Only a post-rebase shell hook was added; no manifests, controllers, or pod scheduling logic changed.
Ote Binary Stdout Contract ✅ Passed PR only adds a shell rebase hook; no OTE binary process-level stdout writes or Go suite setup code were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a shell hook was added; no new Ginkgo tests or network/IP logic are present.
Container-Privileges ✅ Passed Only change is a bash hook script; no container/K8s manifests or privileged settings were added.
No-Sensitive-Data-In-Logs ✅ Passed The new hook only logs a fixed clean-worktree error and runs a quiet commit; it does not print secrets, PII, hostnames, or tokens.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign eshulman2 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28766d4 and 3bc009c.

📒 Files selected for processing (1)
  • hack/rebasebot-helpers/post-rebase.sh

Comment thread hack/rebasebot-helpers/post-rebase.sh Outdated
@dlaw4608
dlaw4608 force-pushed the rebasebot-hook-script branch from 3bc009c to 640e5ad Compare July 29, 2026 13:54
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>
@dlaw4608
dlaw4608 force-pushed the rebasebot-hook-script branch from 640e5ad to d220e35 Compare July 30, 2026 10:45
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

@dlaw4608: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants