Skip to content

WIP: push to operatorhub hive skill - #652

Open
miyadav wants to merge 2 commits into
openshift-eng:mainfrom
miyadav:operatorskill
Open

WIP: push to operatorhub hive skill#652
miyadav wants to merge 2 commits into
openshift-eng:mainfrom
miyadav:operatorskill

Conversation

@miyadav

@miyadav miyadav commented Jul 28, 2026

Copy link
Copy Markdown

@2uasimojo @dlom @suhanime PTAL , I will try it locally and test with bot token, if it looks reasonable .
Adds a new push-to-operatorhub skill to the olm plugin that guides users through publishing a Hive operator release to both Kubernetes and Red Hat OpenShift OperatorHub repositories.

The skill follows the Hive SOP (https://github.com/openshift/hive-sops/blob/master/sop/PushToOperatorHub.md) and automates what it can while clearly identifying 6 manual steps that require human intervention
(token creation, secrets retrieval, SSO login, post-merge monitoring, escalation). It uses the shared Quay.io bot account for image pushes instead of requiring individual credentials.

The workflow is organized into 5 chronological phases:

  1. Validate Prerequisites — checks tools, tokens, forks, hive clone, CI registry
  2. Identify Target Commit — determines commit, verifies scripts are current, dry-run preview
  3. Build and Publish — runs bundle-gen.sh to build image, generate bundles, create PRs
  4. Verify PRs — inspects both OperatorHub PRs for correctness
  5. Post-Merge Monitoring — watches pipeline status and provides escalation guidance

Generated by claude

Summary by CodeRabbit

  • Documentation
    • Added guidance for publishing Hive operator releases to Red Hat OpenShift OperatorHub and Kubernetes OperatorHub.
    • Documented end-to-end workflow, prerequisites validation, publishing steps, pull request verification, and post-merge monitoring.
    • Included troubleshooting/error-handling guidance, manual step checklists, and references to relevant operational documentation.

@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 Jul 28, 2026
@openshift-ci
openshift-ci Bot requested review from chiragkyal and stbenjam July 28, 2026 07:56
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: miyadav
Once this PR has been reviewed and has the lgtm label, please assign zaneb 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 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9baa8e39-2ca6-4305-a42f-8676b2a5b8c8

📥 Commits

Reviewing files that changed from the base of the PR and between d93a4ad and 92574cc.

📒 Files selected for processing (1)
  • plugins/olm/skills/push-to-operatorhub/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/olm/skills/push-to-operatorhub/SKILL.md

Walkthrough

Adds a push-to-operatorhub skill document covering prerequisite validation, target commit selection, bundle publication, pull request verification, post-merge monitoring, error handling, and supporting references.

Changes

OperatorHub publishing workflow

Layer / File(s) Summary
Prerequisites and target commit
plugins/olm/skills/push-to-operatorhub/SKILL.md
Defines skill arguments, validates required tools and access, selects and verifies the target commit, and previews the generated version and channel.
Build, publish, and verify
plugins/olm/skills/push-to-operatorhub/SKILL.md
Documents bundle generation, image publication, pull request creation, and checks for generated bundle, CSV, channel, and replacement metadata.
Post-merge monitoring and support
plugins/olm/skills/push-to-operatorhub/SKILL.md
Describes pipeline and merge monitoring, manual actions, error handling, and supporting references.

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

Suggested reviewers: stbenjam, chiragkyal


Important

Pre-merge checks failed

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

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No Assumed Git Remote Names ❌ Error The skill still hardcodes origin as a fallback (REMOTE="${REMOTE:-origin}"), so it assumes a remote name despite discovery logic. Remove the origin fallback and require explicit remote discovery (e.g. git remote -v/tracking branch) before any fetch/checkout using the remote.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: adding a Hive push-to-operatorhub skill.
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.
No Real People Names In Style References ✅ Passed Reviewed the new skill doc; it contains no real-person names in commands, docs, examples, or style references.
Git Push Safety Rules ✅ Passed No git push or force-push commands are added; the skill asks for confirmation before publishing and only references master as the source commit.
No Untrusted Mcp Servers ✅ Passed The PR only adds a markdown skill doc; it contains no MCP server install commands, npm packages, or untrusted repository references.
Ai-Helpers Overlap Detection ✅ Passed No HIGH/MODERATE overlap found: the closest open PR scored 59.8/100, below the 60% threshold, and no existing skill/command matched closely.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🤖 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 `@plugins/olm/skills/push-to-operatorhub/SKILL.md`:
- Around line 250-254: Update the fenced block under “Created PRs” in the
push-to-operatorhub skill documentation to specify the text or markdown language
after its opening fence, while preserving the existing PR links and content.
- Around line 136-149: Update Step 1.6 to prompt for and initialize HIVE_REPO
before evaluating the directory and bundle-gen.sh checks. Ensure the clone
instruction assigns or establishes the chosen local path in HIVE_REPO, then run
the existing validation against that variable.
- Around line 185-188: Update the git workflow around the fetch, log, diff, and
checkout commands to discover and validate the repository’s intended remote
instead of hard-coding origin. Reuse the validated remote variable consistently
for fetching and all subsequent remote references, while preserving the existing
master-branch behavior.
- Around line 204-207: Update the remediation instructions near the git checkout
command to protect local changes to hack/bundle-gen.sh and hack/version2.sh:
first check whether the worktree and these files are clean, and require user
confirmation or preserve the files before recommending replacement. Keep the
existing update recommendation only after this safeguard.
- Around line 33-44: Update the Step 1.4b Quay login flow to support
Buildah-only environments, reusing the existing tool-detection logic and
authenticating with buildah when neither docker nor podman is available;
otherwise remove buildah from the prerequisites and related checks.
- Around line 230-235: Update the publication command in the push-to-operatorhub
skill to construct its arguments from the parsed skill flags: propagate
--dry-run to bundle-gen.sh when requested, and initialize HOLD from the --hold
argument before using ${HOLD:+--hold}. Ensure dry-run execution cannot publish
images or pull requests.
- Around line 105-115: Rename “Step 1.4c — Verify push access” and its output to
describe a read-access check, since the skopeo inspect command only validates
pull access. Update the wording to avoid claiming push permission verification,
while preserving the skopeo availability handling and existing inspection
behavior.
- Around line 296-301: Update the Pipeline Summary lookup command in the
push-to-operatorhub instructions to use the repository issues comments endpoint
with the PR number, rather than the pull-request review comments endpoint.
Preserve the existing jq extraction and “Pipeline Summary” filtering behavior.
- Around line 91-99: Update both the podman and docker login branches to pass
QUAY_BOT_TOKEN through --password-stdin instead of the -p command-line option,
while preserving the existing success and failure messages.
- Around line 63-69: Update Step 1.3’s GH_USER initialization to default from
the authenticated GitHub account using gh api user --jq .login, while preserving
GITHUB_USER as the explicit override. Keep the existing display and verification
prompts unchanged.
🪄 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: CHILL

Plan: Enterprise

Run ID: 51fec9b9-ec5c-4f11-878c-9503312e69af

📥 Commits

Reviewing files that changed from the base of the PR and between 9c53719 and d93a4ad.

📒 Files selected for processing (1)
  • plugins/olm/skills/push-to-operatorhub/SKILL.md

Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md Outdated
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md Outdated
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md Outdated
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md Outdated
Comment on lines +230 to +235
```bash
cd "$HIVE_REPO"
GITHUB_TOKEN="$GITHUB_TOKEN" ./hack/bundle-gen.sh \
--github-user "$GH_USER" \
--commit "$COMMIT_SHA" \
${HOLD:+--hold}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Propagate the documented flags to the publication command.

The final command never passes --dry-run, despite documenting it as a skill argument, and $HOLD is used without showing how it is initialized from --hold. Build the command from parsed flag state so requested dry runs cannot publish images or PRs accidentally.

Suggested command shape
 GITHUB_TOKEN="$GITHUB_TOKEN" ./hack/bundle-gen.sh \
   --github-user "$GH_USER" \
   --commit "$COMMIT_SHA" \
+  ${DRY_RUN:+--dry-run} \
   ${HOLD:+--hold}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```bash
cd "$HIVE_REPO"
GITHUB_TOKEN="$GITHUB_TOKEN" ./hack/bundle-gen.sh \
--github-user "$GH_USER" \
--commit "$COMMIT_SHA" \
${HOLD:+--hold}
🤖 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 `@plugins/olm/skills/push-to-operatorhub/SKILL.md` around lines 230 - 235,
Update the publication command in the push-to-operatorhub skill to construct its
arguments from the parsed skill flags: propagate --dry-run to bundle-gen.sh when
requested, and initialize HOLD from the --hold argument before using
${HOLD:+--hold}. Ensure dry-run execution cannot publish images or pull
requests.

Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md Outdated
Comment thread plugins/olm/skills/push-to-operatorhub/SKILL.md
@2uasimojo

Copy link
Copy Markdown

Per discussion, we're going to try doing this via a fully automated konflux job instead.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants