From 3ce1d2a20988d4ef0edac8bff1212c7695c682a5 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 15 Jan 2026 09:21:05 +0100 Subject: [PATCH 1/3] ci: ensure stability by testing PR using the latest stable/RC version of RHDH --- .github/workflows/test.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8f8052ba..bbc8e458 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,8 +4,6 @@ on: pull_request: branches: - main - - rhdh-1.[0-9]+ - - 1.[0-9]+.x - release-1.[0-9]+ concurrency: @@ -137,23 +135,35 @@ jobs: # but the OpenShift Serverless and Serverless Operators installed by this chart are available only on OCP (from the Red Hat Catalog). # For the simple testing that we are doing here on a vanilla K8s cluster, we only need both the Knative and SonataFlow CRDs. # TODO(rm3l): Update this when/if there is an upstream counterpart installable via OLM. - # NOTES: - # - Serverless 1.35 corresponds to Knative 1.18 - # - Serverless Logic 1.35 corresponds to Sonataflow 1.43 - name: Install Knative and SonataFlow CRDs via the orchestrator-infra-chart as minimum prerequisite for testing the Orchestrator flavor if: steps.list-changed.outputs.backstageChartChanged == 'true' + env: + SONATAFLOW_OPERATOR_VERSION: "10.1.0" run: | for crdDir in charts/orchestrator-infra/crds/*; do kubectl create -f "${crdDir}" done - kubectl create -f https://github.com/apache/incubator-kie-tools/releases/download/10.1.0/apache-kie-10.1.0-incubating-sonataflow-operator.yaml + kubectl create -f "https://github.com/apache/incubator-kie-tools/releases/download/${SONATAFLOW_OPERATOR_VERSION}/apache-kie-${SONATAFLOW_OPERATOR_VERSION}-incubating-sonataflow-operator.yaml" - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' run: | + EXTRA_ARGS=( + "--set upstream.backstage.image.pullPolicy=Always" + "--set route.enabled=false" + "--set upstream.ingress.enabled=true" + "--set global.host=rhdh.127.0.0.1.sslip.io" + ) + if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then + # Ensure stability for PRs against main. + EXTRA_ARGS+=( + "--set upstream.backstage.image.repository=rhdh/rhdh-hub-rhel9" + "--set upstream.backstage.image.tag=latest" + ) + fi ct install \ --debug \ --config ct-install.yaml \ --upgrade \ --target-branch "${{ github.event.pull_request.base.ref }}" \ - --helm-extra-set-args="--set upstream.ingress.enabled=true --set global.host=rhdh.127.0.0.1.sslip.io" + --helm-extra-set-args="${EXTRA_ARGS[*]}" From bb9dc1011894f3ca9750f61602094aadbbd61dbb Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 15 Jan 2026 09:26:48 +0100 Subject: [PATCH 2/3] ci: add nightly workflow for testing against the unstable 'next' tag of RHDH --- .github/workflows/nightly.yaml | 142 +++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 .github/workflows/nightly.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 00000000..ea47c137 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,142 @@ +name: Nightly Test Charts + +on: + schedule: + - cron: '38 21 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + + test-chart: + name: Nightly Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # renovate: tag=v3.5 + with: + version: v3.10.0 + + - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 + with: + python-version: 3.14 + + - name: Set up chart-testing + uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 + with: + version: '3.14.0' + yamllint_version: '1.37.1' + yamale_version: '6.0.0' + + - name: Remove unnecessary files to free up disk space + uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3 + with: + remove_android: true + remove_dotnet: true + remove_haskell: true + rm_cmd: "rmz" + + - name: Add Helm Repositories + run: | + helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add backstage https://backstage.github.io/charts + helm repo update + + - name: Generate KinD Config + run: | + cat < /tmp/kind-config.yaml + apiVersion: kind.x-k8s.io/v1alpha4 + kind: Cluster + nodes: + - role: control-plane + extraPortMappings: + - containerPort: 80 + hostPort: 80 + protocol: TCP + - containerPort: 443 + hostPort: 443 + protocol: TCP + EOF + + - name: Create KIND Cluster + uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 + with: + config: /tmp/kind-config.yaml + + - name: Create custom storage class + run: | + export defaultScProvisioner=$(kubectl get storageclass -o jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].provisioner}') + if [[ -z "$defaultScProvisioner" ]]; then + echo "No default storage class found or it has no provisioner. Exiting early because the test using the custom Storage Class will likely fail. Use a cluster that has a default storage class." + exit 1 + fi + echo "[INFO] defaultScProvisioner=$defaultScProvisioner" + + cat < Date: Thu, 15 Jan 2026 09:35:09 +0100 Subject: [PATCH 3/3] ci: refactor chart testing into reusable composite action --- .github/actions/test-charts/action.yml | 185 +++++++++++++++++++++++++ .github/workflows/nightly.yaml | 123 +--------------- .github/workflows/test.yaml | 154 ++------------------ 3 files changed, 201 insertions(+), 261 deletions(-) create mode 100644 .github/actions/test-charts/action.yml diff --git a/.github/actions/test-charts/action.yml b/.github/actions/test-charts/action.yml new file mode 100644 index 00000000..3af4224e --- /dev/null +++ b/.github/actions/test-charts/action.yml @@ -0,0 +1,185 @@ +name: 'Test Charts' +description: 'Set up environment and run chart testing' + +inputs: + target_branch: + description: 'Target branch for chart-testing' + required: true + extra_helm_args: + description: 'Extra Helm arguments to pass to ct install' + required: false + default: '' + all_charts: + description: 'Install all charts instead of only changed ones' + required: false + default: 'false' + +runs: + using: 'composite' + steps: + - name: Set up Helm + uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # renovate: tag=v3.5 + with: + version: v3.10.0 + + - name: Set up Python + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 + with: + python-version: 3.14 + + - name: Set up chart-testing + uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 + with: + version: '3.14.0' + yamllint_version: '1.37.1' + yamale_version: '6.0.0' + + - name: Run chart-testing (list-changed) + id: list-changed + shell: bash + env: + INPUT_TARGET_BRANCH: ${{ inputs.target_branch }} + INPUT_ALL_CHARTS: ${{ inputs.all_charts }} + run: | + if [[ "$INPUT_ALL_CHARTS" == "true" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + echo "backstageChartChanged=true" >> "$GITHUB_OUTPUT" + else + listChanged=$(ct list-changed --target-branch "$INPUT_TARGET_BRANCH") + if [[ -n "$listChanged" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + if grep 'charts/backstage' <<< "$listChanged"; then + echo "backstageChartChanged=true" >> "$GITHUB_OUTPUT" + fi + fi + fi + + - name: Remove unnecessary files to free up disk space + if: steps.list-changed.outputs.changed == 'true' + uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3 + with: + remove_android: true + remove_dotnet: true + remove_haskell: true + rm_cmd: "rmz" + + - name: Add Helm Repositories + if: steps.list-changed.outputs.changed == 'true' + shell: bash + run: | + helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add backstage https://backstage.github.io/charts + helm repo update + + - name: Generate KinD Config + if: steps.list-changed.outputs.changed == 'true' + shell: bash + run: | + cat < /tmp/kind-config.yaml + apiVersion: kind.x-k8s.io/v1alpha4 + kind: Cluster + nodes: + - role: control-plane + extraPortMappings: + - containerPort: 80 + hostPort: 80 + protocol: TCP + - containerPort: 443 + hostPort: 443 + protocol: TCP + EOF + + - name: Create KIND Cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 + with: + config: /tmp/kind-config.yaml + + - name: Create custom storage class + if: steps.list-changed.outputs.changed == 'true' + shell: bash + run: | + export defaultScProvisioner=$(kubectl get storageclass -o jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].provisioner}') + if [[ -z "$defaultScProvisioner" ]]; then + echo "No default storage class found or it has no provisioner. Exiting early because the test using the custom Storage Class will likely fail. Use a cluster that has a default storage class." + exit 1 + fi + echo "[INFO] defaultScProvisioner=$defaultScProvisioner" + + cat < /tmp/kind-config.yaml - apiVersion: kind.x-k8s.io/v1alpha4 - kind: Cluster - nodes: - - role: control-plane - extraPortMappings: - - containerPort: 80 - hostPort: 80 - protocol: TCP - - containerPort: 443 - hostPort: 443 - protocol: TCP - EOF - - - name: Create KIND Cluster - uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 - with: - config: /tmp/kind-config.yaml - - - name: Create custom storage class - run: | - export defaultScProvisioner=$(kubectl get storageclass -o jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].provisioner}') - if [[ -z "$defaultScProvisioner" ]]; then - echo "No default storage class found or it has no provisioner. Exiting early because the test using the custom Storage Class will likely fail. Use a cluster that has a default storage class." - exit 1 - fi - echo "[INFO] defaultScProvisioner=$defaultScProvisioner" - - cat <> "$GITHUB_OUTPUT" - if grep 'charts/backstage' <<< "$listChanged"; then - echo "backstageChartChanged=true" >> "$GITHUB_OUTPUT" - fi - fi - - - name: Remove unnecessary files to free up disk space - if: steps.list-changed.outputs.changed == 'true' - uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3 - with: - remove_android: true - remove_dotnet: true - remove_haskell: true - rm_cmd: "rmz" - - - name: Add Helm Repositories - if: steps.list-changed.outputs.changed == 'true' - run: | - helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx - helm repo add bitnami https://charts.bitnami.com/bitnami - helm repo add backstage https://backstage.github.io/charts - helm repo update - - - name: Generate KinD Config - if: steps.list-changed.outputs.changed == 'true' - run: | - cat < /tmp/kind-config.yaml - apiVersion: kind.x-k8s.io/v1alpha4 - kind: Cluster - nodes: - - role: control-plane - extraPortMappings: - - containerPort: 80 - hostPort: 80 - protocol: TCP - - containerPort: 443 - hostPort: 443 - protocol: TCP - EOF - - - name: Create KIND Cluster - if: steps.list-changed.outputs.changed == 'true' - uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0 - with: - config: /tmp/kind-config.yaml - - - name: Create custom storage class - if: steps.list-changed.outputs.changed == 'true' - run: | - export defaultScProvisioner=$(kubectl get storageclass -o jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].provisioner}') - if [[ -z "$defaultScProvisioner" ]]; then - echo "No default storage class found or it has no provisioner. Exiting early because the test using the custom Storage Class will likely fail. Use a cluster that has a default storage class." - exit 1 - fi - echo "[INFO] defaultScProvisioner=$defaultScProvisioner" - - cat <