Skip to content

Discover active release branches in maintenance scripts (EC-2384) - #3772

Open
dheerajodha wants to merge 2 commits into
conforma:mainfrom
dheerajodha:codex/ec-2384-active-release-branches
Open

dheerajodha wants to merge 2 commits into
conforma:mainfrom
dheerajodha:codex/ec-2384-active-release-branches

Conversation

@dheerajodha

@dheerajodha dheerajodha commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What:

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.

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

@dheerajodha
dheerajodha requested a review from a team as a code owner December 2, 2026 13:00
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 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.
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.

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
acceptance 54.61% <ø> (ø)
generative 11.94% <ø> (ø)
integration 23.08% <ø> (ø)
unit 72.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Dec 2, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

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.

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: PR modifies developer maintenance scripts in hack/ directory, adding dynamic branch discovery tooling.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment tooling enhancement New feature or request labels Dec 2, 2026
st3penta
st3penta previously approved these changes Dec 3, 2026

@st3penta st3penta 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.

one minor nitpick, but other than that LGTM

Comment on lines +41 to +47
tags_output=$(yq -r '
.repositories[]
| select(.repository.repository == "rhtas/ec-rhel9")
| .repository.content_stream_tags
| select(tag == "!!seq")
| .[] | @json
' "$config_file") || fail 'could not parse Pyxis content stream tags'

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.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good point, addressed in the latest comment, thanks!

@dheerajodha dheerajodha Dec 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

rebased the PR to get the ubi bump

@fullsend-ai-review

Copy link
Copy Markdown

Review

Reason: tool-failure

This PR was NOT reviewed. Do not count this as an approval.

@fullsend-ai-review fullsend-ai-review Bot removed the requires-manual-review Review requires human judgment label Dec 4, 2026
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Finished Review · ❌ Failure (post-script /home/runner/work/cli/cli/.fullsend/.fullsend-cache/resources/sha256/8705f4e8b8e0f68615e6e4514ebf165f4121d0f94d3239c43fcf653157463931/scripts/post-review.sh failed: exit status 1) · Started 1:16 PM UTC · Completed 1:31 PM UTC

Commit: cfabb91 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.48

@dheerajodha
dheerajodha force-pushed the codex/ec-2384-active-release-branches branch from cfabb91 to 685a631 Compare December 4, 2026 13:38
@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Dec 4, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

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

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Dec 4, 2026
@cuipinghuo

Copy link
Copy Markdown
Contributor

/lgtm

@dheerajodha
dheerajodha enabled auto-merge December 4, 2026 16:19

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request requires-manual-review Review requires human judgment risk/moderate PR risk: moderate size: XL tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants