Skip to content

Concatenate platformEnvVars ahead of extraEnvVars - #112

Open
Erik Weathers (erikdw) wants to merge 4 commits into
mainfrom
erikdw/gcs-hmac-region
Open

Erik Weathers (erikdw) wants to merge 4 commits into
mainfrom
erikdw/gcs-hmac-region

Conversation

@erikdw

@erikdw Erik Weathers (erikdw) commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a reserved platformEnvVars list beside extraEnvVars on the API, Brainstore reader, fast reader, writer, automation writer, and AI Gateway. The installer (the Terraform module) owns platformEnvVars. Hand-edited values belong in extraEnvVars. Setting platformEnvVars by hand replaces the platform list.
  • Render platformEnvVars first, then extraEnvVars. Kubernetes 1.32 kubelet makeEnvironmentVariables writes container.Env into a map in order (tmpEnv[name] = value), so the last duplicate name wins. A user extraEnvVars entry therefore overrides a platform entry of the same name. ENABLE_PROMETHEUS_METRICS stays after both so autoscaling still wins.
  • API pools concatenate both lists: base platformEnvVars plus pool platformEnvVars, then base extraEnvVars plus pool extraEnvVars. mergeOverwrite no longer drops the shared platform list on ingest or background.
  • Fail the render when cloud=google and api.enableGcsAuth is false unless the combined API lists contain AWS_REGION. A whitespace-only name does not count. Native GCS auth does not require the region. AWS_REGION only in extraEnvVars (old modules) still passes. The same combined list satisfies the PRIMARY_ORG_NAME check.
  • There is no dedicated region value. Plain Helm users keep setting AWS_REGION in extraEnvVars.

Chart.yaml is unchanged. Publish this as 6.25.0 before merging the GKE module PR. If the published version differs, update that floor.

Linear: https://linear.app/braintrustdata/issue/INF-782/helm-replaces-apiextraenvvars-and-drops-module-injected-aws-region-on

Test plan

  • helm unittest braintrust (429 tests): pool concat on default, ingest, and background; user entry last when names collide; Google HMAC failure with neither list; success from either list; native GCS auth; PRIMARY_ORG_NAME via platformEnvVars; Brainstore writer order
  • helm template of the Google CI values and the three Google examples
  • helm template with neither list set fails with the AWS_REGION guard
  • helm lint braintrust --strict

S3-compatible GCS needs AWS_REGION. Write it from objectStorage.google.region so a later api.extraEnvVars replacement cannot remove it, and fail the render when neither that value nor an explicit AWS_REGION is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T04:30:39.582367Z b9887e1 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9887e1cc2

ℹ️ About Codex in GitHub

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

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread braintrust/templates/api-configmap.yaml Outdated
Helm replaces extraEnvVars lists, so required settings such as the GCS region were wiped by customer overrides. moduleEnvVars is reserved for Terraform and rendered first. The kubelet keeps the last duplicate name, so extraEnvVars still wins. A Google HMAC deploy with no AWS_REGION in either list fails the render.

Co-authored-by: Cursor <cursoragent@cursor.com>
@erikdw Erik Weathers (erikdw) changed the title Fail Google HMAC renders that drop the GCS region Concatenate moduleEnvVars ahead of extraEnvVars Oct 21, 2026
The list is reserved for the installer. Hand-edited values stay in extraEnvVars, which is still rendered after the platform list so a user entry overrides the same name.

Co-authored-by: Cursor <cursoragent@cursor.com>
@erikdw Erik Weathers (erikdw) changed the title Concatenate moduleEnvVars ahead of extraEnvVars Concatenate platformEnvVars ahead of extraEnvVars Oct 21, 2026
A name-only or empty literal entry was enough to pass the guard, so the API could still deploy without a usable region. A valueFrom reference still counts, and a later entry replaces an earlier one.

Co-authored-by: Cursor <cursoragent@cursor.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