Repository navigation
refactor(deploy): template-generate the four prod service manifests - #22
Closed
rsanghvi21 wants to merge 2 commits into
Closed
rsanghvi21 wants to merge 2 commits into
rsanghvi21 wants to merge 2 commits into
Conversation
…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
deploy/prod/{auth-service,data-service,edge-gateway,worker}.yaml were
four independently hand-written, near-identical Deployment+Service
pairs (identical label scheme, Prometheus scrape annotations,
replicas, imagePullPolicy, resources, probe shape,
UNDERSTUDY_ROLE/FAULT_INJECTION_SEED env; differing only in each
service own env vars, Service type/ports, and
app.kubernetes.io/component) with nothing keeping them from drifting
apart -- the same problem generate_postgres_manifests.py (prior PR)
already solved for the postgres manifests.
Factor the shared PyYAML dumping helpers (indent-forcing Dumper,
literal-block-scalar str subclass) out of that script into
deploy/_manifest_gen_common.py so both generators use one convention
instead of duplicating it. Add deploy/generate_prod_manifests.py
following the same shape: each manifest built as a dict from one
template function plus a small per-instance parameter table, with
--check wired into tests/unit/deploy/test_prod_manifests.py so drift
fails CI.
The four committed files are now generator output; diffed against
what was already committed before touching anything, the only
difference is YAML quoting style (PyYAML's default quote-string-that-
looks-like-a-bool/number behavior), confirming the generator
faithfully reconstructs the existing, reviewed manifests including
the FAULT_INJECTION_SEED wiring from the ConfigMap PR.
Implements build-plan step A1.7/A1.8 (refactor on already-completed
manifests).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh
Harikeshav-R
added a commit
that referenced
this pull request
Sep 11, 2026
Owner
|
Closed as integrated into main via PR #6. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build-Plan Step Implemented
Checkpoint Execution & Output
ADRs Relied On
generator (refactor(deploy): template-generate the three Postgres manifests #21): a plain Python script over adopting Helm/Kustomize/Jsonnet, which
would need its own ADR.
Mock Registry Disclosures
Documentation Updates
docs/02-architecture.md§2.5: notes the four prod service manifests are generated,cross-referencing the same convention as §2.10's postgres-manifest note.
Definition of Done
make checkgreen# MOCKED:marker without a row in docs/MOCKS.mdContext
Second half of the finding-12 manifest-duplication fix (first half: #21, the postgres
manifests). This PR applies the same generate-don't-hand-maintain treatment to the
four
deploy/prod/*.yamlservice manifests, which shared an identical label scheme,Prometheus scrape annotations, resource limits, and probe shape with nothing
preventing them from drifting apart. Factored the shared PyYAML dumping helpers
(
IndentedDumper,LiteralStr) out ofgenerate_postgres_manifests.pyintodeploy/_manifest_gen_common.pyso both generators share one dumping conventionrather than duplicating it -- the two scripts otherwise remain fully independent
(different manifest families, no coupling between them beyond that shared helper).
As with #21, I diffed the generator's output against what was already committed
before touching anything: the only difference is YAML quoting style, confirming the
generator faithfully reconstructs the existing manifests -- including PR #3's
FAULT_INJECTION_SEEDConfigMap wiring, which every instance's env list includes viaa shared
_fault_seed_env()helper so it can't be forgotten on a future edit.Base branch is
refactor/template-postgres-manifests(PR #21), since this PR reusesthat PR's
deploy/_manifest_gen_common.pymodule -- rebasing ontofeat/policies-and-loadgendirectly would mean redefining those helpers. Once #21merges, this PR's diff will narrow to just this PR's changes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CzBeBUsZmE38K1kWeLMhNh