OKD-431: Add release-scos prefix to TrimPrefixes for OKD SCOS stream resolution #815
@pskrbasu: This pull request references OKD-431 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 "5.1.0" version, but no target version was set.
<details>
In response to this:
>## Summary
>- Add"release-scos"to theTrimPrefixescall inresolveUpgradeReleaseso OKD SCOS release controller configs (Config.To="release-scos") get an empty suffix instead of"-scos"
>- This allows the
stream field in upgradeFromRelease.candidate to target OKD SCOS nightly streams (e.g., okd-scos-nightly → 4.22.0-0.okd-scos-nightly)>- Previously, the
"-scos" suffix made it structurally impossible to resolve to the nightly stream name pattern>## Why
>OKD SCOS nightly cross-version upgrade tests (aws-upgrade-minor) currently upgrade from the CI candidate stream (4.22.0-0.okd-scos) instead of the nightly/ART stream (4.22.0-0.okd-scos-nightly). This creates a CI→ART mismatch — no user actually upgrades from CI-built payloads. OCP nightlies correctly usestream: "nightly"which resolves to ART-built nightlies; OKD SCOS should do the same.
>The root cause is thatTrimPrefixes("release-scos", "release-5", "release")matches the"release"prefix first, producing suffix"-scos". No value ofstreamcan then produceX.Y.0-0.okd-scos-nightlybecause-scosis always appended at the end. Adding"release-scos"before"release"in the prefix list fixes this.
>## Impact
>- No existing behavior changes until configs in openshift/release are updated to use new stream values
>- OCP configs are completely unaffected (
Config.To="release-5" and Config.To="release" match earlier prefixes)>- Only
release-scos and release-scos-arm64 configs are affected, and no arm64 SCOS configs currently use upgradeFromRelease>## Dependency
>This PR must be merged and deployed before the companion PR in openshift/release (which updates the stream values from"okd"to"okd-scos-nightly"/"okd-scos"). Without this code change, the new stream values would resolve to nonexistent streams.
>Jira: OKD-431
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.
</details>
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- recent_review_start -->
No actionable comments were generated in the recent review. 🎉
<details>
<summary>ℹ️ Recent review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5dcc20f9-274a-4833-ae59-30355d31cec1
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between cf197e9b22b035ae50b8eac809fd68778f796255 and d36011cfe6be865c48ebcc2b15754a9a1dcb85fc.
</details>
<details>
<summary>📒 Files selected for processing (1)</summary>
cmd/release-controller/sync_verify.go</details>
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
</details>
---
<!-- recent_review_end -->
<!-- walkthrough_start -->
<details>
<summary>📝 Walkthrough</summary>
Walkthrough
The release controller now matches the release-scos prefix before the generic release prefix when it builds candidate upgrade streams. This produces the correct empty suffix for release-scos targets.
Changes
Nightly stream targeting
|Layer / File(s)|Summary|
|---|---|
|Candidate stream prefix matching <br> cmd/release-controller/sync_verify.go|resolveUpgradeRelease checks release-scos before release, so Config.To values of release-scos produce the intended candidate stream suffix. A comment documents the prefix ordering.|
Estimated code review effort: 2 (Simple) | ~10 minutes
<!-- final_review_risk_start -->
Merge Risk: _⚪ Minimal_ · up to d3601
This change enables OKD SCOS release streams to resolve to the intended nightly stream pattern; no actionable merge-blocking risk remains beyond normal checks and review.
<!-- final_review_risk_end -->
Suggested reviewers: bradmwilliams
</details>
<!-- walkthrough_end -->
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary>🚥 Pre-merge checks | ✅ 5</summary>
<details>
<summary>✅ Passed checks (5 passed)</summary>
| Check name | Status | Explanation |
| :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and concisely describes the main change: adding the release-scos prefix to support OKD SCOS stream resolution. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1… |
| 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. |
</details>
<details>
<summary>Full details: Docstring Coverage</summary>
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
</details>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary>✨ Finishing Touches</summary>
<details>
<summary>🧪 Generate unit tests (beta)</summary>
</details>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->
---
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
<!-- internal state start -->
<!-- N4IgzgxgFgpgtgQwGowE5gJYHsB2IBcAjADTgAuqArhGZajACYDKZCZMBoYF1t9K6bHiKkADqgDyAIwBWMGhgBuMMARABidQAIACgCUtYSnESoAngB0cVgCpQMYXQYQMGjgAYWQ9ADYwEYDAAtJBYYF7uWlIwAGZY9Fqe3jB+ATARWhg4WmSwiTaoGHA69DEYAB4qkRAIPj5aAO4YuVmJ9GBYPsoAqqIA5qguMHop/oHuAHRadg5aNZSBjhIA0gAiWkwAwhJMc7hlfXRsQo5NuYmb+xh9EzZYALxevmPBoeEgkWRYWuJYDNQwLQIbLwURkMyGSgxMrlLSDXJoHJQYGJLwhCBhCITKy2PLQYF9QEwHAIKR+RzcegIOBaRS1SgqSHQIEeLxYADWDHRYSCOGuUDIPksHxy33anWUoq0fL6AqFhgo/jgjh8GHZgPcABYJgAmHUTAAMQQNEw5XLevP5grMky0AEkyEDXO1FloVustjstJR+oMGID2NxHBA6PQcNbvZgcH0tJs7XNgQwMAw2IDKUrHFluP4GFosDFpVahQB6ACCehsCqpyqmEk2Oj2OAORzIJzh8AQrUoJOh8nYDGIQJwuZg5QcrejURgyMU2FQWgYWEZOCwjvx0cB3db9V8qdz7iwomJYHsMTIxeeaWqV0O8LbCASPpT/ex1hwdkB+i0cAWjuiC5gUQfC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hRixVBG+Y0Io/SwO6AZAg4by1AgMh+k0Z+NBHwUwHW0cRkBSj+Lh7k2QMJuEiQAAGhMAAJo4F+H4GJGEFTh04aguYyS1CbxmC7QYYOJgTiRQQOKDyuA3I/G1Rb7uwJDPIij9aAjgnZKOjd49QOB7z0R2gwSVFkD15aCOEdb/TIKTjRDAxPygJgAeFbjgwL6ZjZDZ43ynjngz4PgBL+K5j3Ke7ShYLCEXRXTEF1gNgpaL4WnQTIrsDyjdgIC9g0BgTL7lIHARzr7qKfGRAHLBnXChk8lHIAmPJFH+D6apx9IPFgB9zOk4DbLqIBFDj7i5mJEPhwCyKajXgVK7QJB+lYQBmXKDJmTFmllT67BunBihjMQ+mjG1Ff6MS/5XiSHaDAZHjDg4SyGOFX5fg/g5L/iCQqq5iDL+hAQgQdKxAeweHqyMSwR8jIRfitDGknjMxmnWxL6zHMiwyZFQS1xol1Hf7DRmgZD3JJAJE8jTEijFh3nklJwpFaCFq5Bp7c5oJyZsKUFe72lXk1KnD7Htihb8EPR/xjjZi/KwF7xKQIDgIcLkRUSEBYqNwChkCiBgD4DFjFgs6g70AMDIgi55TFhSAzQHQwDFiYXUR9zPoBCl4VibpqBMWEDgKN65iFlhBfSTL3LJJd6uyOBc47GnTjHQWdCBa4Ba4gAe5fA6Ae6BABrsD4wl6qWe4MClhkAjCYIEpErNCXBbiZrVqkEOBV6gANCFDsB8JqC0oIAGhhSyK4RBBhQ6gQACpBACqURCpBBQLiKEBBAwCiKkixAICcqURhT8JVokJAA= -->
<!-- internal state end -->
@pskrbasu: 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.
</details>
<!-- test report -->
/cc @bradmwilliams
Approved these changes.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/openshift/release-controller/pull/815#pullrequestreview-5066621715" title="Approved">bradmwilliams</a>, <a href="https://github.com/openshift/release-controller/pull/815#" title="Author self-approved">pskrbasu</a>
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
</details>
<!-- META={"approvers":[]} -->
bradmwilliams
pskrbasu
Summary
"release-scos"to theTrimPrefixescall inresolveUpgradeReleaseso OKD SCOS release controller configs (Config.To="release-scos") get an empty suffix instead of"-scos"streamfield inupgradeFromRelease.candidateto target OKD SCOS nightly streams (e.g.,okd-scos-nightly→4.22.0-0.okd-scos-nightly)"-scos"suffix made it structurally impossible to resolve to the nightly stream name patternWhy
OKD SCOS nightly cross-version upgrade tests (
aws-upgrade-minor) currently upgrade from the CI candidate stream (4.22.0-0.okd-scos) instead of the nightly/ART stream (4.22.0-0.okd-scos-nightly). This creates a CI→ART mismatch — no user actually upgrades from CI-built payloads. OCP nightlies correctly usestream: "nightly"which resolves to ART-built nightlies; OKD SCOS should do the same.The root cause is that
TrimPrefixes("release-scos", "release-5", "release")matches the"release"prefix first, producing suffix"-scos". No value ofstreamcan then produceX.Y.0-0.okd-scos-nightlybecause-scosis always appended at the end. Adding"release-scos"before"release"in the prefix list fixes this.Impact
Config.To="release-5"andConfig.To="release"match earlier prefixes)release-scosandrelease-scos-arm64configs are affected, and no arm64 SCOS configs currently useupgradeFromReleaseDependency
This PR must be merged and deployed before the companion PR in openshift/release (which updates the stream values from
"okd"to"okd-scos-nightly"/"okd-scos"). Without this code change, the new stream values would resolve to nonexistent streams.Jira: OKD-431
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
Fixed nightly release stream targeting for configurations using the
release-scosdestination.* Corrected stream names so they no longer include an unintended
-scossuffix.<!-- end of auto-generated comment: release notes by coderabbit.ai -->