Skip to content

OAPE-829: Add helm auto-rebase - #458

Open
neha037 wants to merge 7 commits into
openshift:mainfrom
neha037:oape-829-helm-auto-rebase
Open

OAPE-829: Add helm auto-rebase#458
neha037 wants to merge 7 commits into
openshift:mainfrom
neha037:oape-829-helm-auto-rebase

Conversation

@neha037

@neha037 neha037 commented Aug 3, 2026

Copy link
Copy Markdown

Description of the change:

Adds hack/auto-rebase.sh — a Prow periodic wrapper that automates rebasing this midstream onto newer upstream Operator SDK release tags. Also hardens UPSTREAM-MERGE.sh (URL validation, merge-failure handling, conflict resolution) and removes obsolete Dockerfiles / CI targets that are no longer used.

Key files:

  • hack/auto-rebase.sh — discovers the newest upstream v* tag beyond UPSTREAM-VERSION, runs UPSTREAM-MERGE.sh, updates golang builder pins, runs patch/build gate, pushes a branch, and opens a PR. Does not auto-merge.
  • UPSTREAM-MERGE.sh — improved upstream URL regex (accepts HTTPS and SSH), proper merge-abort on conflict, while read conflict resolution loop.
  • README.md — documents the Helm Operator focus, automatic rebase workflow, CI credentials, and local dry-run instructions.

Removed dead files: ci/dockerfiles/go-e2e.Dockerfile, ci/dockerfiles/scorecard-proxy.Dockerfile, release/helm/upstream.Dockerfile, and the ci-images Makefile target.

Companion Prow periodic job PR: openshift/release#82799

Motivation for the change:

Manual upstream rebases are error-prone and easy to forget. Automating the process (OAPE-829) ensures timely rebase PRs are opened weekly, reducing toil and keeping the Helm Operator midstream current with upstream Operator SDK releases.

Checklist

If the pull request includes user-facing changes, extra documentation is required:

  • No user-facing changes; this is CI/automation tooling.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The change documents the Helm Operator repository scope, improves upstream merge handling, adds an automated rebase and pull request workflow, and removes obsolete Docker image definitions and the ci-images target.

Changes

Upstream rebase workflow

