probod-bootstrap could only resolve aws:// Secrets Manager refs. Add awsps:// for SSM Parameter Store (GetParameter with decryption) and awssm:// as an explicit Secrets Manager prefix. Keep aws:// for backward compatibility. Values are cached per run per backend. Update Helm, .env.example, and probod-bootstrap changelog. Signed-off-by: Ludovic Vielle <ludovic@probo.com>
4.0 KiB
4.0 KiB
Configuration Propagation
When a configuration field is added, renamed, or removed in the Go config structs, all downstream consumers must be updated in the same change. The config struct in pkg/probod/ is the source of truth.
Files to update (checklist)
| # | File | Role |
|---|---|---|
| 1 | pkg/probod/*.go |
Go config structs — source of truth |
| 2 | pkg/probod/probod.go New() |
Default values for new fields |
| 3 | pkg/bootstrap/builder.go |
Env-var → struct mapping (Build() method) |
| 4 | pkg/bootstrap/builder.go |
Required-env validation (validateRequired()) |
| 5 | GNUmakefile (dev-config target) |
Env vars fed to probod-bootstrap to regenerate cfg/dev.yaml (file itself is gitignored) |
| 6 | e2e/internal/testutil/testutil.go |
E2E env-var map fed to bootstrap.NewBuilder |
| 7 | contrib/lima/provision.sh |
Sandbox env vars passed to probod-bootstrap |
| 8 | contrib/helm/charts/probo/values.yaml |
Helm default values |
| 9 | contrib/helm/charts/probo/values-production.yaml.example |
Helm production template |
| 10 | contrib/helm/charts/probo/templates/deployment.yaml |
Helm deployment — maps values → env vars |
| 11 | contrib/helm/charts/probo/templates/secret.yaml |
Helm secret — sensitive values |
Flow
Go struct (pkg/probod/)
│
├─► probod New() defaults
│
├─► bootstrap builder.go (env var → struct)
│ │
│ ├─► Resolver (aws:// / awssm:// / awsps:// refs + plaintext env literals)
│ ├─► GNUmakefile dev-config (env vars → probod-bootstrap → cfg/dev.yaml)
│ ├─► e2e/internal/testutil/ (env map → bootstrap.Build, tests)
│ ├─► contrib/lima/provision.sh (env vars → probod-bootstrap)
│ └─► Helm chart
│ ├─ values.yaml (user-facing knobs)
│ ├─ values-production.yaml.example
│ ├─ templates/deployment.yaml (values → env vars)
│ └─ templates/secret.yaml (sensitive values)
│
└─► probod.go Run() (wiring into services)
Rules
- Never add a Go config field without updating every file in the checklist.
- Env var naming —
probod-bootstrapreads every input from the process environment with aPROBOD_prefix (e.g.PROBOD_AUTH_COOKIE_DOMAIN,PROBOD_CUSTOM_DOMAINS_RENEWAL_INTERVAL). Use the full name inbuilder.go, Helm templates, and docs. - Secrets go through
secret.yamland are referenced viasecretKeyRefindeployment.yaml. Non-secret values are set inline. make dev-configwritescfg/dev.yamlviaprobod-bootstrapwith safe, non-production defaults (plaintext passwords,localhost,secure: false). The generated file and the per-dev OAuth2 signing key (cfg/.dev-oauth2-signing-key.pem) are both gitignored. The recipe sources.envat the repo root if present so devs can override any env var without editing theGNUmakefile; keep.env.examplein sync when you add or rename env vars.e2e/internal/testutil/testutil.gobuilds the e2e config throughbootstrap.NewBuilderwith a test-only env-var map (different ports,probod_testDB, shorter intervals). Any new field whose test value differs from the bootstrap default must be added to that map.provision.shonly sets env vars that differ frombuilder.godefaults (e.g.PROBOD_BASE_URL,PROBOD_AUTH_COOKIE_DOMAIN,PROBOD_AUTH_COOKIE_SECURE). If the new field's default is acceptable in the sandbox, no env var is needed.- Helm
values.yamlexposes the field under the appropriateprobo.*key with a sensible default.values-production.yaml.exampleincludes it only when the production value differs or the user must set it. - Optional features (custom domains, SAML, connectors, tracing) are gated by
{{- if }}blocks in the Helm templates; follow the same pattern for new optional fields. - Bootstrap tests (
pkg/bootstrap/builder_test.go) must cover the new env var mapping.