Skip to content

ci: run nightly workflow against release branches as well#346

Merged
rm3l merged 1 commit intoredhat-developer:mainfrom
rm3l:ci/run_nightly_against_release_branches
Apr 1, 2026
Merged

ci: run nightly workflow against release branches as well#346
rm3l merged 1 commit intoredhat-developer:mainfrom
rm3l:ci/run_nightly_against_release_branches

Conversation

@rm3l
Copy link
Copy Markdown
Member

@rm3l rm3l commented Apr 1, 2026

Description of the change

This is to make sure such branches are tested as well against the corresponding RHDH next-x.y tag, for those that are still supported.

Which issue(s) does this PR fix or relate to

How to test changes / Special notes to the reviewer

Checklist

  • For each Chart updated, version bumped in the corresponding Chart.yaml according to Semantic Versioning.
  • For each Chart updated, variables are documented in the values.yaml and added to the corresponding README.md. The pre-commit utility can be used to generate the necessary content. Run pre-commit run --all-files to run the hooks and then push any resulting changes. The pre-commit Workflow will enforce this and warn you if needed.
  • JSON Schema template updated and re-generated the raw schema via the pre-commit hook.
  • Tests pass using the Chart Testing tool and the ct lint command.
  • If you updated the orchestrator-infra chart, make sure the versions of the Knative CRDs are aligned with the versions of the CRDs installed by the OpenShift Serverless operators declared in the values.yaml file. See Installing Knative Eventing and Knative Serving CRDs for more details.

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge bot commented Apr 1, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Remediation recommended

1. Hardcoded release matrix 🐞 Bug ☼ Reliability
Description
The nightly workflow hard-codes specific release branch names in the matrix, so it will fail when
any listed branch is deleted/renamed and it will not automatically start testing new supported
release branches. This creates ongoing maintenance burden and can reduce release-branch coverage
until the workflow is manually updated.
Code

.github/workflows/nightly.yaml[R17-23]

+    strategy:
+      fail-fast: false
+      matrix:
+        branch:
+          - main
+          - release-1.9
+          - release-1.8
Evidence
The nightly workflow uses a fixed matrix list for branches, while other CI workflows already model
release branches as a pattern (release-1.[0-9]+), indicating the set of release branches is
expected to evolve over time without needing edits everywhere.

.github/workflows/nightly.yaml[17-23]
.github/workflows/test.yaml[4-8]
.github/workflows/release.yaml[3-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The nightly workflow’s branch matrix is a hard-coded list, which becomes stale as release branches are added/removed and can cause unnecessary workflow failures or missed coverage.

## Issue Context
Other workflows already use a `release-1.[0-9]+` pattern for release branches, suggesting the release-branch set is expected to change over time.

## Fix Focus Areas
- .github/workflows/nightly.yaml[15-49]

## Suggested fix
Introduce a small “prepare-matrix” job that determines the list of branches to test (e.g., from a repo variable, a tracked config file, or by querying remote branches matching `^release-1\.[0-9]+$` and filtering to supported ones), then feed that list into the test job via `strategy.matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}`. As a minimal alternative, centralize the branch list into a single repository variable/file so it’s updated in one place.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. Unvalidated tag derivation 🐞 Bug ⚙ Maintainability
Description
The image tag derivation assumes non-main branches follow the release-x.y naming scheme;
otherwise it can emit an unexpected/invalid tag value. This makes the workflow brittle if additional
branches are later added to the matrix without matching this convention.
Code

.github/workflows/nightly.yaml[R32-40]

+      - name: Compute image tag
+        id: image
+        run: |
+          if [[ "${{ matrix.branch }}" == "main" ]]; then
+            echo "tag=next" >> "$GITHUB_OUTPUT"
+          else
+            # release-x.y -> next-x.y
+            echo "tag=next-${BRANCH#release-}" >> "$GITHUB_OUTPUT"
+          fi
Evidence
For non-main branches, the tag is computed by stripping a release- prefix; if the prefix is
absent, the original branch name is passed through into the tag with no validation.

.github/workflows/nightly.yaml[32-43]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The workflow computes the image tag by stripping `release-` from the branch name for any non-`main` branch, but it does not validate that the branch actually matches the expected `release-x.y` format.

## Issue Context
This is safe with the current hard-coded matrix entries, but becomes fragile if the matrix is extended.

## Fix Focus Areas
- .github/workflows/nightly.yaml[32-43]

## Suggested fix
Add a guard such as:
- if branch is `main`: `next`
- else if branch matches `^release-[0-9]+\.[0-9]+$`: `next-${...}`
- else: fail fast with a clear error message (or map explicitly), to avoid producing a malformed/unsupported tag silently.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@rm3l rm3l merged commit 9a446f8 into redhat-developer:main Apr 1, 2026
5 checks passed
@rm3l rm3l deleted the ci/run_nightly_against_release_branches branch April 1, 2026 12:25
@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Extend nightly workflow to test release branches

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Extend nightly workflow to test release branches (1.9, 1.8)
• Dynamically compute RHDH image tags based on branch
• Use matrix strategy for parallel testing across branches
• Map release branches to corresponding next-x.y image tags
Diagram
flowchart LR
  trigger["Nightly Trigger"]
  matrix["Matrix Strategy<br/>main, release-1.9, release-1.8"]
  compute["Compute Image Tag<br/>main→next<br/>release-x.y→next-x.y"]
  test["Test Charts<br/>with Dynamic Tag"]
  trigger --> matrix
  matrix --> compute
  compute --> test
Loading

Grey Divider

File Changes

1. .github/workflows/nightly.yaml ⚙️ Configuration changes +23/-3

Add matrix testing for release branches with dynamic tags

• Added matrix strategy to run tests against main and release branches (1.9, 1.8)
• Introduced dynamic image tag computation step that maps branch names to RHDH image tags
• Updated checkout action to use matrix branch reference
• Modified test-charts action to use dynamically computed image tag instead of hardcoded 'next'

.github/workflows/nightly.yaml


Grey Divider

Qodo Logo

@rhdh-qodo-merge rhdh-qodo-merge bot added enhancement New feature or request Tests labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant