NO-ISSUE: GH tags for releases: fix version list generation#6749
Conversation
|
@pmtk: This pull request explicitly references no jira issue. DetailsIn 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughThe script refactors RHOCP repo version computation in ChangesRepo Enablement and Logging
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
scripts/release-notes/gen_gh_releases_from_rhocp.py
| 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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I don't think we need to worry about this just yet.
There was a problem hiding this comment.
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)?
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by @pmtk |
|
@pmtk: This PR has been marked as verified by DetailsIn 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. |
|
@pmtk: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary by CodeRabbit