Repository navigation
fix(llm-gateway): let a gateway-only release skip the shared secret reapply - #25911
Conversation
…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]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
💡 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' }} |
There was a problem hiding this comment.
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 👍 / 👎.
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: newworkflow_dispatchinputskip_backend_secrets. It defaults tofalse, so current behaviour is unchanged. It is passed to the deploy step asSKIP_BACKEND_SECRETS, whichdeploy-llm-gateway.shalready honors.backend/scripts/deploy-llm-gateway.sh: the skip branch now wraps onlydeploy-backend-secrets.sh. The read-only presence check forANTHROPIC_API_KEY,METRICS_SECRETandOMI_LLM_GATEWAY_SERVICE_TOKENmoves 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
Failure-Class: none
🤖 Generated with Claude Code