Skip to content

fix(llm-gateway): let a gateway-only release skip the shared secret reapply - #25911

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/llm-gateway-skip-shared-secrets
Nov 21, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/llm-gateway-skip-shared-secrets

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

A gateway-only production release can now skip reapplying the shared <env>-omi-backend-secrets. The gateway credential presence check still runs.

  • .github/workflows/gcp_llm_gateway.yml: new workflow_dispatch input skip_backend_secrets. It defaults to false, so current behaviour is unchanged. It is passed to the deploy step as SKIP_BACKEND_SECRETS, which deploy-llm-gateway.sh already honors.
  • backend/scripts/deploy-llm-gateway.sh: the skip branch now wraps only deploy-backend-secrets.sh. The read-only presence check for ANTHROPIC_API_KEY, METRICS_SECRET and OMI_LLM_GATEWAY_SERVICE_TOKEN moves out of it and runs on every non-dry-run release. A skipped reapply still fails closed on a missing or empty credential.
  • backend/tests/unit/test_llm_gateway_deploy_contract.py: pins the ordering, the input and the step env. It fails against the previous script.
  • .github/ci-budget.yaml: records the new dispatch input, plus a one-minute p50 bump on both gateway jobs, following the precedent for trigger changes. The workflow is still manual-only, with no PR runs.

Why: SCA-3305. Release is holding the #25819 gateway rollout because the only prod path writes the shared backend secret. Release recommended a reviewed gateway workflow that skips that write.

Rollback: revert this PR. The default-false input means no behaviour change until a dispatch sets it.

Verification

Head: 52363b3

  • pytest backend/tests/unit/test_llm_gateway_deploy_contract.py: passes. Mutation check: the new test fails on the old script.
  • python3 .github/scripts/check_ci_budget.py --base origin/main: passed.

Product invariants affected

  • INV-DATA-1: unaffected. The change routes nothing and changes no project or endpoint. It only lets a dispatch skip a secret write; the target cluster, image and data plane are unchanged.

Failure-Class: none

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

…eapply

The production LLM gateway workflow always reapplies the shared
<env>-omi-backend-secrets before its Helm rollout, and it exposes no way
to skip that. A gateway-only release (#25819, SCA-3305) therefore needs a
shared-secret write that the change does not require. Release is holding
the rollout on it.

deploy-llm-gateway.sh already honors SKIP_BACKEND_SECRETS. Expose it as
the workflow input skip_backend_secrets, default false so current
behaviour is unchanged. Move the read-only credential presence check out
of the reapply branch, so a skipped reapply still fails closed when
ANTHROPIC_API_KEY, METRICS_SECRET or OMI_LLM_GATEWAY_SERVICE_TOKEN is
missing or empty. A contract test pins that ordering and the input; it
fails against the previous script.

Failure-Class: none
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 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-11-21T03:41:20.081511Z 52363b3 PR opened
ℹ️ 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 review" or "@codex security review".

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: 52363b3583

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

IMAGE_REPOSITORY: ${{ env.ROLE_IMAGE_REPOSITORY }}
IMAGE_DIGEST: ${{ env.ROLE_IMAGE_DIGEST }}
# Scopes a gateway-only release: the shared secret reapply is skipped, the presence check is not.
SKIP_BACKEND_SECRETS: ${{ github.event.inputs.skip_backend_secrets == 'true' && 'true' || 'false' }}

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 Preserve the read-only secret readiness gates when skipping reapply

When skip_backend_secrets=true, this workflow bypasses both the ExternalSecret readiness wait and verify_k8s_secret_keys.py, since those checks live inside deploy-backend-secrets.sh. The remaining three-key check is not equivalent: the production gateway values also require keys such as OPENAI_API_KEY, OPENROUTER_API_KEY, and PERPLEXITY_API_KEY. An incomplete existing secret can therefore pass preflight and reach Helm mutation before replacement pods fail to start. Keep the shared-secret write optional, but retain the read-only readiness and expected-key verification before rollout, as required by .github/AGENTS.md.

AGENTS.md reference: .github/AGENTS.md:L31-L31

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 72708ad into main Nov 21, 2026
67 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/llm-gateway-skip-shared-secrets branch November 21, 2026 04:20
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