Skip to content

Show the resilience settings in appsettings.json, Compose/.env and the ConfigMap - #82

Merged
NullButCute merged 1 commit into
mainfrom
claude/confident-knuth-abb7sr
Oct 15, 2026
Merged

NullButCute merged 1 commit into
mainfrom
claude/confident-knuth-abb7sr

Conversation

@NullButCute

Copy link
Copy Markdown
Owner

Why

The Resilience:Postgres and Resilience:Consumers settings from #80 only existed as defaults inside the code, so nobody could see or change them without reading the source. This writes them out where an operator looks. Behaviour does not change: the values are the code's defaults.

What

  • appsettings.json of every service: Resilience:Postgres in Identity, Product, Order, Inventory and Payment. Resilience:Consumers in Order, Inventory and Payment, which consume messages.
  • docker-compose.yml: the same keys as environment variables through two YAML anchors (x-resilience-postgres, x-resilience-consumers) merged into the services that use them. Each is ${RESILIENCE_…:-default}. The gateway has no database or consumers and gets none.
  • .env.example: every RESILIENCE_* variable, commented out, with its default. To override one, uncomment it in .env.
  • Kubernetes shopeasy-config ConfigMap: the same keys. Changing one needs a kubectl rollout restart because environment variables are read at pod start.
  • README: new "Where the Resilience Settings Live" section (where each copy is and how to change it), plus the precedence: environment variable, then appsettings.json, then the code default. Test counts updated.

Keeping the copies honest

ResilienceConfigurationTests (15 tests, no servers needed) fails when any appsettings.json, the Compose file, the ConfigMap or .env.example differs from the code's defaults. It also fails when a service that should get the settings does not. One test reads the real Order appsettings.json and checks that an override wins. I confirmed they catch drift by changing a value in three of the files.

Verified

  • docker compose config renders the defaults, and an override from .env reaches the five right services (and not the gateway).
  • kustomize build + kubeconform -strict and the repo's deployment rules pass.
  • Whole suite green: 280 tests (234 without servers, 46 with PostgreSQL and RabbitMQ).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vuhzoey6h5V9wPPVFuR7ME


Generated by Claude Code

…e ConfigMap

The Resilience:Postgres and Resilience:Consumers settings added in #80 only
existed as defaults inside the code, so nobody could see or change them without
reading the source. They are now written out where an operator looks:

* Every service's appsettings.json has the Resilience:Postgres section
  (Identity, Product, Order, Inventory, Payment); Order, Inventory and Payment,
  which consume messages, also have Resilience:Consumers. The values are the
  code's defaults, so behaviour does not change.
* docker-compose.yml passes the same keys as environment variables through two
  YAML anchors (x-resilience-postgres, x-resilience-consumers) merged into the
  services that use them, each as "${RESILIENCE_...:-default}". An override goes
  into .env; .env.example lists every variable, commented out, with its default.
* k8s/configmaps/configmap.yaml (shopeasy-config, loaded by every Deployment)
  has the same keys; changing one needs a rollout restart because environment
  variables are read at pod start.

Normal ASP.NET Core precedence applies: environment variable, then
appsettings.json, then the default in the code.

Several copies of a default can drift, so ResilienceConfigurationTests (15
tests, no servers needed) fails when any appsettings.json, the Compose file, the
ConfigMap or .env.example differs from the code's defaults (checked by changing
a value in three of them), when a service with a database or consumers does not
get its settings, and it checks with the real Order appsettings.json that the
file is read by the services and that an override wins.

Verified: docker compose config renders the defaults and an override from .env
for the right services (gateway gets none); kustomize + kubeconform -strict and
the repository's deployment rules pass; the whole suite is green (280 tests,
234 without servers, 46 with PostgreSQL and RabbitMQ). The README documents
where the settings live and how to change them, and its test counts are updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vuhzoey6h5V9wPPVFuR7ME
@NullButCute
NullButCute merged commit 2bd1122 into main Oct 15, 2026
11 checks passed
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.

2 participants