Skip to content

feat: deprecate module-specific settings, expose them on module CRDs#473

Draft
gfyrag wants to merge 2 commits into
mainfrom
feat/deprecate-module-specific-settings
Draft

feat: deprecate module-specific settings, expose them on module CRDs#473
gfyrag wants to merge 2 commits into
mainfrom
feat/deprecate-module-specific-settings

Conversation

@gfyrag
Copy link
Copy Markdown
Contributor

@gfyrag gfyrag commented Jun 2, 2026

Summary

The Settings system historically mixed cross-cutting concerns (postgres, broker, temporal, otel, …) with module-specific tuning knobs (ledger experimental flags, payments worker temporal tunings, gateway/caddyfile/ingress/DNS, …). This PR keeps Settings for cross-cutting only and exposes ~36 module-specific keys as typed fields on the corresponding module CRD specs, with a dual-read fallback that prefers the spec value and logs a deprecation warning when the legacy Settings path resolves a value.

No setting is removed yet — this is the additive half of the deprecation. Hard removal is intentionally deferred to a future major.

Changes

  • New internal/resources/settings/dual_read.goPreferSpecBool/Int/String/StringSlice/Duration/Map helpers (and *OrDefault variants) + LogDeprecation.
  • Module CRD specs extended:
    • Ledger — 11 fields incl. Spec.API.*, Spec.Worker.{AsyncBlockHasher,BucketCleanup,Pipelines}, experimental flags, SchemaEnforcementMode
    • PaymentsSpec.Worker.* temporal tunings, Spec.ClearTemporal
    • OrchestrationSpec.MaxParallelActivities
    • TransactionPlaneSpec.WorkerEnabled
    • AuthSpec.Issuers, shared AuthConfig.Issuers for downstream modules
    • GatewaySpec.Caddyfile, Spec.Config, Spec.DNS[], Spec.Ingress.Labels
  • Reconcilers updated to read spec first then fallback Settings + emit DEPRECATION: log
  • CRD YAMLs and zz_generated.deepcopy.go regenerated via controller-gen
  • Bug fix bonus: payments/deployments.go:getEncryptionKey was returning "" when Spec.EncryptionKey was set — now correctly propagates the value

Test plan

  • go build ./... clean
  • go vet ./... clean
  • go test -short ./internal/resources/settings/... passes
  • CI envtest suite
  • Chainsaw e2e (existing scenarios using Settings keys should keep working with a deprecation log; follow-up PR to add a scenario exercising the new Spec path)
  • Manual smoke: apply a Ledger CR with spec.experimentalFeatures: true → confirm EXPERIMENTAL_FEATURES=true in the pod env; then drop the spec and add a matching Settings → same env + DEPRECATION log on the operator

🤖 Generated with Claude Code

Cross-cutting Settings (postgres, broker, temporal, otel, etc.) remain;
module-specific tuning knobs now live on the corresponding module Spec
with a dual-read fallback that logs a deprecation warning when the
legacy Settings path is still in use.

- New settings.PreferSpec* helpers + LogDeprecation in dual_read.go
- Ledger: experimental flags, api.*, schema-enforcement-mode, worker.*
- Payments: encryption-key (also fixes a bug where Spec value was dropped),
  clear-temporal, worker.temporal-* tunings
- Orchestration: max-parallel-activities
- TransactionPlane: worker-enabled
- Auth: stack-level issuers (Auth.Spec.Issuers and per-module
  AuthConfig.Issuers); check-scopes setting now logs deprecation
- Gateway: caddyfile.*, config.idle-timeout, ingress.labels,
  ingress.tls.enabled, ingress.hosts, dns.<type>.* via Spec.DNS list

CRDs regenerated via controller-gen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2aa1cb96-2df8-4d48-8e64-37c584cca314

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/deprecate-module-specific-settings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…elm CRDs

withAnnotations and withLabels must still merge settings ∪ spec
(spec wins on key collision), not short-circuit to spec when present;
the previous refactor broke the existing GatewayController test by
dropping settings-sourced entries when the spec had any annotations.

Also regenerate the helm/crds/* copies and the
docs/09-Configuration reference/* artifacts that derive from the
v1beta1 types via crd-ref-docs and the settings-catalog tool.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant