From ec07086e179fb64726ad2c3e2a181e090065d0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Fr=C3=B6mbgen?= <23717573+mfroembgen@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:47:30 +0200 Subject: [PATCH 1/3] fix: align otel collector image tag --- .changeset/align-otel-collector-tag.md | 5 +++++ .github/workflows/update-app-version.yml | 7 ++++++- charts/clickstack/values.yaml | 3 +-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/align-otel-collector-tag.md diff --git a/.changeset/align-otel-collector-tag.md b/.changeset/align-otel-collector-tag.md new file mode 100644 index 0000000..6509c78 --- /dev/null +++ b/.changeset/align-otel-collector-tag.md @@ -0,0 +1,5 @@ +--- +"helm-charts": patch +--- + +fix: align otel-collector image tag with chart appVersion diff --git a/.github/workflows/update-app-version.yml b/.github/workflows/update-app-version.yml index f93994f..591e077 100644 --- a/.github/workflows/update-app-version.yml +++ b/.github/workflows/update-app-version.yml @@ -25,6 +25,10 @@ jobs: run: | sed -i "s/^appVersion: .*/appVersion: ${{ github.event.inputs.tag }}/" charts/clickstack/Chart.yaml + - name: Update otel-collector image tag in values.yaml + run: | + sed -i '/clickstack-otel-collector/{n;s/tag: "[^"]*"/tag: "${{ github.event.inputs.tag }}"/}' charts/clickstack/values.yaml + - name: Create changeset run: | mkdir -p .changeset @@ -43,8 +47,9 @@ jobs: commit-message: "chore: Update appVersion to ${{ github.event.inputs.tag }}" title: "Update appVersion to ${{ github.event.inputs.tag }}" body: | - This PR updates the appVersion in Chart.yaml to `${{ github.event.inputs.tag }}`. + This PR updates the appVersion in Chart.yaml to `${{ github.event.inputs.tag }}` and aligns the otel-collector image tag in values.yaml. - Updated `charts/clickstack/Chart.yaml` + - Updated `otel-collector.image.tag` in `charts/clickstack/values.yaml` branch: update-app-version-${{ github.event.inputs.tag }} delete-branch: true diff --git a/charts/clickstack/values.yaml b/charts/clickstack/values.yaml index 4b68915..edd375c 100644 --- a/charts/clickstack/values.yaml +++ b/charts/clickstack/values.yaml @@ -371,7 +371,7 @@ otel-collector: mode: deployment image: repository: docker.clickhouse.com/clickhouse/clickstack-otel-collector - tag: "2.19.0" + tag: "2.28.0" extraEnvsFrom: - configMapRef: name: clickstack-config @@ -412,4 +412,3 @@ otel-collector: enabled: false zipkin: enabled: false - From 223a1ccb12ff1a32783cbd3c238804a96a5880af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Fr=C3=B6mbgen?= <23717573+mfroembgen@users.noreply.github.com> Date: Mon, 29 Jun 2026 11:05:00 +0200 Subject: [PATCH 2/3] test: guard collector image version drift --- .github/workflows/helm-test.yaml | 23 +++++++++++++++++++++++ .github/workflows/update-app-version.yml | 18 ++++++++++++++++-- AGENTS.md | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index c848801..d0fa0d8 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -37,6 +37,29 @@ jobs: helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm dependency build charts/clickstack + - name: Validate appVersion matches collector image tag + run: | + set -euo pipefail + APP_VERSION=$(awk '$1 == "appVersion:" { print $2 }' charts/clickstack/Chart.yaml) + COLLECTOR_TAG=$(awk ' + $1 == "repository:" && $2 == "docker.clickhouse.com/clickhouse/clickstack-otel-collector" { in_image = 1; next } + in_image && $1 == "tag:" { + gsub(/"/, "", $2) + print $2 + exit + } + ' charts/clickstack/values.yaml) + + if [ -z "$APP_VERSION" ] || [ -z "$COLLECTOR_TAG" ]; then + echo "Could not read appVersion or otel-collector image tag" + exit 1 + fi + + if [ "$APP_VERSION" != "$COLLECTOR_TAG" ]; then + echo "appVersion ($APP_VERSION) does not match otel-collector.image.tag ($COLLECTOR_TAG)" + exit 1 + fi + - name: Validate example values render run: | helm template clickstack-example charts/clickstack \ diff --git a/.github/workflows/update-app-version.yml b/.github/workflows/update-app-version.yml index 591e077..6b3333a 100644 --- a/.github/workflows/update-app-version.yml +++ b/.github/workflows/update-app-version.yml @@ -22,12 +22,26 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Update appVersion in Chart.yaml + env: + TAG: ${{ github.event.inputs.tag }} run: | - sed -i "s/^appVersion: .*/appVersion: ${{ github.event.inputs.tag }}/" charts/clickstack/Chart.yaml + set -euo pipefail + sed -i "s/^appVersion: .*/appVersion: $TAG/" charts/clickstack/Chart.yaml - name: Update otel-collector image tag in values.yaml + env: + TAG: ${{ github.event.inputs.tag }} run: | - sed -i '/clickstack-otel-collector/{n;s/tag: "[^"]*"/tag: "${{ github.event.inputs.tag }}"/}' charts/clickstack/values.yaml + set -euo pipefail + sed -i '/clickstack-otel-collector/{n;s/tag: "[^"]*"/tag: "'"$TAG"'"/}' charts/clickstack/values.yaml + awk -v tag="$TAG" ' + /repository: docker\.clickhouse\.com\/clickhouse\/clickstack-otel-collector/ { in_image = 1; next } + in_image && /^[[:space:]]*tag:/ { + if ($0 ~ "tag: \"" tag "\"") found = 1 + in_image = 0 + } + END { exit found ? 0 : 1 } + ' charts/clickstack/values.yaml - name: Create changeset run: | diff --git a/AGENTS.md b/AGENTS.md index 707a139..ce203ae 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -153,7 +153,7 @@ tests: | Helm Chart Tests | `helm-test.yaml` | push/PR to main | Unit tests + example validation | | Integration Test | `chart-test.yml` | push/PR/nightly | Kind-based integration suites | | Release | `release.yml` | after tests pass on main | Changeset version + chart release | -| Update App Version | `update-app-version.yml` | workflow_dispatch | Bump `appVersion` in Chart.yaml | +| Update App Version | `update-app-version.yml` | workflow_dispatch | Bump `appVersion` in Chart.yaml and align `otel-collector.image.tag` in values.yaml | ## Key File Locations From a9bc79cee058602332dffcf5e9b22c9a7968c7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Fr=C3=B6mbgen?= <23717573+mfroembgen@users.noreply.github.com> Date: Mon, 29 Jun 2026 11:12:48 +0200 Subject: [PATCH 3/3] ci: harden collector tag version checks --- .github/workflows/helm-test.yaml | 3 +++ .github/workflows/update-app-version.yml | 28 ++++++++++++++++++++++-- AGENTS.md | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-test.yaml b/.github/workflows/helm-test.yaml index d0fa0d8..eb7b1c9 100644 --- a/.github/workflows/helm-test.yaml +++ b/.github/workflows/helm-test.yaml @@ -60,6 +60,9 @@ jobs: exit 1 fi + EXPECTED_COLLECTOR_IMAGE="image: \"docker.clickhouse.com/clickhouse/clickstack-otel-collector:${APP_VERSION}\"" + helm template clickstack-version-check charts/clickstack | grep -F "$EXPECTED_COLLECTOR_IMAGE" + - name: Validate example values render run: | helm template clickstack-example charts/clickstack \ diff --git a/.github/workflows/update-app-version.yml b/.github/workflows/update-app-version.yml index 6b3333a..927f782 100644 --- a/.github/workflows/update-app-version.yml +++ b/.github/workflows/update-app-version.yml @@ -26,14 +26,38 @@ jobs: TAG: ${{ github.event.inputs.tag }} run: | set -euo pipefail - sed -i "s/^appVersion: .*/appVersion: $TAG/" charts/clickstack/Chart.yaml + tmp=$(mktemp) + awk -v tag="$TAG" ' + /^appVersion:/ { $0 = "appVersion: " tag; updated = 1 } + { print } + END { exit updated ? 0 : 1 } + ' charts/clickstack/Chart.yaml > "$tmp" + mv "$tmp" charts/clickstack/Chart.yaml - name: Update otel-collector image tag in values.yaml env: TAG: ${{ github.event.inputs.tag }} run: | set -euo pipefail - sed -i '/clickstack-otel-collector/{n;s/tag: "[^"]*"/tag: "'"$TAG"'"/}' charts/clickstack/values.yaml + tmp=$(mktemp) + awk -v tag="$TAG" ' + /repository: docker\.clickhouse\.com\/clickhouse\/clickstack-otel-collector[[:space:]]*$/ { + in_collector_image = 1 + print + next + } + in_collector_image && /^[[:space:]]{0,2}[[:alnum:]_-]+:/ { + in_collector_image = 0 + } + in_collector_image && /^[[:space:]]*tag:/ { + sub(/tag: .*/, "tag: \"" tag "\"") + updated = 1 + in_collector_image = 0 + } + { print } + END { exit updated ? 0 : 1 } + ' charts/clickstack/values.yaml > "$tmp" + mv "$tmp" charts/clickstack/values.yaml awk -v tag="$TAG" ' /repository: docker\.clickhouse\.com\/clickhouse\/clickstack-otel-collector/ { in_image = 1; next } in_image && /^[[:space:]]*tag:/ { diff --git a/AGENTS.md b/AGENTS.md index ce203ae..a452035 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -163,5 +163,5 @@ tests: - Unit tests: `charts/clickstack/tests/*_test.yaml` - Integration suites: `integration-tests/*/` - Example values: `examples/*/values.yaml` -- Version sync script: `scripts/update-chart-versions.js` +- Chart version sync script: `scripts/update-chart-versions.js` - Smoke test: `scripts/smoke-test.sh`