Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(release): gate the chart appVersion against package.json
Yudhi Armyndharis07237a5102c1
diff --git a/docs/15-project-roadmap.md b/docs/15-project-roadmap.mdindex 793b9cce1..c722c9d67 100644--- a/docs/15-project-roadmap.md+++ b/docs/15-project-roadmap.md@@ -655,13 +655,18 @@ version bump lands as a single commit on `main`, and pushing the tag hands every### The release commit-Exactly four files change. Nothing else belongs in this commit.+Exactly five files change. Nothing else belongs in this commit.```bashnpm version --no-git-tag-version <version> # package.json + package-lock.jsonnpm run openapi:export # openapi.json info.version follows package.json```+Then bump `appVersion` in `charts/openwa/Chart.yaml` to the same version — the chart defaults its+image tag to `appVersion`, so a stale one deploys a tag that does not exist yet. Leave the chart's+own `version:` alone; it tracks packaging changes on its own cadence. `npm run check:versions`+fails if `appVersion` and `package.json` disagree.+Then in `CHANGELOG.md`, insert the new heading directly under the retained, now-empty`## [Unreleased]` — the accumulated entries fall under it by position:@@ -688,7 +693,7 @@ cd dashboard && npm run lint && npm run typecheck && npm run i18n:check && npm r``````bash-git add package.json package-lock.json openapi.json CHANGELOG.md+git add package.json package-lock.json openapi.json CHANGELOG.md charts/openwa/Chart.yamlgit commit -m "chore(release): v<version>"git tag -a v<version> -m "v<version>"git push origin main --follow-tagsdiff --git a/scripts/check-doc-versions.mjs b/scripts/check-doc-versions.mjsindex e6c9cb684..f3ca074b5 100644--- a/scripts/check-doc-versions.mjs+++ b/scripts/check-doc-versions.mjs@@ -19,6 +19,9 @@* current-support prose ("currently X.Y.x") and the supported-versions table row* ("| X.Y.x | :white_check_mark: |"), plus the lower-bound row ("< X.Y"). Derived from* package.json so a release cannot ship with a stale supported-version.+ * 6. charts/openwa/Chart.yaml `appVersion` must equal package.json — the chart defaults its image+ * tag to appVersion, so a stale one deploys a tag that does not exist yet. The chart's own+ * `version:` is intentionally left alone: it tracks packaging changes on its own cadence.** Run locally: `npm run check:versions`. Runs in CI (lint job).*/@@ -117,6 +120,21 @@ if (minorMatch) {}}+// 6) The Helm chart's appVersion must name the shipped application version. The chart's own+// `version:` is deliberately NOT checked — it tracks packaging changes and bumps on its own+// cadence, so tying it to package.json would be wrong.+{+ const chart = read('charts/openwa/Chart.yaml');+ const appVersion = chart.match(/^appVersion:\s*["']?([^"'\s]+)["']?\s*$/m)?.[1];+ if (!appVersion) {+ errors.push('charts/openwa/Chart.yaml: no appVersion line found — it must name the shipped application version.');+ } else if (appVersion !== version) {+ errors.push(+ `charts/openwa/Chart.yaml: appVersion is ${appVersion} but package.json is ${version} — the chart would deploy an image tag that does not exist yet.`,+ );+ }+}+if (errors.length) {console.error(`\n✖ Version consistency check failed (package.json = ${version}):`);for (const e of errors) console.error(` - ${e}`);