diff --git a/.github/actions/test-charts/action.yml b/.github/actions/test-charts/action.yml index c3cd644d..b573527b 100644 --- a/.github/actions/test-charts/action.yml +++ b/.github/actions/test-charts/action.yml @@ -17,6 +17,14 @@ inputs: description: 'Specific chart to test (e.g., charts/backstage). When set, only this chart is tested.' required: false default: '' + helm_extra_args: + description: 'Extra arguments to pass to helm via ct install --helm-extra-args (e.g., --values file.yaml)' + required: false + default: '' + helm_template_values_file: + description: 'Extra values file for a helm-template sanity check (renders each CI scenario with these values layered on top, but does not install)' + required: false + default: '' monitoring_heartbeat: description: 'Enable background cluster monitoring (pod status + events every 30s) during chart tests' required: false @@ -85,6 +93,22 @@ runs: helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update + - name: Helm template sanity check (full-plugins override) + if: steps.list-changed.outputs.changed == 'true' && inputs.helm_template_values_file != '' + shell: bash + env: + INPUT_CHART: ${{ inputs.chart }} + VALUES_FILE: ${{ inputs.helm_template_values_file }} + run: | + helm dependency build "$INPUT_CHART" + for ci_values in "$INPUT_CHART"/ci/*-values.yaml; do + [[ -f "$ci_values" ]] || continue + echo "==> helm template: $(basename "$ci_values") + $(basename "$VALUES_FILE")" + output=$(helm template test-release "$INPUT_CHART" \ + --values "$ci_values" \ + --values "$VALUES_FILE" 2>&1) || { echo "$output"; exit 1; } + done + - name: Generate KinD Config if: steps.list-changed.outputs.changed == 'true' shell: bash @@ -148,7 +172,7 @@ runs: env: OLM_VERSION: "v0.31.0" run: | - curl -L "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/install.sh" -o install-olm.sh + curl --proto =https -L "https://github.com/operator-framework/operator-lifecycle-manager/releases/download/${OLM_VERSION}/install.sh" -o install-olm.sh chmod +x install-olm.sh ./install-olm.sh "${OLM_VERSION}" @@ -174,6 +198,7 @@ runs: env: INPUT_CHART: ${{ inputs.chart }} INPUT_EXTRA_HELM_ARGS: ${{ inputs.extra_helm_args }} + INPUT_HELM_EXTRA_ARGS: ${{ inputs.helm_extra_args }} INPUT_TARGET_BRANCH: ${{ inputs.target_branch }} INPUT_ALL_CHARTS: ${{ inputs.all_charts }} INPUT_MONITORING_HEARTBEAT: ${{ inputs.monitoring_heartbeat }} @@ -207,12 +232,31 @@ runs: EXTRA_ARGS+=("${ADDITIONAL_ARGS[@]}") fi CT_ARGS=( - --debug --config ct-install.yaml - --upgrade --target-branch "$INPUT_TARGET_BRANCH" --helm-extra-set-args="${EXTRA_ARGS[*]}" ) + if [[ -n "$INPUT_CHART" ]]; then + old_version=$(git show "origin/$INPUT_TARGET_BRANCH:$INPUT_CHART/Chart.yaml" 2>/dev/null | yq '.version' 2>/dev/null || echo "0.0.0") + new_version=$(yq '.version' "$INPUT_CHART/Chart.yaml") + old_major=${old_version%%.*} + new_major=${new_version%%.*} + if [[ "$old_version" == "$new_version" ]]; then + echo "Skipping --upgrade: chart version unchanged ($old_version)" + elif [[ "$old_major" != "$new_major" ]]; then + echo "Skipping --upgrade: major version bump detected ($old_version -> $new_version)" + else + CT_ARGS+=(--upgrade) + fi + else + CT_ARGS+=(--upgrade) + fi + if [[ "$RUNNER_DEBUG" == "1" ]]; then + CT_ARGS+=(--debug) + fi + if [[ -n "$INPUT_HELM_EXTRA_ARGS" ]]; then + CT_ARGS+=(--helm-extra-args="$INPUT_HELM_EXTRA_ARGS") + fi if [[ -n "$INPUT_CHART" ]]; then CT_ARGS+=(--charts "$INPUT_CHART") elif [[ "$INPUT_ALL_CHARTS" == "true" ]]; then diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 93269243..b931de2d 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -108,6 +108,12 @@ jobs: fi done + - name: Generate nightly values override for backstage chart + if: steps.check.outputs.exists == 'true' && matrix.chart == 'backstage' + run: | + yq e '{"global": {"dynamic": {"includes": .global.dynamic.includes}, "lightspeed": {"plugins": .global.lightspeed.plugins}}, "orchestrator": {"plugins": .orchestrator.plugins}}' \ + charts/backstage/values.yaml > /tmp/backstage-nightly-values.yaml + - name: Test charts if: steps.check.outputs.exists == 'true' uses: ./.github/actions/test-charts @@ -117,3 +123,4 @@ jobs: all_charts: 'true' monitoring_heartbeat: ${{ vars.TEST_MONITORING_HEARTBEAT_ENABLED || 'false' }} extra_helm_args: ${{ matrix.chart == 'backstage' && format('--set upstream.backstage.image.repository={0} --set upstream.backstage.image.tag={1} --set upstream.backstage.image.pullPolicy=Always', steps.image.outputs.repo, steps.image.outputs.tag) || '' }} + helm_extra_args: ${{ matrix.chart == 'backstage' && '--values /tmp/backstage-nightly-values.yaml' || '' }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c6b3a3f9..371861ad 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -69,24 +69,25 @@ jobs: fail-fast: false matrix: chart: ${{ fromJson(needs.discover-charts.outputs.charts) }} - env: - RHDH_IMAGE_REPOSITORY: ${{ vars.RHDH_IMAGE_REPOSITORY || 'rhdh/rhdh-hub-rhel9' }} - RHDH_IMAGE_TAG: ${{ vars.RHDH_IMAGE_TAG || 'latest' }} - steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: fetch-depth: 0 + - name: Generate full-plugins values for template sanity check + if: matrix.chart == 'backstage' + run: | + yq e '{"global": {"dynamic": {"includes": .global.dynamic.includes}, "lightspeed": {"plugins": .global.lightspeed.plugins}}, "orchestrator": {"plugins": .orchestrator.plugins}}' \ + charts/backstage/values.yaml > /tmp/backstage-full-plugins-values.yaml + - name: Test charts uses: ./.github/actions/test-charts with: target_branch: ${{ github.event.pull_request.base.ref }} chart: charts/${{ matrix.chart }} monitoring_heartbeat: ${{ vars.TEST_MONITORING_HEARTBEAT_ENABLED || 'false' }} - # The RHDH image tag is already pinned to a specific version for the 'release-1.y' branches. - extra_helm_args: ${{ matrix.chart == 'backstage' && github.event.pull_request.base.ref == 'main' && format('--set upstream.backstage.image.repository={0} --set upstream.backstage.image.tag={1}', env.RHDH_IMAGE_REPOSITORY, env.RHDH_IMAGE_TAG) || '' }} + helm_template_values_file: ${{ matrix.chart == 'backstage' && '/tmp/backstage-full-plugins-values.yaml' || '' }} # Aligning job name with the OpenShift CI config: https://github.com/openshift/release/blob/master/core-services/prow/02_config/redhat-developer/rhdh-chart/_prowconfig.yaml#L18 status: diff --git a/charts/backstage/Chart.yaml b/charts/backstage/Chart.yaml index e0065487..fc43ddcf 100644 --- a/charts/backstage/Chart.yaml +++ b/charts/backstage/Chart.yaml @@ -47,4 +47,4 @@ sources: [] # Versions are expected to follow Semantic Versioning (https://semver.org/) # Note that when this chart is published to https://github.com/openshift-helm-charts/charts # it will follow the RHDH versioning 1.y.z -version: 6.2.2 +version: 7.0.0 diff --git a/charts/backstage/README.md b/charts/backstage/README.md index 6cbc5635..33cb0c19 100644 --- a/charts/backstage/README.md +++ b/charts/backstage/README.md @@ -1,7 +1,7 @@ # RHDH Backstage Helm Chart for OpenShift -![Version: 6.2.2](https://img.shields.io/badge/Version-6.2.2-informational?style=flat-square) +![Version: 7.0.0](https://img.shields.io/badge/Version-7.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage. @@ -29,7 +29,7 @@ For the **Generally Available** version of this chart, see: helm repo add bitnami https://charts.bitnami.com/bitnami helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart -helm install my-backstage redhat-developer/backstage --version 6.2.2 +helm install my-backstage redhat-developer/backstage --version 7.0.0 ``` ## Introduction @@ -168,7 +168,7 @@ Kubernetes: `>= 1.27.0-0` | global.auth.backend.enabled | Enable backend service to service authentication, unless configured otherwise it generates a secret value | bool | `true` | | global.auth.backend.existingSecret | Instead of generating a secret value, refer to existing secret | string | `""` | | global.auth.backend.value | Instead of generating a secret value, use the following value | string | `""` | -| global.catalogIndex | Catalog index configuration for automatic plugin discovery. The `install-dynamic-plugins.py` script pulls this image if the `CATALOG_INDEX_IMAGE` environment variable is set. The `dynamic-plugins.default.yaml` file will be extracted and written to `dynamic-plugins-root` volume mount. | object | `{"extraImages":[],"image":{"registry":"quay.io","repository":"rhdh/plugin-catalog-index","tag":"1.10"}}` | +| global.catalogIndex | Catalog index configuration for automatic plugin discovery. The `install-dynamic-plugins.py` script pulls this image if the `CATALOG_INDEX_IMAGE` environment variable is set. The `dynamic-plugins.default.yaml` file will be extracted and written to `dynamic-plugins-root` volume mount. | object | `{"extraImages":[],"image":{"registry":"quay.io","repository":"rhdh/plugin-catalog-index","tag":"next"}}` | | global.catalogIndex.extraImages | Extra catalog index images for additional plugin discovery in the Extensions UI. Each item must include `registry`, `repository`, and `tag` fields; `name` is optional. Only catalog entities are extracted from extra images (no `dynamic-plugins.default.yaml` handling). | list | `[]` | | global.clusterRouterBase | Shorthand for users who do not want to specify a custom HOSTNAME. Used ONLY with the DEFAULT upstream.backstage.appConfig value and with OCP Route enabled. | string | `"apps.example.com"` | | global.dynamic.includes | Array of YAML files listing dynamic plugins to include with those listed in the `plugins` field. Relative paths are resolved from the working directory of the initContainer that will install the plugins (`/opt/app-root/src`). | list | `["dynamic-plugins.default.yaml"]` | diff --git a/charts/backstage/ci/default-values.yaml b/charts/backstage/ci/default-values.yaml index f29bd4f9..9bdc895f 100644 --- a/charts/backstage/ci/default-values.yaml +++ b/charts/backstage/ci/default-values.yaml @@ -2,6 +2,14 @@ route: enabled: false +# CI: skip dynamic plugin downloads to speed up tests. +# The chart features under test (deployment, config, probes, etc.) don't depend on actual plugins. +global: + dynamic: + includes: [] + lightspeed: + plugins: [] + upstream: postgresql: primary: diff --git a/charts/backstage/ci/with-custom-dynamic-pvc-claim-spec-values.yaml b/charts/backstage/ci/with-custom-dynamic-pvc-claim-spec-values.yaml index 8a13ec41..2dfc6593 100644 --- a/charts/backstage/ci/with-custom-dynamic-pvc-claim-spec-values.yaml +++ b/charts/backstage/ci/with-custom-dynamic-pvc-claim-spec-values.yaml @@ -2,6 +2,13 @@ route: enabled: false +# CI: skip dynamic plugin downloads to speed up tests. +global: + dynamic: + includes: [] + lightspeed: + plugins: [] + upstream: postgresql: primary: diff --git a/charts/backstage/ci/with-custom-image-for-test-pod-values.yaml b/charts/backstage/ci/with-custom-image-for-test-pod-values.yaml index 121bb215..6e511c23 100644 --- a/charts/backstage/ci/with-custom-image-for-test-pod-values.yaml +++ b/charts/backstage/ci/with-custom-image-for-test-pod-values.yaml @@ -1,6 +1,14 @@ # Workaround for kind cluster in CI which has no Routes and no PVCs route: enabled: false + +# CI: skip dynamic plugin downloads to speed up tests. +global: + dynamic: + includes: [] + lightspeed: + plugins: [] + upstream: postgresql: primary: diff --git a/charts/backstage/ci/with-lightspeed-disabled-values.yaml b/charts/backstage/ci/with-lightspeed-disabled-values.yaml index d12c21e2..7dfc0a1e 100644 --- a/charts/backstage/ci/with-lightspeed-disabled-values.yaml +++ b/charts/backstage/ci/with-lightspeed-disabled-values.yaml @@ -3,8 +3,12 @@ route: enabled: false global: + # CI: skip dynamic plugin downloads to speed up tests. + dynamic: + includes: [] lightspeed: enabled: false + plugins: [] upstream: postgresql: diff --git a/charts/backstage/ci/with-lightspeed-service-host.yaml b/charts/backstage/ci/with-lightspeed-service-host-values.yaml similarity index 55% rename from charts/backstage/ci/with-lightspeed-service-host.yaml rename to charts/backstage/ci/with-lightspeed-service-host-values.yaml index 0fceacee..5ba5007b 100644 --- a/charts/backstage/ci/with-lightspeed-service-host.yaml +++ b/charts/backstage/ci/with-lightspeed-service-host-values.yaml @@ -3,7 +3,12 @@ route: enabled: false global: + # CI: skip dynamic plugin downloads to speed up tests. + dynamic: + includes: [] + # FIXME(RHIDP-15458): remove plugins override once next catalog index is stable with correct lightspeed refs in the DPDY lightspeed: + plugins: [] sidecar: env: - name: SERVICE_HOST diff --git a/charts/backstage/ci/with-orchestrator-and-dynamic-plugins-npmrc-values.yaml b/charts/backstage/ci/with-orchestrator-and-dynamic-plugins-npmrc-values.yaml index 4f78749d..782654ea 100644 --- a/charts/backstage/ci/with-orchestrator-and-dynamic-plugins-npmrc-values.yaml +++ b/charts/backstage/ci/with-orchestrator-and-dynamic-plugins-npmrc-values.yaml @@ -9,15 +9,20 @@ upstream: global: dynamic: + # CI: skip dynamic plugin downloads to speed up tests. + includes: [] plugins: # Enable additional plugins, which should be merged with the Orchestrator plugins - - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor:bs_1.52.0__2.15.0 enabled: true - - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-tech-radar:bs_1.52.0__1.20.0 enabled: true + lightspeed: + plugins: [] orchestrator: enabled: true + plugins: [] test: injectTestNpmrcSecret: true diff --git a/charts/backstage/ci/with-orchestrator-values.yaml b/charts/backstage/ci/with-orchestrator-values.yaml index a6732019..5b932df7 100644 --- a/charts/backstage/ci/with-orchestrator-values.yaml +++ b/charts/backstage/ci/with-orchestrator-values.yaml @@ -9,12 +9,17 @@ upstream: global: dynamic: + # CI: skip dynamic plugin downloads to speed up tests. + includes: [] plugins: # Enable additional plugins, which should be merged with the Orchestrator plugins - - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import-backend-dynamic + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor:bs_1.52.0__2.15.0 enabled: true - - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import + - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-tech-radar:bs_1.52.0__1.20.0 enabled: true + lightspeed: + plugins: [] orchestrator: enabled: true + plugins: [] diff --git a/charts/backstage/ci/with-test-pod-disabled-values.yaml b/charts/backstage/ci/with-test-pod-disabled-values.yaml index 4a4257cb..c3e9ec89 100644 --- a/charts/backstage/ci/with-test-pod-disabled-values.yaml +++ b/charts/backstage/ci/with-test-pod-disabled-values.yaml @@ -1,6 +1,14 @@ # Workaround for kind cluster in CI which has no Routes and no PVCs route: enabled: false + +# CI: skip dynamic plugin downloads to speed up tests. +global: + dynamic: + includes: [] + lightspeed: + plugins: [] + upstream: postgresql: primary: diff --git a/charts/backstage/values.schema.json b/charts/backstage/values.schema.json index 35372eec..49d028a5 100644 --- a/charts/backstage/values.schema.json +++ b/charts/backstage/values.schema.json @@ -82,7 +82,7 @@ "type": "string" }, "tag": { - "default": "1.10", + "default": "next", "title": "Catalog index image tag", "type": "string" } diff --git a/charts/backstage/values.schema.tmpl.json b/charts/backstage/values.schema.tmpl.json index 32aed84f..7466ebef 100644 --- a/charts/backstage/values.schema.tmpl.json +++ b/charts/backstage/values.schema.tmpl.json @@ -127,7 +127,7 @@ "tag": { "title": "Catalog index image tag", "type": "string", - "default": "1.9" + "default": "next" } } }, diff --git a/charts/backstage/values.yaml b/charts/backstage/values.yaml index e57eced3..89b994cb 100644 --- a/charts/backstage/values.yaml +++ b/charts/backstage/values.yaml @@ -34,7 +34,7 @@ global: image: registry: quay.io repository: rhdh/plugin-catalog-index - tag: "1.10" + tag: "next" # -- Extra catalog index images for additional plugin discovery in the Extensions UI. # Each item must include `registry`, `repository`, and `tag` fields; `name` is optional. # Only catalog entities are extracted from extra images (no `dynamic-plugins.default.yaml` handling).