Skip to content

fix(deploy): wire FAULT_INJECTION_SEED from ConfigMap; document deferred flags - #10

Closed
rsanghvi21 wants to merge 1 commit into
feat/policies-and-loadgenfrom
fix/wire-fault-seed-configmap
Closed

rsanghvi21 wants to merge 1 commit into
feat/policies-and-loadgenfrom
fix/wire-fault-seed-configmap

Conversation

@rsanghvi21

Copy link
Copy Markdown
Collaborator

Build-Plan Step Implemented

  • Step: A1.7/A1.8 (fix + documentation follow-up on already-completed steps).

Checkpoint Execution & Output

$ uv run pytest tests/unit/deploy/test_prod_manifests.py -v
6 passed in 0.16s

$ uv run pytest tests/unit/services --ignore=tests/unit/services/test_edge_gateway.py --ignore=tests/unit/services/test_loadgen.py -v
72 passed in 3.39s   (includes test_faults.py, 13 passed -- the file whose comment I touched)

$ uv run pytest tests/unit --ignore=tests/unit/services --cov=understudy --cov-branch --cov-fail-under=100
109 passed, 100.00% coverage

$ uv run ruff check . && uv run ruff format --check . && uv run mypy --strict src tests && uv run lint-imports && uv run python scripts/check_mocks.py
All green.

test_edge_gateway.py and test_loadgen.py are excluded above because both
construct a real httpx.AsyncClient, which triggers a pre-existing
Windows-local-only crash (OpenSSL Uplink conflict between psycopg-binary and
httpx) on this dev machine -- unrelated to this change. CI runs on
ubuntu-latest (.github/workflows/ci.yml), where this does not reproduce.

ADRs Relied On

  • ADR-015 (fault injection determinism/seeding) -- this PR makes the seed's
    prod source of truth explicit without changing the seeding mechanism.

Mock Registry Disclosures

  • None.

Documentation Updates

  • docs/02-architecture.md §2.5: noted that FAULT_INJECTION_SEED is sourced
    from the app-config ConfigMap in deploy/prod, with the code constant as
    fallback only.
  • deploy/prod/configmap.yaml: added comments explaining why feature-flags
    and ENVIRONMENT/LOG_LEVEL remain unwired (await the Phase 5 live-read
    mechanism), so they read as intentional, not a leftover fix.

Definition of Done

  • Implementation complete for the named build-plan step
  • Unit tests written; 100% line and branch coverage of the added lines
  • make check green (see checkpoint output; two pre-existing Windows-local-only hanging test files excluded, unrelated to this change)
  • Checkpoint command run and output matches, OR marked unverified with a reason
  • Docs updated where this change made them untrue
  • No new # MOCKED: marker without a row in docs/MOCKS.md
  • Conventional commit(s), conventional branch, PR opened, never pushed to main

Context

A /code-review pass against PR #6 flagged deploy/prod/configmap.yaml's two
ConfigMaps as unreferenced by any Deployment. Investigation found
FAULT_INJECTION_SEED (1337) exactly matches
services/_common/faults.py's hardcoded default -- a real, fixable gap -- so
this PR wires it into all four Deployments via configMapKeyRef. The
remaining keys (feature-flags, ENVIRONMENT, LOG_LEVEL) genuinely can't
be wired the same way yet: docs/02-architecture.md §2.5 requires feature
flags to be read live at request time, which needs the not-yet-built Phase 5
actuator. Both cases are now documented inline so they aren't re-flagged as
dead configuration.

Base branch is feat/policies-and-loadgen (PR #6, still open), since
deploy/prod/ only exists on that branch's stack. Builds on
#9 (docs/rbac-actuator-consumed), same underlying pattern.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh

…red flags

deploy/prod/configmap.yaml's app-config.FAULT_INJECTION_SEED (1337)
exactly matches services/_common/faults.py's hardcoded
DEFAULT_FAULT_INJECTION_SEED, but nothing wired the ConfigMap value in
-- every service silently fell back to the code default. A code-review
pass against PR #6 flagged this as a dead ConfigMap key.

Wire FAULT_INJECTION_SEED into all four deploy/prod/*.yaml Deployments
via configMapKeyRef so the ConfigMap is the actual source of truth in
prod, with the code constant remaining only as the non-k8s/local
fallback.

feature-flags and app-config's ENVIRONMENT/LOG_LEVEL stay unwired:
docs/02-architecture.md §2.5 requires feature flags to be read live at
request time, not from a startup env var, which needs the actuator's
not-yet-built DISABLE_FLAG/REVERT_CONFIG live-read mechanism (Phase 5).
Document that explicitly in the ConfigMap so it is not re-flagged as
dead configuration before Phase 5 lands.

Implements build-plan step A1.7/A1.8 (fix + documentation follow-up).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh
@Harikeshav-R

Copy link
Copy Markdown
Owner

Closed as integrated into main via PR #6.

@Harikeshav-R
Harikeshav-R deleted the fix/wire-fault-seed-configmap branch September 11, 2026 19:49
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