Skip to content

Render Brainstore Deployments and ConfigMaps from shared defines - #138

Open
Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9-brainstore-dedup
Open

Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9-brainstore-dedup

Conversation

@phacops

Copy link
Copy Markdown

Summary

The reader, writer and fastreader Deployments were identical apart from the role name (204 lines each). The automation writer differed in three places, and the four ConfigMaps differed by a few keys. AGENTS.md asked contributors to edit all four ConfigMaps by hand.

  • The shared bodies move to braintrust.brainstore.deployment (_brainstore-deployment.tpl) and braintrust.brainstore.configmap (_brainstore-configmap.tpl).
  • Each role file now includes the define with its values map.
  • Role-only settings stay in the role files: BRAINSTORE_WRITER_LOOP_CONFIG, and the automation writer's absent-map guard, defaults merge, probe-port override and Azure disk condition.
  • The per-role files remain because braintrust.brainstore.podAnnotations and the startup gate render them by name.
  • AGENTS.md is updated.

The net change is about 1,000 fewer lines.

Rendered output is byte-identical

Pod checksum annotations hash each ConfigMap's raw rendered text, so any whitespace change would restart every Brainstore pod on upgrade. helm template output was compared byte for byte between main and this branch across 22 value sets, with zero differences:

  • all four ci/values-*.yaml;
  • every examples/*/values.yaml on top of ci/values-google;
  • automation writer enabled on Google, Azure (Container Storage disk) and AWS;
  • a "rich" overlay setting labels, podLabels, nodeSelector, tolerations, affinity, security contexts, extraEnvVars/Containers/Volumes, tmpVolume, sizeLimit, annotations, PDBs, replicas: 0 and locksBackend: objectStorage;
  • deploymentOrdering on and off (pod-template fingerprint present and absent);
  • the --reuse-values fixtures: pre-automationwriter, reuse-automationwriter-replicas, pre-brainstore-pdb, pre-rollout, and a null brainstore.automationwriter map.

A one-character change to the ConfigMap define changes 8 checksum annotations in that comparison, so a whitespace regression would show up. The failure messages are also unchanged: progressDeadlineSeconds validation and the volume.size must be set errors.

Input matrix

No row renders differently, so there are no new unit tests. The existing suites cover every row, and ./test.sh passes (675 tests).

Row Covered by
aws / google / azure ci values + *-values.yaml fixtures
automation writer replicas 0 / >0 / null / missing map / partial map brainstore-automationwriter_test.yaml, brainstore-writer-configmap_test.yaml
Azure disk with a zero-replica automation writer brainstore-automationwriter_test.yaml
image tag release / SHA / pre-release brainstore-startup-gate_test.yaml, automation writer validate tests
deploymentOrdering on/off, fingerprint migrations_test.yaml, brainstore-startup-gate_test.yaml

Follow-up (not in this PR)

Reader, writer and fastreader still use the hardcoded brainstore.livenessProbe.httpGet.port: 4000, even when <role>.service.port is changed. Passing probePort for them, as the automation writer does, would fix that in one place, but it changes rendered output, so it belongs in its own PR.


Generated by Claude Code

The reader, writer, and fastreader Deployments were identical apart
from the role name, the automation writer differed in three places, and
the four ConfigMaps differed by a handful of keys. AGENTS.md had to ask
contributors to edit all four ConfigMaps by hand.

Move the shared bodies into braintrust.brainstore.deployment and
braintrust.brainstore.configmap. Each role file now includes the define
with its values map; role-only settings (BRAINSTORE_WRITER_LOOP_CONFIG,
the automation writer's guard, defaults merge, probe port, and Azure
disk condition) stay in the role files. The per-role files remain
because the checksum and pod-template fingerprint helpers render them
by name.

Rendered output is byte-identical to the previous templates, so pod
checksums and fingerprints do not change and upgrades cause no
restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01449dBcsndUJDCqCacbrEvW
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T21:52:53.504433Z f9bd5c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 Tier: plusRetriggerView in Greptile

[Low impact] The PR appears safe to merge; no actionable regressions or repository-rule violations were found.

Summary

Moves the four Brainstore roles’ repeated Deployment and ConfigMap bodies into shared defines.

  • Brainstore ConfigMaps now use one shared template body.
  • Brainstore Deployments now use one shared template body.

phacops explicitly deferred changing reader, writer, and fastreader probes to follow each role’s service port because that would change rendered output.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C["Four role ConfigMap files"] --> SC["Shared ConfigMap define"]
  D["Four role Deployment files"] --> SD["Shared Deployment define"]
  SD --> A["Pod annotations"]
  A -->|"Hash rendered text"| C
  G["Startup gate"] -->|"Render by filename"| D
Loading

Reviews (1) · Last reviewed commit: "Render Brainstore Deployments and Config..." · Reviewed by Greptile

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