tests: add minimum version floor to PrepareVersion() to skip EOL streams#3386
tests: add minimum version floor to PrepareVersion() to skip EOL streams#3386redhat-chai-bot wants to merge 1 commit into
Conversation
When dynamically selecting a version for upgrade testing in non-production environments, PrepareVersion() iterates all available versions from newest to oldest looking for one with z-stream or y-stream upgrades. This can pick versions from EOL minor streams (e.g. 4.14.58) whose upgrade channels are no longer available in staging, causing cluster creation to fail. Add a minimum supported minor version filter (4.16) that skips versions from minor streams below this threshold. This prevents CI jobs like e2e-rosa-sts-upgrade-z-stream-f3 from selecting stale versions that will inevitably fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: redhat-chai-bot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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)
📝 WalkthroughWalkthrough
Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@redhat-chai-bot: The following tests failed, say
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. |
|
@dustman9000 you mentioned "The staging OCM API still lists versions from old minor streams (e.g. 4.14.58) as having available z-stream upgrades, but the staging infrastructure no longer supports creating clusters on those versions. ' |
|
The error is actually with our code for finding a valid channel for installing the EOL versions, not with installing the EOL versions themselves. I've been investigating this issue for a little while, but haven't fixed yet since I've had to work on higher priority items for a while. The issue is really with the |
|
thanks @jerichokeyne for pointing that out! Lets see if Coderabbit can help us advance ;-)
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
target="$(fd -t f '^resources_handler_prepare\.go$' . | head -n 1)"
if [[ -z "$target" ]]; then
echo "resources_handler_prepare.go not found" >&2
exit 1
fi
echo "== Outline: $target =="
ast-grep outline "$target" --items all --view expanded || true
echo
echo "== GetCurrentlyChannel definitions and call sites =="
rg -n -C 8 '\bGetCurrentlyChannel\b' --glob '*.go' .
echo
echo "== rosa create cluster and --channel construction =="
rg -n -C 10 -P 'rosa\s+create\s+cluster|--channel\b|\bchannel\b' --glob '*.go' tests
echo
echo "== Relevant tests =="
fd -t f -e go . tests | xargs rg -n -C 5 '\bGetCurrentlyChannel\b|PrepareVersion\b|--channel\b' || trueLength of output: 6242 🏁 Script executed: #!/bin/bash
set -u
file="tests/utils/handler/resources_handler_prepare.go"
echo "== PrepareVersion and GetCurrentChannel =="
sed -n '30,240p' "$file"
echo
echo "== Exact GetCurrentChannel definitions and call sites =="
rg -n -C 12 '\bGetCurrentChannel\s*\(' --glob '*.go' . || true
echo
echo "== ROSA create-cluster command construction and channel argument propagation =="
rg -n -C 12 -P '(?:CreateCluster|create\s+cluster|--channel\b|Channel\s*:|Channel\s*=)' --glob '*.go' tests pkg || true
echo
echo "== Version/channel-related configuration fields and test coverage =="
rg -n -C 8 -P '(?:CurrentChannel|Channel|PrepareVersion|versionRequirement)' --glob '*_test.go' --glob '*.go' tests/utils || trueLength of output: 235911
What happens now
It does not validate that this channel remains usable for provisioning that exact EOL version in staging. Thus, a stale API response such as If staging no longer supports that channel, creation fails even though omitting RecommendationThe durable fix is to make
The current |
|
Tests: |
Summary
Add a minimum supported version floor (4.16) to
PrepareVersion()so it skips EOL minor streams when resolvingz-1andy-1versions for CI tests.Problem
The staging OCM API still lists versions from old minor streams (e.g. 4.14.58) as having available z-stream upgrades, but the staging infrastructure no longer supports creating clusters on those versions. When
PrepareVersion()iterates all versions from newest to oldest and selects 4.14.58, cluster creation fails with "no available channels found for version 4.14.58", causing a cascade:cluster-idfile is written toSHARED_DIRThis affects at least 9 permafailing jobs (2 directly from version mismatch + 7 from the cascade).
Fix
Added 25 lines to
tests/utils/handler/resources_handler_prepare.go:minSupportedMinor = 16constant — defines 4.16 as the minimum supported minor streamisBelowMinSupportedVersion()helper — parses version strings and filters out versions from EOL streamsThe fix is minimal and conservative: it only adds filtering guards inside existing loops, doesn't change other logic, and gracefully handles unparseable versions by not filtering them.
Verification
go vet ./tests/utils/handler/— PASSgo build ./tests/utils/handler/— PASS@dustman9000 requested in Slack thread
Summary by CodeRabbit