Skip to content

[release-1.10] fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command#4910

Open
zdrapela wants to merge 4 commits into
redhat-developer:release-1.10from
zdrapela:feature/dynamic-catalog-index-override-1.10
Open

[release-1.10] fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command#4910
zdrapela wants to merge 4 commits into
redhat-developer:release-1.10from
zdrapela:feature/dynamic-catalog-index-override-1.10

Conversation

@zdrapela
Copy link
Copy Markdown
Member

@zdrapela zdrapela commented Jun 2, 2026

Jira: https://redhat.atlassian.net/browse/RHIDP-14348

Cherry-pick of #4860 to release-1.10 branch.

Summary

Dynamically resolve the catalog index image from RELEASE_BRANCH_NAME instead of hardcoding it, and add Gangway API override support for catalog index and chart version.
Also replaces the trigger-nightly-job agent command with an install guide pointing to the external skill.

zdrapela added 3 commits June 2, 2026 12:49
Replace hardcoded quay.io/rhdh/plugin-catalog-index:1.10 with a single
branch-aware CATALOG_INDEX_IMAGE variable derived from RELEASE_BRANCH_NAME.

Add RELEASE_VERSION canonical variable (release-1.10 → 1.10,
main → next) to env_variables.sh for reuse across CI scripts.

Changes:
- env_variables.sh: Add RELEASE_VERSION + CATALOG_INDEX_IMAGE variable
- 5 operator Backstage CRs: Use $CATALOG_INDEX_IMAGE via envsubst
- lib/helm.sh: Parse CATALOG_INDEX_IMAGE into registry/repository/tag
  for --set global.catalogIndex.image.{registry,repository,tag}
- operator.sh: Simplify version derivation using RELEASE_VERSION
- trigger-nightly-job.sh: Add --catalog-index-image and --chart-version
  Gangway override flags for RC/GA verification

Companion PR required in openshift/release to add
MULTISTAGE_PARAM_OVERRIDE_CATALOG_INDEX_IMAGE env var to step registry
ref.yaml + commands.sh files. The rhdh changes include fallback defaults
so order of merge does not matter.

Assisted-by: Claude Code
Replace the full trigger-nightly-job agent command with a stub that
points users to the installable skill at
redhat-developer/rhdh-skills/skills/prow-trigger-nightly.

The underlying script (.ci/pipelines/trigger-nightly-job.sh) remains
in this repository.

Assisted-by: Claude Code
…lm deployments

- Only inject CATALOG_INDEX_IMAGE in Helm chart and Operator when specified
- Use yq to dynamically inject env var into Backstage CRs rather than relying on sed
- Removed hardcoded CATALOG_INDEX_IMAGE from yaml templates

Assisted-by: OpenCode
@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge Bot commented Jun 2, 2026

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📎 Requirement gaps (0)

Context used
✅ Tickets: RHIDP-14348

Grey Divider


Remediation recommended

1. Wrong nightly flag examples 🐞 Bug ≡ Correctness
Description
The header examples in trigger-nightly-job.sh still reference
--catalog-index-tag/--catalog-index-registry, but the script only supports --catalog-index-image.
Copy-pasting the examples will fail with an “Unknown option” error.
Code

.ci/pipelines/trigger-nightly-job.sh[R21-33]

Relevance

⭐⭐⭐ High

Team often accepts fixing misleading/broken command examples in docs/scripts (see accepted doc
corrections in PR #4561).

PR-#4561
PR-#4860

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The header comment shows flags that are not implemented, while parse_args explicitly supports only
--catalog-index-image and treats unknown flags as errors.

.ci/pipelines/trigger-nightly-job.sh[16-33]
.ci/pipelines/trigger-nightly-job.sh[182-214]

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 top-of-file usage examples document `--catalog-index-tag` / `--catalog-index-registry`, but `parse_args()` only implements `--catalog-index-image`. This causes immediate failures for users who copy/paste the examples.

### Issue Context
`usage()` already shows the correct `--catalog-index-image` form; only the header comment block is stale.

### Fix Focus Areas
- .ci/pipelines/trigger-nightly-job.sh[16-40]

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


2. Fragile catalog image parsing 🐞 Bug ☼ Reliability
Description
env_variables.sh derives registry/repository/tag for Helm by naive ':' and '/' splitting, which
mis-parses valid image references like digest form (image@sha256:...) or images without an explicit
registry (rhdh/plugin-catalog-index:1.9). When used, helm::get_image_params will feed invalid
global.catalogIndex.image.* values to Helm and can break deployments.
Code

.ci/pipelines/env_variables.sh[R63-71]

Relevance

⭐⭐ Medium

No prior reviews found about robust container image parsing; team may treat as
edge-case/out-of-scope for CI.

PR-#4860

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The code derives tag by taking everything after the last ':' and derives registry/repo by splitting
on '/', and Helm blindly consumes these derived values when CATALOG_INDEX_IMAGE is set.

.ci/pipelines/env_variables.sh[60-71]
.ci/pipelines/lib/helm.sh[214-236]

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 parsing logic for `CATALOG_INDEX_IMAGE` assumes an explicit `registry/repo:tag` format and fails for other common OCI reference forms (digest refs; implicit registry). This can result in invalid `--set global.catalogIndex.image.*` overrides.

### Issue Context
These derived variables are only used when `CATALOG_INDEX_IMAGE` is set, so adding strict validation/error messages is appropriate and will fail fast.

### Fix Focus Areas
- .ci/pipelines/env_variables.sh[60-71]
- .ci/pipelines/lib/helm.sh[214-236]

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



Advisory comments

3. Skill repo link inconsistent 🐞 Bug ⚙ Maintainability
Description
The trigger-nightly-job agent command docs say the skill is maintained in rhdh-skills but then
instruct the agent to read the rhdh-skill repository URL for installation instructions. This
inconsistency can misdirect automated setup guidance.
Code

.claude/commands/trigger-nightly-job.md[R8-14]

Relevance

⭐⭐⭐ High

Repo tends to accept documentation clarity/link fixes; inconsistency likely corrected when noticed
(PR #4561, #4860).

PR-#4561
PR-#4860

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The document itself contains two different repository names/URLs for the same skill.

.claude/commands/trigger-nightly-job.md[8-14]

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 command doc references two different repositories (`rhdh-skills` vs `rhdh-skill`) for the same skill. This is likely a typo and can cause a 404 or send users to the wrong place.

### Issue Context
The same pattern appears in the `.cursor`, `.opencode`, and `.rulesync` variants; they should all be updated consistently.

### Fix Focus Areas
- .claude/commands/trigger-nightly-job.md[8-14]
- .cursor/commands/trigger-nightly-job.md[6-12]
- .opencode/command/trigger-nightly-job.md[8-14]
- .rulesync/commands/trigger-nightly-job.md[10-16]

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


4. Catalog index default removed 🐞 Bug ≡ Correctness
Description
Operator Backstage CR templates no longer include CATALOG_INDEX_IMAGE and deploy_rhdh_operator
injects it only when explicitly provided, so operator-based CI runs will no longer extract
catalog-index content or replace dynamic-plugins.default.yaml via the catalog index unless the env
var is set. This is a behavior change from the previous hardcoded default and can affect
extensions/catalog-driven plugin defaults.
Code

.ci/pipelines/install-methods/operator.sh[R75-79]

Relevance

⭐ Low

Team previously accepted removing/avoiding default CATALOG_INDEX_IMAGE; behavior-change seems
intentional (accepted review on PR #4860).

PR-#4860

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The operator deployment path now only injects the env var when it is explicitly set, and the
Backstage CR templates no longer contain it. The dynamic plugins installer only performs catalog
index extraction/replacement when CATALOG_INDEX_IMAGE is present.

.ci/pipelines/install-methods/operator.sh[67-83]
.ci/pipelines/resources/rhdh-operator/rhdh-start.yaml[27-44]
scripts/install-dynamic-plugins/install-dynamic-plugins.py[1391-1462]

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

### Issue description
Operator-based deployments previously always set `CATALOG_INDEX_IMAGE` in the Backstage CR, which enabled catalog-index extraction and default replacement behavior in `install-dynamic-plugins.py`. After this change, that env var is only present if explicitly provided, altering plugin default resolution/catalog extraction behavior.

### Issue Context
If the intended behavior is “dynamic default per branch”, consider setting a default like `quay.io/rhdh/plugin-catalog-index:${RELEASE_VERSION}` when `CATALOG_INDEX_IMAGE` is empty, and still allow explicit overrides.

### Fix Focus Areas
- .ci/pipelines/env_variables.sh[20-71]
- .ci/pipelines/install-methods/operator.sh[67-83]
- .ci/pipelines/resources/rhdh-operator/rhdh-start.yaml[27-44]
- scripts/install-dynamic-plugins/install-dynamic-plugins.py[1391-1462]

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


Grey Divider

Qodo Logo

@openshift-ci openshift-ci Bot requested review from gazarenkov and jmagak June 2, 2026 11:54
@zdrapela zdrapela changed the title [1.10] fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command [release-1.10] fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command Jun 2, 2026
@zdrapela
Copy link
Copy Markdown
Member Author

zdrapela commented Jun 2, 2026

/test e2e-ocp-helm-nightly e2e-ocp-operator-nightly e2e-eks-helm-nightly

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

The container image build workflow finished with status: cancelled.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Dynamically resolve catalog index image and add Gangway override support

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Dynamically resolve catalog index image from branch via RELEASE_VERSION variable
  - Replaces hardcoded quay.io/rhdh/plugin-catalog-index:1.10 with branch-aware reference
  - Supports RC and GA verification via Gangway overrides
• Add catalog index and chart version override support to trigger-nightly-job script
  - New flags: --catalog-index-image and --chart-version for CI job customization
  - Enhanced documentation with RC/GA verification examples
• Simplify operator version derivation using canonical RELEASE_VERSION variable
  - Removes duplicate version extraction logic across scripts
• Replace trigger-nightly-job command documentation with external skill reference
  - Points users to installable prow-trigger-nightly skill in rhdh-skills repository
Diagram
flowchart LR
  A["RELEASE_BRANCH_NAME<br/>release-1.10 or main"] -->|derive| B["RELEASE_VERSION<br/>1.10 or next"]
  B -->|used by| C["env_variables.sh"]
  C -->|provides| D["CATALOG_INDEX_IMAGE<br/>registry/repo:tag"]
  D -->|injected into| E["Operator Backstage CRs<br/>via yq"]
  D -->|parsed into| F["Helm chart parameters<br/>registry/repo/tag"]
  G["trigger-nightly-job.sh"] -->|accepts| H["--catalog-index-image<br/>--chart-version flags"]
  H -->|passes to| I["ProwJob via Gangway<br/>MULTISTAGE_PARAM_OVERRIDE"]

Loading

Grey Divider

File Changes

1. .ci/pipelines/env_variables.sh ✨ Enhancement +23/-0

Add RELEASE_VERSION and CATALOG_INDEX_IMAGE variables

.ci/pipelines/env_variables.sh


2. .ci/pipelines/install-methods/operator.sh ✨ Enhancement +7/-8

Simplify version derivation using RELEASE_VERSION

.ci/pipelines/install-methods/operator.sh


3. .ci/pipelines/lib/helm.sh ✨ Enhancement +8/-1

Add catalog index image Helm chart parameters

.ci/pipelines/lib/helm.sh


View more (10)
4. .ci/pipelines/trigger-nightly-job.sh ✨ Enhancement +41/-4

Add catalog index and chart version override flags

.ci/pipelines/trigger-nightly-job.sh


5. .ci/pipelines/resources/rhdh-operator/rhdh-start-rbac.yaml 🐞 Bug fix +0/-4

Remove hardcoded CATALOG_INDEX_IMAGE from template

.ci/pipelines/resources/rhdh-operator/rhdh-start-rbac.yaml


6. .ci/pipelines/resources/rhdh-operator/rhdh-start-rbac_K8s.yaml 🐞 Bug fix +0/-4

Remove hardcoded CATALOG_INDEX_IMAGE from template

.ci/pipelines/resources/rhdh-operator/rhdh-start-rbac_K8s.yaml


7. .ci/pipelines/resources/rhdh-operator/rhdh-start-runtime.yaml 🐞 Bug fix +7/-0

Add missing environment variables to extraEnvs

.ci/pipelines/resources/rhdh-operator/rhdh-start-runtime.yaml


8. .ci/pipelines/resources/rhdh-operator/rhdh-start.yaml 🐞 Bug fix +0/-4

Remove hardcoded CATALOG_INDEX_IMAGE from template

.ci/pipelines/resources/rhdh-operator/rhdh-start.yaml


9. .ci/pipelines/resources/rhdh-operator/rhdh-start_K8s.yaml 🐞 Bug fix +0/-4

Remove hardcoded CATALOG_INDEX_IMAGE from template

.ci/pipelines/resources/rhdh-operator/rhdh-start_K8s.yaml


10. .claude/commands/trigger-nightly-job.md 📝 Documentation +5/-116

Replace command documentation with external skill reference

.claude/commands/trigger-nightly-job.md


11. .cursor/commands/trigger-nightly-job.md 📝 Documentation +5/-116

Replace command documentation with external skill reference

.cursor/commands/trigger-nightly-job.md


12. .opencode/command/trigger-nightly-job.md 📝 Documentation +5/-116

Replace command documentation with external skill reference

.opencode/command/trigger-nightly-job.md


13. .rulesync/commands/trigger-nightly-job.md 📝 Documentation +5/-116

Replace command documentation with external skill reference

.rulesync/commands/trigger-nightly-job.md


Grey Divider

Qodo Logo

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.60%. Comparing base (63fb98c) to head (3dbc4eb).

Additional details and impacted files
@@                Coverage Diff                @@
##           release-1.10    #4910       +/-   ##
=================================================
+ Coverage         41.03%   69.60%   +28.57%     
=================================================
  Files               121      111       -10     
  Lines              2220     4702     +2482     
  Branches            539      537        -2     
=================================================
+ Hits                911     3273     +2362     
- Misses             1304     1428      +124     
+ Partials              5        1        -4     
Flag Coverage Δ
install-dynamic-plugins 92.44% <ø> (?)
rhdh 38.81% <ø> (-2.23%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63fb98c...3dbc4eb. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zdrapela
Copy link
Copy Markdown
Member Author

zdrapela commented Jun 2, 2026

/test e2e-eks-helm-nightly

@zdrapela
Copy link
Copy Markdown
Member Author

zdrapela commented Jun 2, 2026

/test e2e-aks-helm-nightly

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Image was built and published successfully. It is available at:

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 2, 2026

@zdrapela: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-eks-helm-nightly 3dbc4eb link false /test e2e-eks-helm-nightly
ci/prow/e2e-ocp-helm-nightly 3dbc4eb link false /test e2e-ocp-helm-nightly

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant