From a14693bcfdca94048ccf7a7e712d5c223ddb75d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Fri, 10 Apr 2026 16:05:48 +0200 Subject: [PATCH 1/9] feat(chart): centralize version support in Chart.yaml annotations --- .github/workflows/changelog.json | 2 +- .github/workflows/release.yaml | 14 +++- traefik/Chart.yaml | 4 + traefik/templates/NOTES.txt | 10 ++- traefik/templates/_helpers.tpl | 12 +++ traefik/templates/requirements.yaml | 18 ++++- traefik/tests/notes_test.yaml | 59 ++++++++++++++- traefik/tests/requirements-config_test.yaml | 81 ++++++++++++++++++++- 8 files changed, 184 insertions(+), 16 deletions(-) diff --git a/.github/workflows/changelog.json b/.github/workflows/changelog.json index 48d9a5e44..3bda1db42 100644 --- a/.github/workflows/changelog.json +++ b/.github/workflows/changelog.json @@ -1,5 +1,5 @@ { - "template": "## [#{{TO_TAG}}](#{{RELEASE_DIFF}}) (${DATE})\n#{{CHANGELOG}}", + "template": "## [#{{TO_TAG}}](#{{RELEASE_DIFF}}) (${DATE})\n#{{CHANGELOG}}${VERSION_SUPPORT}", "categories": [ { "title": "## :boom: BREAKING CHANGES", diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 66ae565e6..790904e07 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -72,7 +72,14 @@ jobs: env: REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))' run: | - export DATE=$(date +%F); cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json + export DATE=$(date +%F) + PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' traefik/Chart.yaml) + PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) + HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) + HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) + export VERSION_SUPPORT="\n\n## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" + cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json + cat /tmp/changelog.json if: steps.tag_exists.outputs.TAG_EXISTS == 'false' - name: Build Changelog @@ -209,7 +216,10 @@ jobs: env: REGEXP: '\\((CRDs|CRDs-.+)\\)' run: | - export DATE=$(date +%F); cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json + export DATE=$(date +%F) + export VERSION_SUPPORT="" + cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json + cat /tmp/changelog.json if: steps.tag_exists.outputs.TAG_EXISTS == 'false' - name: Build Changelog diff --git a/traefik/Chart.yaml b/traefik/Chart.yaml index b9a41221d..593a27e58 100644 --- a/traefik/Chart.yaml +++ b/traefik/Chart.yaml @@ -22,6 +22,10 @@ maintainers: - name: jnoordsij icon: https://raw.githubusercontent.com/traefik/traefik/master/docs/content/assets/img/traefik.logo.png annotations: + traefik.io/proxy-min-version: v3.6.0 + traefik.io/proxy-max-version: v3.7.0-rc.1 + traefik.io/hub-min-version: v3.19.3 + traefik.io/hub-max-version: v3.20.0-rc.1 artifacthub.io/changes: | - "feat: 🚀 upgrade traefik to v3.7.0-ea.3" - "chore(release): 🚀 publish v40.0.0-ea.3" diff --git a/traefik/templates/NOTES.txt b/traefik/templates/NOTES.txt index b71a25673..9354afb35 100644 --- a/traefik/templates/NOTES.txt +++ b/traefik/templates/NOTES.txt @@ -4,13 +4,15 @@ {{- printf "\n" -}} -{{/* Warn about experimental versions */}} +{{/* Warn about non-standard versions (experimental, or pre-release outside supported range) */}} {{- $imageTag := (.Values.image.tag | default .Chart.AppVersion) -}} -{{- if hasPrefix "experimental-" $imageTag -}} +{{- $version := include "traefik.proxyVersion" $ -}} +{{- $proxyMaxVersion := index .Chart.Annotations "traefik.io/proxy-max-version" -}} +{{- if or (hasPrefix "experimental-" $imageTag) (and (eq (include "traefik.isStableVersion" $version) "false") (semverCompare (printf ">%s-0" $proxyMaxVersion) $version)) -}} {{- printf "\n" -}} -⚠️ WARNING: You are using an experimental image tag ({{ $imageTag }}). Experimental versions can +⚠️ WARNING: You are using a non-standard image tag ({{ $imageTag }}). Non-standard versions can be unstable, may contain breaking changes, and are NOT recommended for production use. -This version is not supported by this chart. Use at your own risk. ⚠️ +This version is not officially supported by this chart. Use at your own risk. ⚠️ {{- printf "\n" -}} {{- end -}} diff --git a/traefik/templates/_helpers.tpl b/traefik/templates/_helpers.tpl index ac5984204..5e182164b 100644 --- a/traefik/templates/_helpers.tpl +++ b/traefik/templates/_helpers.tpl @@ -204,6 +204,18 @@ It requires a dict with "Version" and "Hub". {{- end -}} +{{/* +Returns "true" if the given version is a stable release (vX.Y.Z or X.Y.Z), "false" otherwise. +Non-standard versions include experimental, ea, rc, alpha, beta builds. +*/}} +{{- define "traefik.isStableVersion" -}} + {{- if regexMatch "^v?[0-9]+\\.[0-9]+\\.[0-9]+$" . -}} + true + {{- else -}} + false + {{- end -}} +{{- end -}} + {{/* The version can comes many sources: appVersion, image.tag, override, marketplace. */}} diff --git a/traefik/templates/requirements.yaml b/traefik/templates/requirements.yaml index 43e25f8c0..084d47305 100644 --- a/traefik/templates/requirements.yaml +++ b/traefik/templates/requirements.yaml @@ -1,7 +1,12 @@ {{- $version := include "traefik.proxyVersion" $ }} +{{- $proxyMinVersion := index .Chart.Annotations "traefik.io/proxy-min-version" }} +{{- $proxyMaxVersion := index .Chart.Annotations "traefik.io/proxy-max-version" }} {{- if (ne $version "experimental-v3.0") }} - {{- if (semverCompare "%s" $proxyMaxVersion) $version) }} + {{- fail (printf "ERROR: This version of the Chart only supports Traefik Proxy up to %s." $proxyMaxVersion) -}} {{- end }} {{- end }} @@ -118,8 +123,13 @@ {{ $hubVersion = "v3.99" }} {{- end }} - {{- if semverCompare "= v3.19.3."}} + {{- $hubMinVersion := index $.Chart.Annotations "traefik.io/hub-min-version" }} + {{- $hubMaxVersion := index $.Chart.Annotations "traefik.io/hub-max-version" }} + {{- if semverCompare (printf "<%s-0" $hubMinVersion) $hubVersion }} + {{ fail (printf "ERROR: this Chart supports *only* Traefik Hub >= %s." $hubMinVersion) }} + {{- end }} + {{- if and (eq (include "traefik.isStableVersion" $hubVersion) "true") (semverCompare (printf ">%s" $hubMaxVersion) $hubVersion) }} + {{ fail (printf "ERROR: this Chart only supports Traefik Hub up to %s." $hubMaxVersion) }} {{- end }} {{- if and (not $.Values.tracing.otlp.enabled) .Values.hub.tracing.additionalTraceHeaders.enabled }} diff --git a/traefik/tests/notes_test.yaml b/traefik/tests/notes_test.yaml index 62f280cf5..b864babbd 100644 --- a/traefik/tests/notes_test.yaml +++ b/traefik/tests/notes_test.yaml @@ -44,11 +44,26 @@ tests: RELEASE-NAME with docker.io/traefik:experimental-v3.6 has been deployed successfully on NAMESPACE namespace! - ⚠️ WARNING: You are using an experimental image tag (experimental-v3.6). Experimental versions can + ⚠️ WARNING: You are using a non-standard image tag (experimental-v3.6). Non-standard versions can be unstable, may contain breaking changes, and are NOT recommended for production use. - This version is not supported by this chart. Use at your own risk. ⚠️ + This version is not officially supported by this chart. Use at your own risk. ⚠️ - - it: should not display experimental warning when using a stable image tag + - it: should display warning when using an ea version just above max + set: + image: + tag: v3.8.0-ea.1 + asserts: + - equalRaw: + value: | + + + RELEASE-NAME with docker.io/traefik:v3.8.0-ea.1 has been deployed successfully on NAMESPACE namespace! + + ⚠️ WARNING: You are using a non-standard image tag (v3.8.0-ea.1). Non-standard versions can + be unstable, may contain breaking changes, and are NOT recommended for production use. + This version is not officially supported by this chart. Use at your own risk. ⚠️ + + - it: should not display warning when using a stable Proxy version within range set: image: tag: v3.6.8 @@ -58,6 +73,44 @@ tests: RELEASE-NAME with docker.io/traefik:v3.6.8 has been deployed successfully on NAMESPACE namespace! + - it: should not display warning when using an ea Proxy version within range + set: + image: + tag: v3.6.10-ea.1 + asserts: + - equalRaw: + value: | + + + RELEASE-NAME with docker.io/traefik:v3.6.10-ea.1 has been deployed successfully on NAMESPACE namespace! + - it: should not display warning when using a stable Hub version within range + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.19.5 + hub: + token: xxx + asserts: + - equalRaw: + value: | + + + RELEASE-NAME with ghcr.io/traefik/traefik-hub:v3.19.5 has been deployed successfully on NAMESPACE namespace! + - it: should not display warning when using an ea Hub version within range + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.19.5-ea.1 + hub: + token: xxx + asserts: + - equalRaw: + value: | + + + RELEASE-NAME with ghcr.io/traefik/traefik-hub:v3.19.5-ea.1 has been deployed successfully on NAMESPACE namespace! - it: should not display a warning when persistence and initContainer are enabled set: persistence: diff --git a/traefik/tests/requirements-config_test.yaml b/traefik/tests/requirements-config_test.yaml index 2e798de95..91a19de76 100644 --- a/traefik/tests/requirements-config_test.yaml +++ b/traefik/tests/requirements-config_test.yaml @@ -8,14 +8,14 @@ tests: tag: v2.11.0 asserts: - failedTemplate: - errorMessage: "ERROR: This version of the Chart only supports Traefik Proxy v3.6+" + errorMessage: "ERROR: This version of the Chart only supports Traefik Proxy v3.6.0+" - it: should fail when trying to use this Chart with Traefik Proxy v3.5 set: image: tag: v3.5.0 asserts: - failedTemplate: - errorMessage: "ERROR: This version of the Chart only supports Traefik Proxy v3.6+" + errorMessage: "ERROR: This version of the Chart only supports Traefik Proxy v3.6.0+" - it: should pass when trying to use this Chart with Traefik Proxy v3.6 experimental set: image: @@ -38,6 +38,31 @@ tests: asserts: - failedTemplate: errorMessage: "ERROR: version \"unknown\" is not supported" + - it: should fail when trying to use this Chart with a stable Proxy version above max + set: + image: + tag: v3.7.0 + asserts: + - failedTemplate: + errorMessage: "ERROR: This version of the Chart only supports Traefik Proxy up to v3.6.12." + - it: should not fail when trying to use this Chart with an ea Proxy version above max + set: + image: + tag: v3.7.0-ea.1 + asserts: + - notFailedTemplate: {} + - it: should not fail when trying to use this Chart with a Proxy version within range + set: + image: + tag: v3.6.10 + asserts: + - notFailedTemplate: {} + - it: should not fail when trying to use this Chart with an ea Proxy version within range + set: + image: + tag: v3.6.10-ea.1 + asserts: + - notFailedTemplate: {} - it: should fail when trying to use this Chart with Traefik Proxy v3 and Hub enabled set: hub: @@ -66,6 +91,58 @@ tests: token: xxx asserts: - notFailedTemplate: {} + - it: should fail when trying to use this Chart with a stable Hub version above max + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.21.0 + hub: + token: xxx + asserts: + - failedTemplate: + errorMessage: "ERROR: this Chart only supports Traefik Hub up to v3.20.0-ea.1." + - it: should not fail when trying to use this Chart with an ea Hub version above max + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.21.0-ea.1 + hub: + token: xxx + asserts: + - notFailedTemplate: {} + - it: should fail when trying to use this Chart with the stable release above ea max Hub version + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.20.0 + hub: + token: xxx + asserts: + - failedTemplate: + errorMessage: "ERROR: this Chart only supports Traefik Hub up to v3.20.0-ea.1." + - it: should not fail when trying to use this Chart with a Hub version within range + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.19.5 + hub: + token: xxx + asserts: + - notFailedTemplate: {} + - it: should not fail when trying to use this Chart with an ea Hub version within range + set: + image: + registry: ghcr.io + repository: traefik/traefik-hub + tag: v3.19.5-ea.1 + hub: + token: xxx + asserts: + - notFailedTemplate: {} - it: should pass when trying to use this Chart with Traefik API gateway v3 and Hub enabled and providing a token set: image: From 618632d84eea01f0b486a84799d5901957205434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Wed, 22 Apr 2026 12:23:17 +0200 Subject: [PATCH 2/9] fix(ci): render Traefik version support block in changelog tests --- .github/fixtures/changelog-traefik.md | 5 +++++ .github/workflows/changelog.json | 2 +- .github/workflows/test-changelog.yaml | 14 ++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/fixtures/changelog-traefik.md b/.github/fixtures/changelog-traefik.md index 69f853c66..b17f87cec 100644 --- a/.github/fixtures/changelog-traefik.md +++ b/.github/fixtures/changelog-traefik.md @@ -14,3 +14,8 @@ - chore(release): publish v34.2.0 #1323 by @darkweaver87 + +## 👌 Traefik version support + +* Traefik Proxy: v3.6.0 -> v3.6.12 (default) +* Traefik Hub: v3.19.0 -> v3.20.0-ea.1 diff --git a/.github/workflows/changelog.json b/.github/workflows/changelog.json index 3bda1db42..b467919c4 100644 --- a/.github/workflows/changelog.json +++ b/.github/workflows/changelog.json @@ -43,7 +43,7 @@ } ], "pr_template": "- ${{TITLE}} ##{{NUMBER}} by @#{{AUTHOR}}", - "max_pull_requests": 300, + "max_pull_requests": 500, "empty_template": "- no changes", "transformers": [ { diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index bb568326e..37ec248a3 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -20,7 +20,14 @@ jobs: env: REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))' run: | - export DATE=2025-01-28; cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json + export DATE=2025-01-28 + PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' traefik/Chart.yaml) + PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) + HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) + HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) + export VERSION_SUPPORT="\n\n## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" + cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json + cat /tmp/changelog.json - name: Build Changelog id: changelog @@ -56,7 +63,10 @@ jobs: env: REGEXP: '\\((CRDs|CRDs-.+)\\)' run: | - export DATE=2025-01-13; cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json; cat /tmp/changelog.json + export DATE=2025-01-13 + export VERSION_SUPPORT="" + cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json + cat /tmp/changelog.json - name: Build Changelog id: changelog From 68a1df0bc48936ff6e70525f260ef8a7ee2f743f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Wed, 22 Apr 2026 13:01:19 +0200 Subject: [PATCH 3/9] test: pin version-support annotations during test run --- .github/workflows/test-changelog.yaml | 7 +++++++ hack/test.sh | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index 37ec248a3..35f5fd032 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -20,6 +20,13 @@ jobs: env: REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))' run: | + # Pin version-support annotations so the fixture stays stable across releases. + sed -i \ + -e 's|traefik.io/proxy-min-version:.*|traefik.io/proxy-min-version: v3.6.0|' \ + -e 's|traefik.io/proxy-max-version:.*|traefik.io/proxy-max-version: v3.6.12|' \ + -e 's|traefik.io/hub-min-version:.*|traefik.io/hub-min-version: v3.19.0|' \ + -e 's|traefik.io/hub-max-version:.*|traefik.io/hub-max-version: v3.20.0-ea.1|' \ + traefik/Chart.yaml export DATE=2025-01-28 PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' traefik/Chart.yaml) PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) diff --git a/hack/test.sh b/hack/test.sh index e73380506..32a9b1e34 100644 --- a/hack/test.sh +++ b/hack/test.sh @@ -2,5 +2,19 @@ set -e -/usr/bin/helm unittest --color ./traefik +# Test against a copy of the traefik chart with pinned version-support +# annotations, so tests stay decoupled from the real supported ranges shipped +# with releases without ever touching the committed Chart.yaml. Copying to +# /tmp also avoids permission errors when the helm-unittest container user +# cannot write to the mounted workspace (e.g. in GitHub Actions). +rm -rf /tmp/traefik-test +cp -r traefik /tmp/traefik-test +sed -i \ + -e 's|traefik.io/proxy-min-version:.*|traefik.io/proxy-min-version: v3.6.0|' \ + -e 's|traefik.io/proxy-max-version:.*|traefik.io/proxy-max-version: v3.6.12|' \ + -e 's|traefik.io/hub-min-version:.*|traefik.io/hub-min-version: v3.19.3|' \ + -e 's|traefik.io/hub-max-version:.*|traefik.io/hub-max-version: v3.20.0-ea.1|' \ + /tmp/traefik-test/Chart.yaml + +/usr/bin/helm unittest --color /tmp/traefik-test /usr/bin/helm unittest --color ./traefik-crds From 2f35b2716ed802b75800e4df3831b63758715286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Wed, 22 Apr 2026 14:01:26 +0200 Subject: [PATCH 4/9] test(notes): drop redundant in-range no-warning cases --- traefik/tests/notes_test.yaml | 38 ----------------------------------- 1 file changed, 38 deletions(-) diff --git a/traefik/tests/notes_test.yaml b/traefik/tests/notes_test.yaml index b864babbd..08003cee6 100644 --- a/traefik/tests/notes_test.yaml +++ b/traefik/tests/notes_test.yaml @@ -73,44 +73,6 @@ tests: RELEASE-NAME with docker.io/traefik:v3.6.8 has been deployed successfully on NAMESPACE namespace! - - it: should not display warning when using an ea Proxy version within range - set: - image: - tag: v3.6.10-ea.1 - asserts: - - equalRaw: - value: | - - - RELEASE-NAME with docker.io/traefik:v3.6.10-ea.1 has been deployed successfully on NAMESPACE namespace! - - it: should not display warning when using a stable Hub version within range - set: - image: - registry: ghcr.io - repository: traefik/traefik-hub - tag: v3.19.5 - hub: - token: xxx - asserts: - - equalRaw: - value: | - - - RELEASE-NAME with ghcr.io/traefik/traefik-hub:v3.19.5 has been deployed successfully on NAMESPACE namespace! - - it: should not display warning when using an ea Hub version within range - set: - image: - registry: ghcr.io - repository: traefik/traefik-hub - tag: v3.19.5-ea.1 - hub: - token: xxx - asserts: - - equalRaw: - value: | - - - RELEASE-NAME with ghcr.io/traefik/traefik-hub:v3.19.5-ea.1 has been deployed successfully on NAMESPACE namespace! - it: should not display a warning when persistence and initContainer are enabled set: persistence: From b6368bc87cb6f942117ea7b2d821f471accbc97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Wed, 22 Apr 2026 17:04:44 +0200 Subject: [PATCH 5/9] fix(ci): drop leading newlines in VERSION_SUPPORT to avoid extra blank lines --- .github/fixtures/changelog-traefik.md | 2 -- .github/workflows/release.yaml | 2 +- .github/workflows/test-changelog.yaml | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/fixtures/changelog-traefik.md b/.github/fixtures/changelog-traefik.md index b17f87cec..f50869c1a 100644 --- a/.github/fixtures/changelog-traefik.md +++ b/.github/fixtures/changelog-traefik.md @@ -13,8 +13,6 @@ - docs: 📚️ fix typo in Guidelines.md #1320 by @lbarnkow - chore(release): publish v34.2.0 #1323 by @darkweaver87 - - ## 👌 Traefik version support * Traefik Proxy: v3.6.0 -> v3.6.12 (default) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 790904e07..3e05a6248 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -77,7 +77,7 @@ jobs: PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) - export VERSION_SUPPORT="\n\n## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" + export VERSION_SUPPORT="## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json cat /tmp/changelog.json if: steps.tag_exists.outputs.TAG_EXISTS == 'false' diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index 35f5fd032..4ada57f7c 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -32,7 +32,7 @@ jobs: PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) - export VERSION_SUPPORT="\n\n## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" + export VERSION_SUPPORT="## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json cat /tmp/changelog.json From 32ff620f7eb7fc87310896c5957160e049021af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Thu, 23 Apr 2026 07:58:31 +0200 Subject: [PATCH 6/9] fix: review --- .github/workflows/release.yaml | 16 ++-------- .github/workflows/test-changelog.yaml | 17 +++------- hack/render-changelog-config.sh | 45 +++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 27 deletions(-) create mode 100755 hack/render-changelog-config.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3e05a6248..06dcac00f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -71,15 +71,7 @@ jobs: - name: Render changelog configuration env: REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))' - run: | - export DATE=$(date +%F) - PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' traefik/Chart.yaml) - PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) - HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) - HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) - export VERSION_SUPPORT="## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" - cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json - cat /tmp/changelog.json + run: ./hack/render-changelog-config.sh traefik if: steps.tag_exists.outputs.TAG_EXISTS == 'false' - name: Build Changelog @@ -215,11 +207,7 @@ jobs: - name: Render changelog configuration env: REGEXP: '\\((CRDs|CRDs-.+)\\)' - run: | - export DATE=$(date +%F) - export VERSION_SUPPORT="" - cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json - cat /tmp/changelog.json + run: ./hack/render-changelog-config.sh traefik-crds if: steps.tag_exists.outputs.TAG_EXISTS == 'false' - name: Build Changelog diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index 4ada57f7c..67005326a 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -19,6 +19,7 @@ jobs: - name: Render traefik changelog configuration env: REGEXP: '(\\(.+\\)|(?!\\(CRDs-.+\\)))' + DATE: '2025-01-28' run: | # Pin version-support annotations so the fixture stays stable across releases. sed -i \ @@ -27,14 +28,7 @@ jobs: -e 's|traefik.io/hub-min-version:.*|traefik.io/hub-min-version: v3.19.0|' \ -e 's|traefik.io/hub-max-version:.*|traefik.io/hub-max-version: v3.20.0-ea.1|' \ traefik/Chart.yaml - export DATE=2025-01-28 - PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' traefik/Chart.yaml) - PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' traefik/Chart.yaml) - HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' traefik/Chart.yaml) - HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' traefik/Chart.yaml) - export VERSION_SUPPORT="## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" - cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json - cat /tmp/changelog.json + ./hack/render-changelog-config.sh traefik - name: Build Changelog id: changelog @@ -69,11 +63,8 @@ jobs: - name: Render traefik changelog configuration env: REGEXP: '\\((CRDs|CRDs-.+)\\)' - run: | - export DATE=2025-01-13 - export VERSION_SUPPORT="" - cat .github/workflows/changelog.json | envsubst > /tmp/changelog.json - cat /tmp/changelog.json + DATE: '2025-01-13' + run: ./hack/render-changelog-config.sh traefik-crds - name: Build Changelog id: changelog diff --git a/hack/render-changelog-config.sh b/hack/render-changelog-config.sh new file mode 100755 index 000000000..4a13a2645 --- /dev/null +++ b/hack/render-changelog-config.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Render the changelog-builder configuration for a given chart. +# +# Usage: hack/render-changelog-config.sh +# Env: +# REGEXP required — category matcher injected into the JSON template +# DATE optional — defaults to today (YYYY-MM-DD) +# OUTPUT optional — defaults to /tmp/changelog.json +# +# If /Chart.yaml declares traefik.io/{proxy,hub}-{min,max}-version +# annotations, a "Traefik version support" block is appended to the release +# notes; otherwise VERSION_SUPPORT is left empty (used by the CRDs chart). + +set -eu + +if [ $# -lt 1 ]; then + echo "usage: $0 " >&2 + exit 1 +fi +if [ -z "${REGEXP:-}" ]; then + echo "REGEXP must be set" >&2 + exit 1 +fi + +CHART_DIR="$1" +CHART_YAML="${CHART_DIR}/Chart.yaml" +OUTPUT="${OUTPUT:-/tmp/changelog.json}" +DATE="${DATE:-$(date +%F)}" +export DATE REGEXP + +PROXY_MIN=$(awk '/traefik.io\/proxy-min-version:/{print $2}' "${CHART_YAML}") +PROXY_MAX=$(awk '/traefik.io\/proxy-max-version:/{print $2}' "${CHART_YAML}") +HUB_MIN=$(awk '/traefik.io\/hub-min-version:/{print $2}' "${CHART_YAML}") +HUB_MAX=$(awk '/traefik.io\/hub-max-version:/{print $2}' "${CHART_YAML}") + +if [ -n "${PROXY_MIN}" ] && [ -n "${PROXY_MAX}" ] && [ -n "${HUB_MIN}" ] && [ -n "${HUB_MAX}" ]; then + VERSION_SUPPORT="## 👌 Traefik version support\n\n* Traefik Proxy: ${PROXY_MIN} -> ${PROXY_MAX} (default)\n* Traefik Hub: ${HUB_MIN} -> ${HUB_MAX}" +else + VERSION_SUPPORT="" +fi +export VERSION_SUPPORT + +envsubst <.github/workflows/changelog.json >"${OUTPUT}" +cat "${OUTPUT}" From 08d49ee66275204cc6ba306518ffda1b91f5b343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Thu, 23 Apr 2026 08:44:24 +0200 Subject: [PATCH 7/9] fix(ci): fetch changelog PRs via commits in tests --- .github/workflows/changelog.json | 2 +- .github/workflows/test-changelog.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/changelog.json b/.github/workflows/changelog.json index b467919c4..3bda1db42 100644 --- a/.github/workflows/changelog.json +++ b/.github/workflows/changelog.json @@ -43,7 +43,7 @@ } ], "pr_template": "- ${{TITLE}} ##{{NUMBER}} by @#{{AUTHOR}}", - "max_pull_requests": 500, + "max_pull_requests": 300, "empty_template": "- no changes", "transformers": [ { diff --git a/.github/workflows/test-changelog.yaml b/.github/workflows/test-changelog.yaml index 67005326a..74d082c46 100644 --- a/.github/workflows/test-changelog.yaml +++ b/.github/workflows/test-changelog.yaml @@ -37,6 +37,7 @@ jobs: fromTag: v34.1.0 toTag: v34.2.0 configuration: "/tmp/changelog.json" + fetchViaCommits: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -73,6 +74,7 @@ jobs: fromTag: crds_v1.0.0 toTag: crds_v1.1.0 configuration: "/tmp/changelog.json" + fetchViaCommits: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0fcd9c8a128978ca424a4f00ebfdce2b1e835ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Thu, 23 Apr 2026 10:41:09 +0200 Subject: [PATCH 8/9] refactor(test): run helm-unittest as a native plugin --- .github/renovate.json5 | 12 ++++++++++++ .github/workflows/test.yaml | 12 ++++++++++++ Makefile | 4 +--- hack/test.sh | 28 ++++++++++++++++++---------- 4 files changed, 43 insertions(+), 13 deletions(-) mode change 100644 => 100755 hack/test.sh diff --git a/.github/renovate.json5 b/.github/renovate.json5 index c83979519..341409a45 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -38,6 +38,10 @@ matchPackageNames: ['bpsoraggi/helm-gh-pages'], enabled: false, }, + { + matchPackageNames: ['helm-unittest/helm-unittest'], + extractVersion: '^v(?.+)$', + }, ], customManagers: [ { @@ -66,5 +70,13 @@ '\\(https:\\/\\/img\\.shields\\.io\\/badge\\/AppVersion-(?[\\w+\\.\\-]*)-informational.+\\)', ], }, + { + customType: 'regex', + managerFilePatterns: ['\\.github/workflows/.+\\.yaml$'], + matchStrings: [ + '# renovate: datasource=(?[^\\s]+) depName=(?[^\\s]+)( versioning=(?[^\\s]+?))?\\s+.*(VERSION|version|rev): ["\']?(?[^"\'\\s]+)', + ], + versioningTemplate: '{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}', + }, ], } diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b1df05c34..0e3f7c64c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,6 +39,18 @@ jobs: - name: Lint Chart run: make lint + - name: Install Helm + uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0 + with: + # renovate: datasource=github-releases depName=helm/helm + version: v3.19.0 + + - name: Install helm-unittest plugin + env: + # renovate: datasource=github-releases depName=helm-unittest/helm-unittest + HELM_UNITTEST_VERSION: 1.0.1 + run: helm plugin install https://github.com/helm-unittest/helm-unittest --version "$HELM_UNITTEST_VERSION" + - name: Test Chart run: make test diff --git a/Makefile b/Makefile index 1c00bb6c2..366683c57 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,13 @@ IMAGE_CHART_TESTING=quay.io/helmpack/chart-testing:v3.14.0 IMAGE_HELM_CHANGELOG=ghcr.io/traefik/helm-changelog:v1.0.0 IMAGE_HELM_DOCS=jnorwood/helm-docs:v1.14.2 -IMAGE_HELM_UNITTEST=docker.io/helmunittest/helm-unittest:3.19.0-1.0.1 traefik/tests/__snapshot__: @mkdir traefik/tests/__snapshot__ @mkdir traefik-crds/tests/__snapshot__ test: traefik/tests/__snapshot__ - docker run ${DOCKER_ARGS} --entrypoint /bin/sh --rm -v $(CURDIR):/charts -w /charts $(IMAGE_HELM_UNITTEST) /charts/hack/test.sh + ./hack/test.sh test-ns: ./hack/check-ns.sh @@ -25,7 +24,6 @@ docs: docker run --rm -v "$(CURDIR):/helm-docs" $(IMAGE_HELM_DOCS) -o VALUES.md # To launch only one test -# $ helm plugin install https://github.com/helm-unittest/helm-unittest # $ helm unittest -f 'tests/oci-config_test.yaml' traefik test-%: docker run ${DOCKER_ARGS} --network=host --env GIT_SAFE_DIR="true" --entrypoint /bin/sh --rm -v $(CURDIR):/charts -v $(HOME)/.kube:/root/.kube -w /charts $(IMAGE_CHART_TESTING) /charts/hack/ct.sh $* diff --git a/hack/test.sh b/hack/test.sh old mode 100644 new mode 100755 index 32a9b1e34..c746c928c --- a/hack/test.sh +++ b/hack/test.sh @@ -2,19 +2,27 @@ set -e -# Test against a copy of the traefik chart with pinned version-support -# annotations, so tests stay decoupled from the real supported ranges shipped -# with releases without ever touching the committed Chart.yaml. Copying to -# /tmp also avoids permission errors when the helm-unittest container user -# cannot write to the mounted workspace (e.g. in GitHub Actions). -rm -rf /tmp/traefik-test -cp -r traefik /tmp/traefik-test +if ! command -v helm >/dev/null 2>&1; then + echo "Error: helm is not installed. See https://helm.sh/docs/intro/install/" >&2 + exit 1 +fi + +if ! helm plugin list 2>/dev/null | awk 'NR>1 && $1=="unittest"{found=1} END{exit !found}'; then + echo "Error: helm-unittest plugin is not installed." >&2 + echo "Install: helm plugin install https://github.com/helm-unittest/helm-unittest --version 1.0.1" >&2 + exit 1 +fi + +# Pin version-support annotations so tests stay decoupled from the real +# supported ranges shipped with releases. Restore on exit. +cp traefik/Chart.yaml /tmp/traefik-Chart.yaml.bak +trap 'mv /tmp/traefik-Chart.yaml.bak traefik/Chart.yaml' EXIT sed -i \ -e 's|traefik.io/proxy-min-version:.*|traefik.io/proxy-min-version: v3.6.0|' \ -e 's|traefik.io/proxy-max-version:.*|traefik.io/proxy-max-version: v3.6.12|' \ -e 's|traefik.io/hub-min-version:.*|traefik.io/hub-min-version: v3.19.3|' \ -e 's|traefik.io/hub-max-version:.*|traefik.io/hub-max-version: v3.20.0-ea.1|' \ - /tmp/traefik-test/Chart.yaml + traefik/Chart.yaml -/usr/bin/helm unittest --color /tmp/traefik-test -/usr/bin/helm unittest --color ./traefik-crds +helm unittest --color ./traefik +helm unittest --color ./traefik-crds From 77f8e45199a75805f7d797a88d06aa467930d00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUISSON?= Date: Thu, 23 Apr 2026 10:42:55 +0200 Subject: [PATCH 9/9] fix: apply mloiseleur suggestions Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com> --- .github/fixtures/changelog-traefik-crds.md | 3 ++- .github/fixtures/changelog-traefik.md | 3 ++- .github/workflows/changelog.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/fixtures/changelog-traefik-crds.md b/.github/fixtures/changelog-traefik-crds.md index 5e2c94e8b..8f2335947 100644 --- a/.github/fixtures/changelog-traefik-crds.md +++ b/.github/fixtures/changelog-traefik-crds.md @@ -1,4 +1,5 @@ -## [crds_v1.1.0](https://github.com/traefik/traefik-helm-chart/compare/crds_v1.0.0...crds_v1.1.0) (2025-01-13) +# [crds_v1.1.0](https://github.com/traefik/traefik-helm-chart/compare/crds_v1.0.0...crds_v1.1.0) (2025-01-13) + ## :rocket: Features - feat(CRDs): update CRDs for Traefik Proxy v3.3.x #1303 by @mloiseleur diff --git a/.github/fixtures/changelog-traefik.md b/.github/fixtures/changelog-traefik.md index f50869c1a..ef8458e65 100644 --- a/.github/fixtures/changelog-traefik.md +++ b/.github/fixtures/changelog-traefik.md @@ -1,4 +1,5 @@ -## [v34.2.0](https://github.com/traefik/traefik-helm-chart/compare/v34.1.0...v34.2.0) (2025-01-28) +# [v34.2.0](https://github.com/traefik/traefik-helm-chart/compare/v34.1.0...v34.2.0) (2025-01-28) + ## :rocket: Features - feat: :sparkles: add hub tracing capabilities #1322 by @darkweaver87 diff --git a/.github/workflows/changelog.json b/.github/workflows/changelog.json index 3bda1db42..aa89561d2 100644 --- a/.github/workflows/changelog.json +++ b/.github/workflows/changelog.json @@ -1,5 +1,5 @@ { - "template": "## [#{{TO_TAG}}](#{{RELEASE_DIFF}}) (${DATE})\n#{{CHANGELOG}}${VERSION_SUPPORT}", + "template": "# [#{{TO_TAG}}](#{{RELEASE_DIFF}}) (${DATE})\n\n#{{CHANGELOG}}${VERSION_SUPPORT}", "categories": [ { "title": "## :boom: BREAKING CHANGES",