Skip to content

Route automation queries to the dedicated writer pool - #110

Open
Alex R (alexr17) wants to merge 2 commits into
mainfrom
alexr/automation-writer-query-routing
Open

Alex R (alexr17) wants to merge 2 commits into
mainfrom
alexr/automation-writer-query-routing

Conversation

@alexr17

@alexr17 Alex R (alexr17) commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Automation processing can still compete with regular writers even when its dedicated pool is enabled.
Add a Service and API routing so automation queries use that pool, and wait for it to be ready before starting the API.
routeQueries: false lets operators stage the pool or finish an API rollback before scaling it down.
Query routing requires a compatible API release.

Input Intended behavior
Positive replicas; zero, null, missing, or empty replicas Positive replicas create the Service and gate target; disabled shapes omit both and preserve API writer fallback.
Routing true, missing, or null; routing false, empty string, or zero Defaults activate routing for an enabled pool; false, empty string, and zero omit the URL while retaining the Service, pods, and readiness checks.
Older --reuse-values; partial replicas-only pool; missing/null Service and annotation maps A missing pool stays disabled; partial pools resolve the template defaults before fields are read.
Default/empty/custom Service name, custom Service and listen ports, both namespace modes The URL matches the Service name/port/namespace; targetPort remains the existing automation-writer listen port.
Release tags with/without v, full/short/all-digit commit SHAs, pre-release and custom tags Supported tags keep rendering; the existing pre-v2.16.0 release rejection and stable-tag runtime gate remain in effect.
AWS, Google, Azure, and GKE examples including API isolation/autoscaling Enabled, disabled, staged, and retained-value configurations render across all eight values configurations.
Gate enabled/disabled; routing activation/deactivation Enabled gates wait for automation writers in every API pool; stage ready capacity before activation when the gate is off, and complete the API fallback rollout before scaling down.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-10T00:01:37.204944Z e15742b Manual request
ℹ️ 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.

@alexr17
Alex R (alexr17) force-pushed the alexr/automation-writer-query-routing branch from 5704af8 to ca7f345 Compare October 9, 2026 23:44

@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: 5704af8ebb

ℹ️ 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".

BRAINSTORE_WRITER_URL: "http://{{ .Values.brainstore.writer.service.name | default .Values.brainstore.writer.name }}.{{ .Values.global.namespace }}:{{ .Values.brainstore.writer.service.port }}"
{{- if gt (int (include "braintrust.automationWriter.replicas" .)) 0 }}
{{- $aw := include "braintrust.automationWriter.config" . | fromYaml }}
{{- if $aw.routeQueries }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required empty and zero routing cases

The new raw truthiness check for routeQueries has coverage for true, missing, null, and false, but neither the input matrix nor the tests define what happens for an empty string or 0. Because these shapes directly decide whether the API receives the automation-writer URL, add explicit helm-unittest cases before shipping; the repository treats any unchecked input shape as a release blocker.

AGENTS.md reference: AGENTS.md:L7-L17

Useful? React with 👍 / 👎.

@@ -0,0 +1,25 @@
{{- if gt (int (include "braintrust.automationWriter.replicas" .)) 0 }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the examples that deny the new Service

With positive replicas this template now creates a Service, but braintrust/examples/google-autopilot/values.yaml:154 and braintrust/examples/google-autopilot-cel/values.yaml:174 still explicitly state that no Service is created. Update both supported example comments so operators are not given incorrect resource and networking expectations when enabling this pool.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

@alexr17

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: e15742b624

ℹ️ 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".

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