Skip to content

NO-ISSUE: GH tags for releases: fix version list generation#6749

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
pmtk:gh-tags-fix
May 28, 2026
Merged

NO-ISSUE: GH tags for releases: fix version list generation#6749
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
pmtk:gh-tags-fix

Conversation

@pmtk

@pmtk pmtk commented May 27, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Corrected release-generation behavior around major-version boundaries so repository versions across major transitions are included accurately.
    • Fixed repository enabling logic to ensure the appropriate repositories are activated for generated releases.
    • Enhanced logging for clearer visibility into computed release versions and processing steps.

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

Copy link
Copy Markdown

@pmtk: This pull request explicitly references no jira issue.

Details

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

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5d85433c-2318-4344-9e2d-985ee235b6e0

📥 Commits

Reviewing files that changed from the base of the PR and between b8c9111 and 53fcb5a.

📒 Files selected for processing (1)
  • scripts/release-notes/gen_gh_releases_from_rhocp.py

Walkthrough

The script refactors RHOCP repo version computation in get_rpm_releases() to use an explicit list with special handling for major version transitions, replaces the direct range() loop, and adds query logging before RPM package iteration.

Changes

Repo Enablement and Logging

Layer / File(s) Summary
Repo version computation and enablement
scripts/release-notes/gen_gh_releases_from_rhocp.py
repo_versions list now computed with conditional major version handling, including common.LAST_MINOR_FOR_MAJOR[4] for major >= 5 transitions, then each repo constructed and enabled by repo_id.
Query logging
scripts/release-notes/gen_gh_releases_from_rhocp.py
Informational log added for the RPM package query expression before iteration.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: correcting version list generation for GitHub release tags.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 PR only modifies a Python release-notes script; no Ginkgo test files are affected, so the test-naming stability check is not applicable.
Test Structure And Quality ✅ Passed The custom check reviews Ginkgo test code quality, but the PR changes a Python release-notes script without modifying any Go test files. Check not applicable.
Microshift Test Compatibility ✅ Passed PR modifies only a Python release notes script (gen_gh_releases_from_rhocp.py), not Ginkgo e2e tests. Check applies only to new tests being added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only a Python release notes script; no Ginkgo e2e tests are added or modified, so SNO test compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed PR only modifies Python release-notes utility scripts (gen_gh_releases_from_rhocp.py), not Kubernetes manifests, operators, or controllers with scheduling constraints.
Ote Binary Stdout Contract ✅ Passed PR modifies a Python release notes utility script, not an OTE binary or test code. The check targets OTE binaries; this is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies only scripts/release-notes/gen_gh_releases_from_rhocp.py, a Python utility script. No Ginkgo e2e tests are added; check does not apply.
No-Weak-Crypto ✅ Passed No weak crypto found. The PR changes version list generation without introducing MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or insecure secret comparisons.
Container-Privileges ✅ Passed PR modifies a Python release-notes script with no container/K8s manifests; container-privileges check is not applicable.
No-Sensitive-Data-In-Logs ✅ Passed All logging statements log only public metadata (version numbers, repo IDs, release names, commit SHAs). No passwords, tokens, API keys, PII, session IDs, or sensitive credentials are exposed in logs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@openshift-ci openshift-ci Bot requested review from agullon and copejon May 27, 2026 13:23
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2026

@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: 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 `@scripts/release-notes/gen_gh_releases_from_rhocp.py`:
- Around line 42-48: The loop building repo_versions hardcodes the 4→5
transition and will skip entire majors when current_major > 5; update the logic
in gen_gh_releases_from_rhocp.py to derive the prior-major sequence dynamically
(use common.get_previous_version() or iterate keys of
common.LAST_MINOR_FOR_MAJOR) instead of referencing
common.LAST_MINOR_FOR_MAJOR[4]; specifically, replace the special-case block
that checks if int(current_major) >= 5 and appends ("4", m) with a loop that
walks backwards through majors from current_major down to the earliest major,
using LAST_MINOR_FOR_MAJOR[major] for each major’s last minor and appending
(str(major-1), m) or equivalent so repo_versions correctly includes every minor
for every intervening major, and ensure repo_versions trimming (repo_versions =
repo_versions[:-1]) still behaves as intended.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: f6bab393-c1ab-4035-ad48-24cb9d3bdfb3