Layer / File(s) Summary
Repository scope and workflow documentation
README.md, ci/prow.Makefile, ci/dockerfiles/*, release/helm/upstream.Dockerfile
The README documents the Helm Operator focus and automatic rebase process. Obsolete image definitions and the ci-images target are removed.
Upstream merge handling
UPSTREAM-MERGE.sh
The script validates upstream URLs, recreates versioned branches, handles conflicted merges, resolves filenames safely, and updates merge metadata.
Automation setup and release selection
hack/auto-rebase.sh
The new wrapper configures remotes and credentials, installs GitHub CLI when needed, selects release tags, supports dry runs, and checks for duplicate pull requests.
Validation and pull request publication
hack/auto-rebase.sh
The wrapper updates Go builder references, runs patch and build gates, restores worktree state after failures, and optionally pushes branches and creates pull requests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: varshaprasad96, trilokgeer

Sequence Diagram(s)

sequenceDiagram
  participant Operator as Operator
  participant AutoRebase as hack/auto-rebase.sh
  participant Git as Git repository
  participant GitHub as GitHub
  participant PatchGate as Patch and build validation

  Operator->>AutoRebase: select release tag or enable discovery
  AutoRebase->>GitHub: detect release tags and existing pull requests
  AutoRebase->>Git: fetch upstream and create rebase branch
  AutoRebase->>Git: run UPSTREAM-MERGE.sh
  AutoRebase->>PatchGate: update builders and run validation
  PatchGate-->>AutoRebase: return patch and build status
  AutoRebase->>GitHub: push branch and create pull request
Loading

Important

Pre-merge checks failed

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

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error ensure_remote logs complete current and target remote URLs; configurable URLs can contain embedded passwords/tokens or internal hostnames. Redact URL userinfo and sensitive query values before logging, or log only the remote name and host allowlisted without credentials.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (13 passed)
Check name Status Explanation
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 The PR changes no test paths and adds no Ginkgo DSL declarations; the only non-vendor Go change contains no test titles.
Test Structure And Quality ✅ Passed The pull request changes only Markdown, shell, Dockerfile, and Makefile files; it adds or modifies no Ginkgo or Go test code.
Microshift Test Compatibility ✅ Passed The PR adds no Go or Ginkgo test files; its changed files are shell, README, Makefile, and Dockerfile changes, so this check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The isolated PR diff changes no *_test.go or test paths and adds no Ginkgo declarations or multi-node assumptions; the SNO check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The PR-specific diff contains only README/shell automation, a Makefile change, and Dockerfile deletions; it adds or modifies no deployment manifests, operator code, controllers, or scheduling const...
Ote Binary Stdout Contract ✅ Passed The PR changes no Go files and adds no OTE binary; existing scorecard entrypoints print JSON from main(), with no process-level non-JSON stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR diff adds no Ginkgo e2e tests; it changes shell automation, documentation, and Dockerfiles, so this compatibility check is not applicable.
No-Weak-Crypto ✅ Passed The isolated PR patch adds no MD5, SHA1, DES, RC4, Blowfish, or ECB crypto; GITHUB_TOKEN is only checked for presence and is not compared as a secret.
Container-Privileges ✅ Passed The complete PR diff adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation:true, or runAsUser:0 settings; deleted images used non-root UID 1001.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the issue and the main change: adding Helm automatic rebasing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: neha037
Once this PR has been reviewed and has the lgtm label, please assign arkadeepsen 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: 5

🧹 Nitpick comments (3)
UPSTREAM-MERGE.sh (1)

49-55: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Fail fast if the branch update steps fail.

git checkout "$rebase_branch" at Line 43 and git merge "$remote_branch" at Line 49 are unchecked. If either fails, the script continues and creates the rebase branch from the wrong commit. The new force-delete at Lines 50-54 also removes the previous protection from the fallback message at Line 55. Add explicit checks.

♻️ Proposed change
-git merge "$remote_branch"
+git merge "$remote_branch" || { echo "Failed to merge $remote_branch, aborting."; exit 1; }

Apply the same pattern to Line 43:

git checkout "$rebase_branch" || { echo "Failed to checkout $rebase_branch, aborting."; exit 1; }
🤖 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 `@UPSTREAM-MERGE.sh` around lines 49 - 55, Make the branch update steps fail
fast: add explicit error handling to git checkout "$rebase_branch" and git merge
"$remote_branch" so each prints a failure message and exits nonzero when
unsuccessful. Preserve the existing cleanup and rebase-branch creation flow,
while retaining a clear fallback message if creating the new branch fails.
hack/auto-rebase.sh (2)

237-256: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a failure trap for diagnostics.

If ./UPSTREAM-MERGE.sh fails at Line 238, set -e ends the script while the repository is mid-merge and origin still holds the token URL. A trap that logs the current branch and merge state helps triage the periodic job.

♻️ Proposed change
+  trap 'rc=$?; [[ $rc -ne 0 ]] && log "FAILED (rc=${rc}) on branch $(git rev-parse --abbrev-ref HEAD 2>/dev/null)"; exit $rc' ERR
+
   log "Running UPSTREAM-MERGE.sh ${tag} ${REBASE_BRANCH} ${UPSTREAM_REMOTE}"
   ./UPSTREAM-MERGE.sh "$tag" "$REBASE_BRANCH" "$UPSTREAM_REMOTE"
🤖 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/auto-rebase.sh` around lines 237 - 256, Add a failure trap around the
main auto-rebase flow containing UPSTREAM-MERGE.sh that logs the current branch
and merge state when the merge command fails or the script exits unexpectedly.
Ensure the trap also cleans sensitive token-bearing remote configuration before
termination, while preserving the existing success, patch-gate, push, and
pull-request behavior.

65-71: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Avoid writing the token into .git/config.

git remote set-url stores GITHUB_TOKEN in cleartext in .git/config. The token then persists for the rest of the job and in any artifact that archives the workspace. Use a credential store outside the repository instead.

🔒️ Proposed change
 configure_origin_auth() {
   if [[ -z "${GITHUB_TOKEN:-}" ]]; then
     return 0
   fi
-  # Prefer HTTPS with embedded token for non-interactive push.
-  git remote set-url "$ORIGIN_REMOTE" "https://x-access-token:${GITHUB_TOKEN}`@github.com/`${DEST_ORG_REPO}.git"
+  # Keep the token out of .git/config; use a short-lived credential file.
+  local cred_file
+  cred_file=$(mktemp)
+  chmod 600 "$cred_file"
+  printf 'https://x-access-token:%s@github.com\n' "$GITHUB_TOKEN" >"$cred_file"
+  git config credential.helper "store --file=${cred_file}"
+  git remote set-url "$ORIGIN_REMOTE" "https://github.com/${DEST_ORG_REPO}.git"
+  trap 'rm -f "$cred_file"' EXIT
 }
🤖 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/auto-rebase.sh` around lines 65 - 71, Update configure_origin_auth to
avoid embedding GITHUB_TOKEN in the URL passed to git remote set-url, which
persists the token in .git/config. Keep the repository remote URL free of
credentials and configure a temporary credential mechanism outside the
repository for the non-interactive push, scoped to the job.
🤖 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/auto-rebase.sh`:
- Around line 8-20: Update the environment-variable documentation header in
auto-rebase.sh to include UPSTREAM_URL and ORIGIN_URL, noting that they control
the repository URLs configured by ensure_remote. Keep the existing descriptions
and defaults unchanged.
- Around line 47-54: Update ensure_remote to avoid silently rewriting an
existing remote URL: either log the URL change clearly before git remote
set-url, or require an explicit caller opt-in before performing it. Preserve
adding missing remotes and ensure the main invocation for ORIGIN_REMOTE no
longer changes a developer’s existing origin unnoticed.
- Around line 73-86: Harden ensure_gh by creating a private temporary directory
with mktemp -d, downloading with curl --fail, and validating the archive against
the release checksum before extraction. Use that directory instead of fixed /tmp
paths, create ${HOME}/bin before the fallback install, and structure
installation failures so they reach the existing die message rather than exiting
early under set -euo pipefail.

In `@README.md`:
- Around line 69-76: Update both shell code fences in the README examples around
the DRY_RUN and FORCE_TAG commands to specify the bash language identifier,
preserving their existing commands and formatting.

In `@UPSTREAM-MERGE.sh`:
- Around line 30-34: Update the sdk_repo validation condition to anchor the
remote URL at its beginning, allowing only known GitHub forms such as
github.com:..., github.com/..., or https://github.com/..., while continuing to
accept the existing repository suffix variants. Keep the rejection message and
exit behavior unchanged.

---

Nitpick comments:
In `@hack/auto-rebase.sh`:
- Around line 237-256: Add a failure trap around the main auto-rebase flow
containing UPSTREAM-MERGE.sh that logs the current branch and merge state when
the merge command fails or the script exits unexpectedly. Ensure the trap also
cleans sensitive token-bearing remote configuration before termination, while
preserving the existing success, patch-gate, push, and pull-request behavior.
- Around line 65-71: Update configure_origin_auth to avoid embedding
GITHUB_TOKEN in the URL passed to git remote set-url, which persists the token
in .git/config. Keep the repository remote URL free of credentials and configure
a temporary credential mechanism outside the repository for the non-interactive
push, scoped to the job.

In `@UPSTREAM-MERGE.sh`:
- Around line 49-55: Make the branch update steps fail fast: add explicit error
handling to git checkout "$rebase_branch" and git merge "$remote_branch" so each
prints a failure message and exits nonzero when unsuccessful. Preserve the
existing cleanup and rebase-branch creation flow, while retaining a clear
fallback message if creating the new branch fails.
🪄 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: Enterprise

Run ID: f81b84be-5ebe-46dd-a0ef-71ad683f1615

📥 Commits

Reviewing files that changed from the base of the PR and between 5de9e25 and d7d5825.

📒 Files selected for processing (3)
  • README.md
  • UPSTREAM-MERGE.sh
  • hack/auto-rebase.sh

Comment thread hack/auto-rebase.sh
Comment thread hack/auto-rebase.sh
Comment thread hack/auto-rebase.sh
Comment thread README.md Outdated
Comment thread UPSTREAM-MERGE.sh Outdated
@neha037 neha037 changed the title OAPE: Add helm auto-rebase OAPE-829: Add helm auto-rebase Aug 3, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 3, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@neha037: This pull request references OAPE-829 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Description of the change:

Motivation for the change:

Checklist

If the pull request includes user-facing changes, extra documentation is required:

Summary by CodeRabbit

  • New Features

  • Added periodic automation to detect and integrate newer upstream Operator SDK releases.

  • Added support for dry runs, forced versions, configurable remotes and branches, validation gates, and optional pull request creation.

  • Improved upstream merge handling for common GitHub URL formats and recovery from previous failed attempts.

  • Documentation

  • Updated syncing guidance for the Helm Operator workflow and automatic rebasing.

  • Corrected the documented merge command and added required automation permissions.

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.

@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: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
UPSTREAM-MERGE.sh (1)

51-54: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Protect existing local branch commits before force-deleting.

git branch -D can remove the only local reference to unmerged commits in ${version}-rebase-${rebase_branch}. The script can be run manually, although the comment describes this cleanup as CI-specific. Gate the deletion to CI, require explicit confirmation, or create a backup reference first.

🤖 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 `@UPSTREAM-MERGE.sh` around lines 51 - 54, Update the existing-branch cleanup
around `${version}-rebase-${rebase_branch}` so `git branch -D` cannot remove
unmerged commits without protection. Restrict deletion to CI, require explicit
confirmation, or create a backup reference before deleting, while preserving the
current cleanup behavior for safe automated runs.
🧹 Nitpick comments (1)
UPSTREAM-MERGE.sh (1)

44-48: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Check the tracking-branch command directly.

The code checks $? after the assignment. Use the assignment in the if condition and quote '@{u}'. This removes indirect status handling and avoids the ShellCheck warnings.

Proposed refactor
-remote_branch=$(git rev-parse --abbrev-ref --symbolic-full-name @{u})
-if [[ $? -ne 0 ]]; then
+if ! remote_branch=$(git rev-parse --abbrev-ref --symbolic-full-name '@{u}'); then
   echo "Your branch is not properly tracking a remote as required, aborting."
   exit 1
 fi
🤖 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 `@UPSTREAM-MERGE.sh` around lines 44 - 48, Update the tracking-branch lookup in
UPSTREAM-MERGE.sh to use the git rev-parse command directly as the if-condition,
and quote the @{u} revision argument. Remove the separate $? check while
preserving the existing error message and exit behavior when no upstream branch
is configured.

Source: Linters/SAST tools

🤖 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/auto-rebase.sh`:
- Around line 152-154: Update the pre-mutation validation in the auto-rebase
flow, before the mutation phase, to reject any non-empty git status --porcelain
output, including untracked files, before reaching the cleanup block containing
git clean -fd. Preserve the existing patch-gate behavior while ensuring
pre-existing untracked work cannot be deleted.
- Around line 77-83: Update the EXIT trap registration in configure_origin_auth
to capture the current cred_file path when the trap is created, rather than
expanding the local variable at process exit. Preserve removal of the temporary
credential file and compatibility with set -u.

In `@UPSTREAM-MERGE.sh`:
- Line 49: Update the tag merge command in the merge flow to handle failures
from `git merge --no-commit tags/"$version"`: continue only when `MERGE_HEAD`
confirms an active conflict state, and otherwise print an abort message and exit
nonzero so staged version changes cannot be committed without the requested tag
merge. Keep the existing successful merge path unchanged.
- Around line 31-33: Update the validation failure branch in UPSTREAM-MERGE.sh
to avoid interpolating the full sdk_repo value in its echo message. Log a fixed,
non-sensitive validation error instead, while preserving the existing rejection
and exit behavior.
- Line 31: Update the remote URL validation condition in the upstream repository
check to reject plain HTTP while continuing to accept HTTPS and supported SSH
forms for operator-framework/operator-sdk, so git fetch only uses encrypted
transport.

---

Outside diff comments:
In `@UPSTREAM-MERGE.sh`:
- Around line 51-54: Update the existing-branch cleanup around
`${version}-rebase-${rebase_branch}` so `git branch -D` cannot remove unmerged
commits without protection. Restrict deletion to CI, require explicit
confirmation, or create a backup reference before deleting, while preserving the
current cleanup behavior for safe automated runs.

---

Nitpick comments:
In `@UPSTREAM-MERGE.sh`:
- Around line 44-48: Update the tracking-branch lookup in UPSTREAM-MERGE.sh to
use the git rev-parse command directly as the if-condition, and quote the @{u}
revision argument. Remove the separate $? check while preserving the existing
error message and exit behavior when no upstream branch is configured.
🪄 Autofix

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: Enterprise

Run ID: 6b8b077e-6fbe-40b1-a65c-2ec558700927

📥 Commits

Reviewing files that changed from the base of the PR and between d7d5825 and 4c3cf41.

📒 Files selected for processing (3)
  • README.md
  • UPSTREAM-MERGE.sh
  • hack/auto-rebase.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

Comment thread hack/auto-rebase.sh Outdated
Comment thread hack/auto-rebase.sh
Comment thread UPSTREAM-MERGE.sh Outdated
Comment thread UPSTREAM-MERGE.sh Outdated
Comment thread UPSTREAM-MERGE.sh Outdated
Comment thread UPSTREAM-MERGE.sh Outdated
@neha037

neha037 commented Aug 5, 2026

Copy link
Copy Markdown
Author

/retest

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
UPSTREAM-MERGE.sh (3)

137-137: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Stop when a local commit fails.

The script does not enable set -e, and the git commit at Line [137] is unchecked. A hook, signing, identity, or repository-state failure can leave the merge uncommitted while Lines [139]-[154] continue and print completion. The automation wrapper can then publish a branch without the intended merge commit.

Guard the commit at Line [137] and the vendor commit at Line [149] with explicit failure handling.

Proposed fix
-git commit -m "Merge upstream tag $version" -m "Operator SDK $version" -m "Merge executed via ./UPSTREAM-MERGE.sh $version $rebase_branch $upstream_remote" -m "$(printf "Overwritten conflicts:\\n%s" "$unmerged_files")"
+if ! git commit -m "Merge upstream tag $version" -m "Operator SDK $version" -m "Merge executed via ./UPSTREAM-MERGE.sh $version $rebase_branch $upstream_remote" -m "$(printf "Overwritten conflicts:\\n%s" "$unmerged_files")"; then
+  echo "Failed to create the upstream merge commit, aborting."
+  exit 1
+fi
🤖 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 `@UPSTREAM-MERGE.sh` at line 137, Update the git commit commands in
UPSTREAM-MERGE.sh, specifically the merge commit near the shown command and the
vendor commit near the later commit block, to use explicit failure handling. If
either commit fails, immediately stop the script with a nonzero status so
subsequent completion or publishing steps cannot run.

43-54: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Ensure the target branch is checked out.

git checkout "$rebase_branch" can treat a tracked path as a pathspec. If no branch has that name, the command succeeds without changing HEAD, so the later lookup and merge operate on the previously checked-out branch. Use a branch-only command or verify git symbolic-ref --quiet --short HEAD equals $rebase_branch.

🤖 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 `@UPSTREAM-MERGE.sh` around lines 43 - 54, Update the checkout step for
rebase_branch to use branch-only checkout semantics, such as the existing
branch-specific Git command, so a tracked path cannot be accepted as a
successful checkout. Ensure the script aborts when rebase_branch is not actually
checked out before performing the upstream lookup and merge.

30-37: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Security Misconfiguration (CWE-346): Origin Validation Error

Exploitability: Moderate

Require explicit upstream URL forms.

Line 31 accepts github.com/operator-framework/operator-sdk as a local path. git fetch can then read local Git objects, so the allowlist does not prove that the upstream tag came from GitHub. Accept only explicit https://github.com/... and git@github.com:... forms.

🤖 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 `@UPSTREAM-MERGE.sh` around lines 30 - 37, Update the sdk_repo validation regex
in UPSTREAM-MERGE.sh to accept only explicit HTTPS URLs beginning with
https://github.com/operator-framework/operator-sdk and SSH URLs beginning with
git@github.com:operator-framework/operator-sdk, while preserving optional .git
and trailing-slash handling; reject the bare
github.com/operator-framework/operator-sdk form.
🤖 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.

Outside diff comments:
In `@UPSTREAM-MERGE.sh`:
- Line 137: Update the git commit commands in UPSTREAM-MERGE.sh, specifically
the merge commit near the shown command and the vendor commit near the later
commit block, to use explicit failure handling. If either commit fails,
immediately stop the script with a nonzero status so subsequent completion or
publishing steps cannot run.
- Around line 43-54: Update the checkout step for rebase_branch to use
branch-only checkout semantics, such as the existing branch-specific Git
command, so a tracked path cannot be accepted as a successful checkout. Ensure
the script aborts when rebase_branch is not actually checked out before
performing the upstream lookup and merge.
- Around line 30-37: Update the sdk_repo validation regex in UPSTREAM-MERGE.sh
to accept only explicit HTTPS URLs beginning with
https://github.com/operator-framework/operator-sdk and SSH URLs beginning with
git@github.com:operator-framework/operator-sdk, while preserving optional .git
and trailing-slash handling; reject the bare
github.com/operator-framework/operator-sdk form.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 3d1e734e-82ff-4ead-abd7-49a5b0d4d2ad

📥 Commits

Reviewing files that changed from the base of the PR and between 4c3cf41 and 23ecd37.

📒 Files selected for processing (3)
  • README.md
  • UPSTREAM-MERGE.sh
  • hack/auto-rebase.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • hack/auto-rebase.sh

@neha037

neha037 commented Aug 6, 2026

Copy link
Copy Markdown
Author

/retest

@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/auto-rebase.sh`:
- Around line 145-147: Update open_pr_exists so failures from gh pr list are
detected and propagated instead of treating an empty count as no open PR.
Preserve the existing count-based success check, but explicitly return a failure
status when the query command fails so the caller stops before rebasing.
🪄 Autofix

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: Enterprise

Run ID: 830049cc-c20e-4359-8f3b-abe277a0cfc3

📥 Commits

Reviewing files that changed from the base of the PR and between 23ecd37 and 3e3a5bb.

📒 Files selected for processing (9)
  • README.md
  • UPSTREAM-MERGE.sh
  • ci/dockerfiles/builder.Dockerfile
  • ci/dockerfiles/go-e2e.Dockerfile
  • ci/dockerfiles/helm-e2e.Dockerfile
  • ci/dockerfiles/scorecard-proxy.Dockerfile
  • ci/prow.Makefile
  • hack/auto-rebase.sh
  • release/helm/upstream.Dockerfile
💤 Files with no reviewable changes (5)
  • ci/dockerfiles/helm-e2e.Dockerfile
  • ci/dockerfiles/scorecard-proxy.Dockerfile
  • ci/dockerfiles/builder.Dockerfile
  • ci/dockerfiles/go-e2e.Dockerfile
  • release/helm/upstream.Dockerfile
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • UPSTREAM-MERGE.sh

Comment thread hack/auto-rebase.sh
@neha037

neha037 commented Aug 6, 2026

Copy link
Copy Markdown
Author

/retest

1 similar comment
@neha037

neha037 commented Aug 7, 2026

Copy link
Copy Markdown
Author

/retest

@neha037
neha037 marked this pull request as ready for review August 7, 2026 11:57
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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 `@UPSTREAM-MERGE.sh`:
- Line 49: Update the git merge failure handler in UPSTREAM-MERGE.sh to check
whether MERGE_HEAD exists and abort the in-progress merge before exiting.
Preserve the existing failure message and exit status for all merge failures.
🪄 Autofix

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: Enterprise

Run ID: 925ae044-d2b5-4176-9978-3a505ba083df

📥 Commits

Reviewing files that changed from the base of the PR and between 5de9e25 and c14b3b4.

📒 Files selected for processing (7)
  • README.md
  • UPSTREAM-MERGE.sh
  • ci/dockerfiles/go-e2e.Dockerfile
  • ci/dockerfiles/scorecard-proxy.Dockerfile
  • ci/prow.Makefile
  • hack/auto-rebase.sh
  • release/helm/upstream.Dockerfile
💤 Files with no reviewable changes (3)
  • release/helm/upstream.Dockerfile
  • ci/dockerfiles/scorecard-proxy.Dockerfile
  • ci/dockerfiles/go-e2e.Dockerfile
🚧 Files skipped from review as they are similar to previous changes (3)
  • ci/prow.Makefile
  • README.md
  • hack/auto-rebase.sh

Comment thread UPSTREAM-MERGE.sh Outdated
@neha037
neha037 force-pushed the oape-829-helm-auto-rebase branch from 19883d9 to 5572534 Compare August 10, 2026 11:45
@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@neha037: 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