Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/actions/test-charts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
chmod +x install-olm.sh
./install-olm.sh "${OLM_VERSION}"

Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' || '' }}
13 changes: 7 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions charts/backstage/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"]` |
Expand Down
8 changes: 8 additions & 0 deletions charts/backstage/ci/default-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
route:
enabled: false

# CI: skip dynamic plugin downloads to speed up tests.
global:
dynamic:
includes: []
lightspeed:
plugins: []

upstream:
postgresql:
primary:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/backstage/ci/with-lightspeed-disabled-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 7 additions & 2 deletions charts/backstage/ci/with-orchestrator-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
8 changes: 8 additions & 0 deletions charts/backstage/ci/with-test-pod-disabled-values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"type": "string"
},
"tag": {
"default": "1.10",
"default": "next",
"title": "Catalog index image tag",
"type": "string"
}
Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/values.schema.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"tag": {
"title": "Catalog index image tag",
"type": "string",
"default": "1.9"
"default": "next"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Loading