📥 Commits

Reviewing files that changed from the base of the PR and between a890f0c and b8c9111.

📒 Files selected for processing (1)
  • scripts/release-notes/gen_gh_releases_from_rhocp.py

Comment on lines +42 to +48
if int(current_major) >= 5:
for m in range(14, common.LAST_MINOR_FOR_MAJOR[4] + 1):
repo_versions.append(("4", m))
start_minor = 0 if int(current_major) >= 5 else 14
for minor in range(start_minor, int(current_minor)-1):
repo_id = f"rhocp-{current_major}.{minor}-for-rhel-9-{arch}-rpms"
r = base.repos.get_matching(repo_id)
for m in range(start_minor, int(current_minor)):
repo_versions.append((current_major, m))
repo_versions = repo_versions[:-1]

@coderabbitai coderabbitai Bot May 27, 2026

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.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

This repo walk still hardcodes the 4→5 transition.

If current_major ever becomes 6, this builds 4.14..4.x plus 6.0..6.(n-2) and skips every 5.x repo, so release discovery will silently miss a full major. Please derive the sequence from common.get_previous_version() (or iterate all majors via common.LAST_MINOR_FOR_MAJOR) instead of hardcoding common.LAST_MINOR_FOR_MAJOR[4].

Possible fix
-        repo_versions = []
-        if int(current_major) >= 5:
-            for m in range(14, common.LAST_MINOR_FOR_MAJOR[4] + 1):
-                repo_versions.append(("4", m))
-        start_minor = 0 if int(current_major) >= 5 else 14
-        for m in range(start_minor, int(current_minor)):
-            repo_versions.append((current_major, m))
-        repo_versions = repo_versions[:-1]
+        repo_versions_backwards = []
+        major, minor = current_major, current_minor
+        while (int(major), int(minor)) != (4, 14):
+            major, minor = common.get_previous_version(major, minor)
+            repo_versions_backwards.append((major, int(minor)))
+        repo_versions = list(reversed(repo_versions_backwards[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 `@scripts/release-notes/gen_gh_releases_from_rhocp.py` around lines 42 - 48,
The loop building repo_versions hardcodes the 4→5 transition and will skip
entire majors when current_major > 5; update the logic in
gen_gh_releases_from_rhocp.py to derive the prior-major sequence dynamically
(use common.get_previous_version() or iterate keys of
common.LAST_MINOR_FOR_MAJOR) instead of referencing
common.LAST_MINOR_FOR_MAJOR[4]; specifically, replace the special-case block
that checks if int(current_major) >= 5 and appends ("4", m) with a loop that
walks backwards through majors from current_major down to the earliest major,
using LAST_MINOR_FOR_MAJOR[major] for each major’s last minor and appending
(str(major-1), m) or equivalent so repo_versions correctly includes every minor
for every intervening major, and ensure repo_versions trimming (repo_versions =
repo_versions[:-1]) still behaves as intended.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think we need to worry about this just yet.

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.

Understood, @pmtk! Would you like me to open a follow-up GitHub issue to track the generalization for future major versions (e.g., 6.x)?

@agullon

agullon commented May 27, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 27, 2026
@openshift-ci

openshift-ci Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

[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

@pmtk

pmtk commented May 28, 2026

Copy link
Copy Markdown
Member Author

/verified by @pmtk

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@pmtk: This PR has been marked as verified by @pmtk.

Details

In response to this:

/verified by @pmtk

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 commented May 28, 2026

Copy link
Copy Markdown
Contributor

@pmtk: 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 b5b99e3 into openshift:main May 28, 2026
13 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