Skip to content

USHIFT-6767: Validate GitOps RPM repo availability before using version#6434

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
agullon:USHIFT-6767
Mar 31, 2026
Merged

USHIFT-6767: Validate GitOps RPM repo availability before using version#6434
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
agullon:USHIFT-6767

Conversation

@agullon
Copy link
Copy Markdown
Contributor

@agullon agullon commented Mar 31, 2026

Summary

  • Adds a repo_provides_pkg() check against gitops-{version}-for-rhel-9-{ARCH}-rpms to verify the package is actually available before returning the version
  • Falls back to the next compatible version if the repo is not yet available

The get_gitops_version() function relied solely on the Red Hat Product
Life Cycle API to determine GitOps compatibility. However, a version
can be advertised as compatible (e.g., GitOps 1.20 for OCP 4.20) before
its RPM repo actually exists, causing bootc image builds to fail with
403 Forbidden when accessing cdn.redhat.com.

Add a repo_provides_pkg() check against the subscription repo
gitops-{version}-for-rhel-9-{ARCH}-rpms to verify the package is
actually available before returning the version. If the repo is not
available, the function falls back to the next compatible version.

pre-commit.check-secrets: ENABLED
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 31, 2026

@agullon: This pull request references USHIFT-6767 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Fixes bootc image build failures caused by get_gitops_version() returning a GitOps version (e.g., 1.20) whose RPM repo doesn't exist yet on cdn.redhat.com (403 Forbidden)
  • Adds a repo_provides_pkg() check against gitops-{version}-for-rhel-9-{ARCH}-rpms to verify the package is actually available before returning the version
  • Falls back to the next compatible version if the repo is not yet available

Test plan

  • Run generate_common_versions.py on a RHEL machine with RHSM — verify it falls back to GitOps 1.19 instead of 1.20
  • Verify bootc-periodic CI jobs pass with the regenerated common_versions.sh

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-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 31, 2026

@agullon: This pull request references USHIFT-6767 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds a repo_provides_pkg() check against gitops-{version}-for-rhel-9-{ARCH}-rpms to verify the package is actually available before returning the version
  • Falls back to the next compatible version if the repo is not yet available

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1e479606-7d89-471e-855f-8cb7156efb6a

📥 Commits

Reviewing files that changed from the base of the PR and between 687d05e and d7d3199.

📒 Files selected for processing (1)
  • test/bin/pyutils/generate_common_versions.py

Walkthrough

Modified get_gitops_version() to validate package availability in repositories before accepting a GitOps version match. The function now constructs repository identifiers, checks for the presence of the microshift-gitops package, and continues searching if the package is unavailable.

Changes

Cohort / File(s) Summary
GitOps Version Validation
test/bin/pyutils/generate_common_versions.py
Added package availability verification to get_gitops_version(). Now constructs repository identifiers and validates microshift-gitops package presence before returning a compatible GitOps version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@pmtk
Copy link
Copy Markdown
Member

pmtk commented Mar 31, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 31, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agullon, pmtk

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

The pull request process is described 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

@agullon
Copy link
Copy Markdown
Contributor Author

agullon commented Mar 31, 2026

/retest

@agullon
Copy link
Copy Markdown
Contributor Author

agullon commented Mar 31, 2026

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 31, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@agullon: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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.

@agullon
Copy link
Copy Markdown
Contributor Author

agullon commented Mar 31, 2026

/retest

1 similar comment
@agullon
Copy link
Copy Markdown
Contributor Author

agullon commented Mar 31, 2026

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 31, 2026

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

@openshift-merge-bot openshift-merge-bot bot merged commit 0af622b into openshift:main Mar 31, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants