Skip to content

fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command#4860

Merged
openshift-merge-bot[bot] merged 5 commits into
redhat-developer:mainfrom
zdrapela:feature/dynamic-catalog-index-override
Jun 2, 2026
Merged

fix(ci): dynamically resolve catalog index image from branch + remove trigger-nightly-job command#4860
openshift-merge-bot[bot] merged 5 commits into
redhat-developer:mainfrom
zdrapela:feature/dynamic-catalog-index-override

Conversation

@zdrapela

@zdrapela zdrapela commented May 20, 2026

Copy link
Copy Markdown
Member

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

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 in rhdh-skills.

Changes

Dynamic catalog index resolution

  • env_variables.sh: Add RELEASE_VERSION canonical variable (mainnext, release-X.YX.Y) and single CATALOG_INDEX_IMAGE variable with fallback default (quay.io/rhdh/plugin-catalog-index:$RELEASE_VERSION). Parse into CATALOG_INDEX_REGISTRY/CATALOG_INDEX_REPO/CATALOG_INDEX_TAG for Helm chart consumption.
  • 5 operator Backstage CRs: Replace hardcoded quay.io/rhdh/plugin-catalog-index:1.10 with $CATALOG_INDEX_IMAGE
  • lib/helm.sh: Simplified — uses pre-parsed catalog index variables from env_variables.sh

Gangway override support

  • trigger-nightly-job.sh: Add --catalog-index-image and --chart-version flags with MULTISTAGE_PARAM_OVERRIDE_CATALOG_INDEX_IMAGE Gangway env var

Agent command update

Companion PR

  • openshift/release: Gangway override declaration for MULTISTAGE_PARAM_OVERRIDE_CATALOG_INDEX_IMAGE (independent, merge order doesn't matter due to fallback defaults)

Testing

  • Trigger OCP Helm + Operator nightly jobs to verify

@openshift-ci

openshift-ci Bot commented May 20, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@zdrapela

Copy link
Copy Markdown
Member Author

/test e2e-ocp-helm

@zdrapela

Copy link
Copy Markdown
Member Author

/test e2e-ocp-operator-nightly

@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.25%. Comparing base (c1acb63) to head (98ac104).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4860      +/-   ##
==========================================
- Coverage   55.82%   55.25%   -0.58%     
==========================================
  Files         121      109      -12     
  Lines        2350     2132     -218     
  Branches      562      536      -26     
==========================================
- Hits         1312     1178     -134     
+ Misses       1032      953      -79     
+ Partials        6        1       -5     
Flag Coverage Δ
rhdh 55.25% <ø> (-0.58%) ⬇️

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 c1acb63...98ac104. 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.

@github-actions

Copy link
Copy Markdown
Contributor

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

@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from 907376b to b4c120c Compare June 1, 2026 12:48
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
@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from b4c120c to a5430df Compare June 1, 2026 12:51
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from a5430df to 909bced Compare June 1, 2026 12:59
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from 909bced to ccb7ff5 Compare June 1, 2026 13:00
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from ccb7ff5 to ed28f39 Compare June 1, 2026 13:02
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela zdrapela marked this pull request as ready for review June 1, 2026 13:03
@openshift-ci openshift-ci Bot requested review from benwilcock and durandom June 1, 2026 13:03
@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Jun 1, 2026

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Catalog image split unsafe 🐞 Bug ≡ Correctness
Description
env_variables.sh derives CATALOG_INDEX_TAG/REGISTRY/REPO via naive ':' splitting, so a tagless or
digest-based CATALOG_INDEX_IMAGE produces an invalid tag value that is always passed into Helm,
leading to an invalid catalog index image reference at deploy time.
Code

.ci/pipelines/env_variables.sh[R64-70]

Relevance

⭐⭐ Medium

No similar past finding; team sometimes rejects extra CI image-robustness changes (e.g., PR 4463).

PR-#4463

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code derives tag/registry/repo purely by splitting on ':' and '/', and Helm unconditionally
forwards the derived parts into global.catalogIndex.image.*, which the values files show as
separate registry/repository/tag fields; therefore a malformed split directly becomes malformed Helm
values.

.ci/pipelines/env_variables.sh[60-70]
.ci/pipelines/lib/helm.sh[214-234]
.ci/pipelines/value_files/values_showcase.yaml[1-7]

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

### Issue description
`CATALOG_INDEX_IMAGE` is split into `CATALOG_INDEX_REGISTRY/REPO/TAG` using simple `:`-based parameter expansion. If the override is tagless (no `:<tag>`) or uses a digest (`@sha256:...`), `CATALOG_INDEX_TAG` becomes wrong (entire image ref or digest suffix), but Helm always consumes it, producing an invalid image reference.

### Issue Context
Helm installation always injects `global.catalogIndex.image.*` via `helm::get_image_params`, so any bad split will affect all Helm-based CI installs.

### Fix Focus Areas
- .ci/pipelines/env_variables.sh[60-71]

### Suggested fix
1. Validate that `CATALOG_INDEX_IMAGE` is a tag-based reference (no digest) and contains a tag after the last `/`.
2. Parse robustly:
  - Reject digest refs: `[[ "$CATALOG_INDEX_IMAGE" == *@* ]] && error` (or add explicit digest support if the chart supports it).
  - Ensure tag exists after last `/`: `[[ "${CATALOG_INDEX_IMAGE##*/}" == *:* ]] || error`.
  - Then split using the sanitized string:
    - `CATALOG_INDEX_TAG="${CATALOG_INDEX_IMAGE##*:}"`
    - `without_tag="${CATALOG_INDEX_IMAGE%:*}"`
    - `CATALOG_INDEX_REGISTRY="${without_tag%%/*}"`
    - `CATALOG_INDEX_REPO="${without_tag#*/}"`
3. On validation failure, `log::error` and `exit 1` early so CI fails fast with a clear message.

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



Remediation recommended

2. Trigger examples use wrong flags 🐞 Bug ≡ Correctness
Description
trigger-nightly-job.sh’s header examples reference --catalog-index-tag/--catalog-index-registry, but
parse_args doesn’t implement them, so users following the examples will hit an 'Unknown option'
error.
Code

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

Relevance

⭐⭐⭐ High

Team iterates on trigger-nightly-job flags/docs; mismatched examples likely fixed to avoid ‘Unknown
option’ (PR 4355, 4463).

PR-#4355
PR-#4463

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The comment block explicitly shows flags that are not recognized by the option parser, which only
accepts --catalog-index-image and --chart-version for the new functionality.

.ci/pipelines/trigger-nightly-job.sh[16-33]
.ci/pipelines/trigger-nightly-job.sh[123-197]

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 script header examples document `--catalog-index-tag` and `--catalog-index-registry`, but the script only supports `--catalog-index-image` (and `--chart-version`). Copy/pasting the examples will fail.

### Issue Context
This is user-facing documentation inside the executable script; it’s likely to be copy/pasted.

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

### Suggested fix
Update the header examples to use `--catalog-index-image <registry>/<repo>:<tag>` consistently (or, alternatively, implement the documented `--catalog-index-tag/--catalog-index-registry` flags and translate them into a full `CATALOG_INDEX_IMAGE`).

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


Grey Divider

Qodo Logo

@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 canonical variable
• Add CATALOG_INDEX_IMAGE with fallback default and Gangway override support
• Parse catalog index into registry/repository/tag for Helm chart consumption
• Add --catalog-index-image and --chart-version flags to trigger-nightly-job script
• Replace trigger-nightly-job agent command with install guide to external rhdh-skills
Diagram
flowchart LR
  A["RELEASE_BRANCH_NAME<br/>main/release-X.Y"] -->|"derive"| B["RELEASE_VERSION<br/>next/X.Y"]
  B -->|"construct"| C["CATALOG_INDEX_IMAGE<br/>quay.io/rhdh/plugin-catalog-index:VERSION"]
  C -->|"parse"| D["Registry/Repo/Tag<br/>for Helm --set"]
  E["Gangway Overrides<br/>--catalog-index-image<br/>--chart-version"] -->|"inject"| F["trigger-nightly-job.sh<br/>ProwJob Parameters"]
  D -->|"configure"| G["5 Operator Backstage CRs<br/>with dynamic CATALOG_INDEX_IMAGE"]
  F -->|"trigger"| H["Nightly CI Jobs<br/>RC/GA Verification"]

Loading

Grey Divider

File Changes

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

Add RELEASE_VERSION and CATALOG_INDEX_IMAGE variables

.ci/pipelines/env_variables.sh


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

Simplify version derivation using RELEASE_VERSION

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


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

Add catalog index image Helm parameters

.ci/pipelines/lib/helm.sh


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

Add catalog-index-image and chart-version flags

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


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

Replace hardcoded catalog index with variable

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


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

Replace hardcoded catalog index with variable

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


7. .ci/pipelines/resources/rhdh-operator/rhdh-start-runtime.yaml ✨ Enhancement +11/-0

Add dynamic catalog index environment variable

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


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

Replace hardcoded catalog index with variable

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


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

Replace hardcoded catalog index with variable

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


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

Replace command implementation with rhdh-skills reference

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


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

Replace command implementation with rhdh-skills reference

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


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

Replace command implementation with rhdh-skills reference

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


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

Replace command implementation with rhdh-skills reference

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


Grey Divider

Qodo Logo

@zdrapela

zdrapela commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

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

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
@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from ed28f39 to e7cdf9e Compare June 1, 2026 13:15
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela

zdrapela commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

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

Comment thread .ci/pipelines/env_variables.sh Outdated
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

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

…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
@zdrapela zdrapela force-pushed the feature/dynamic-catalog-index-override branch from b4b7909 to 462c66f Compare June 1, 2026 14:11
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: failure.

@zdrapela

zdrapela commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

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

1 similar comment
@zdrapela

zdrapela commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

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

@openshift-ci

openshift-ci Bot commented Jun 1, 2026

Copy link
Copy Markdown

@zdrapela: The following test 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-ocp-helm-nightly 0c3c546 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.

@subhashkhileri subhashkhileri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@zdrapela

zdrapela commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

/retest

@openshift-ci openshift-ci Bot removed the lgtm label Jun 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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

@zdrapela

zdrapela commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

/cherry-pick release-1.10

@subhashkhileri subhashkhileri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

@zdrapela: once the present PR merges, I will cherry-pick it on top of release-1.10 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-1.10

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.

@openshift-ci openshift-ci Bot added the lgtm label Jun 2, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 21e226a into redhat-developer:main Jun 2, 2026
25 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

@zdrapela: #4860 failed to apply on top of branch "release-1.10":

Applying: fix(ci): dynamically resolve catalog index image from branch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To record the empty patch as an empty commit, run "git am --allow-empty".
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Applying: chore: replace trigger-nightly-job command with install guide
Applying: chore(ci): dynamically inject CATALOG_INDEX_IMAGE for operator and helm deployments
Patch is empty.

Details

In response to this:

/cherry-pick release-1.10

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.

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.

3 participants