You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discover active release branches in maintenance scripts (EC-2384) - #3772
Replace the hardcoded default branches in the Go module upgrade and UBI bump PR scripts with a shared helper that reads rhtas/ec-rhel9 content stream tags from the Pyxis configuration. Defaults include main and sorted, unique release-v<major>.<minor> branches.
Explicit branch arguments bypass discovery. Missing tools, download failures, and invalid or empty stream data stop discovery before branch work begins. Tags must be strings in major.minor form; an unquoted numeric tag rejects the entire branch list.
Why:
Creating or retiring a release currently requires updating branch lists in both maintenance scripts. Using the existing Pyxis configuration removes those manual updates while preserving explicit overrides.
bash hack/active-release-branches_test.sh: 31 checks passed, including both maintenance entry points and rejection of unquoted numeric tags; uses the real YAML parser and mocked network, Git, and image commands.
Bash syntax, whitespace, and license header checks passed for the changed files.
Full Bash testing encountered existing macOS Make 3.81, GNU sed, and temporary-directory issues. Live internal GitLab access was not tested.
No actionable comments were generated in the recent review.
Walkthrough
A new script discovers active release branches from the Pyxis configuration for rhtas/ec-rhel9. When branch arguments are absent, go-mod-upgrade-prs.sh and ubi-bump-prs.sh use the discovered branches.
Changes: Release branch discovery
Layer / File(s)
Summary
Discover and validate release branches hack/active-release-branches.sh, hack/active-release-branches_test.sh
The script fetches the Pyxis configuration, validates content-stream tags, and prints main followed by unique, numerically sorted release branches. Tests cover output and failures, including missing tools and invalid or absent data.
Use discovered branches by default hack/go-mod-upgrade-prs.sh, hack/ubi-bump-prs.sh, hack/active-release-branches_test.sh
Both maintenance scripts use discovered branches when no branch arguments are supplied. Tests cover explicit overrides and failures before branch or image inspection.
sequenceDiagram
participant GoMod as go-mod-upgrade-prs.sh
participant UBI as ubi-bump-prs.sh
participant Discovery as active-release-branches.sh
participant Curl as curl
participant Pyxis as Pyxis configuration
participant YQ as yq
GoMod->>Discovery: Load default branches when no arguments are supplied
UBI->>Discovery: Load default branches when no arguments are supplied
Discovery->>Curl: Fetch Pyxis configuration
Curl->>Pyxis: Request rhtas/ec-rhel9 configuration
Pyxis-->>Curl: Return configuration
Curl-->>Discovery: Provide downloaded configuration
Discovery->>YQ: Extract content-stream tags
YQ-->>Discovery: Return parsed tags
Discovery-->>GoMod: Print main and release branches
Discovery-->>UBI: Print main and release branches
Loading
Suggested reviewers:acepresso, simonbaird
Merge Risk: Minimal · previous review cfabb
The change makes the default release branches for the two maintenance scripts come from Pyxis data rather than hardcoded lists. Explicit branch arguments still bypass discovery, and discovery failures stop before any branch work. No actionable merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: discovering active release branches in the maintenance scripts, with the EC-2384 ticket reference. The changeset adds a shared helper (active-release-branches.sh) that…
Description check
The description follows the template's What, Why, and Tickets sections. It explains the shared helper, default branch behavior, explicit override behavior, and failure handling. The Why section gives …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: discovering active release branches in the maintenance scripts, with the EC-2384 ticket reference. The changeset adds a shared helper (active-release-branches.sh) that reads Pyxis content stream tags and updates go-mod-upgrade-prs.sh and ubi-bump-prs.sh to use it instead of hardcoded branch lists. The title is concise and specific, and it fits the changeset.
Full details: Description check
Explanation
The description follows the template's What, Why, and Tickets sections. It explains the shared helper, default branch behavior, explicit override behavior, and failure handling. The Why section gives the motivation: branch lists need manual updates in two scripts. The Tickets section links EC-2384. It also adds a Validation section with test results and known environment limits. The description is complete and specific.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: b59182af-9c42-4e50-bc94-d44bc2f18ee2
Commits
Reviewing files that changed from the base of the PR and between fd6efd8 and cfabb91.
Files selected for processing: 2
hack/active-release-branches.sh
hack/active-release-branches_test.sh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
Routine maintenance-script PR that adds a new active-release-branch discovery helper with a companion shell test, and applies minor updates to two existing scripts; the moderate score reflects a medium blast radius and the script-detected absence of test coverage (shell _test.sh files are not recognized by the ratio detector), offset by clean security and dependency profiles and low git-history churn.
The reason will be displayed to describe this comment to others. Learn more.
If a Pyxis tag is ever written unquoted, like 0.10, yq parses it as the float 0.1. It still passes validation and discovery emits release-v0.1 instead of release-v0.10, so that branch gets silently skipped.
Maybe require string-typed tags (select(tag == "!!str"), mirroring the !!seq guard) so this fails loudly instead
Small tooling-focused PR adding maintenance shell scripts with low blast radius, no protected paths, security concerns, CI, or dependency changes; composite scores are uniformly low except for the test-file-ratio signal (the Tier 1 script did not detect the shell-convention test file, inflating that dimension to 5), which alone elevates the final score to moderate (2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Replace the hardcoded default branches in the Go module upgrade and UBI bump PR scripts with a shared helper that reads
rhtas/ec-rhel9content stream tags from the Pyxis configuration. Defaults includemainand sorted, uniquerelease-v<major>.<minor>branches.Explicit branch arguments bypass discovery. Missing tools, download failures, and invalid or empty stream data stop discovery before branch work begins. Tags must be strings in
major.minorform; an unquoted numeric tag rejects the entire branch list.Why:
Creating or retiring a release currently requires updating branch lists in both maintenance scripts. Using the existing Pyxis configuration removes those manual updates while preserving explicit overrides.
Tickets:
Ref: https://redhat.atlassian.net/browse/EC-2384
Validation:
bash hack/active-release-branches_test.sh: 31 checks passed, including both maintenance entry points and rejection of unquoted numeric tags; uses the real YAML parser and mocked network, Git, and image commands.