fix(deploy): per-env names for REPORTS + VECTORIZE bindings#191
Merged
Conversation
Extends the deploy-time name override to the two resources #80 added: - renderJson targets R2 buckets BY BINDING (CSV_CACHE / REPORTS) instead of blanket-renaming every bucket to SIGMA_CSV_CACHE_NAME, and substitutes the Vectorize index_name from SIGMA_VECTORIZE_NAME - renderJson now strips trailing commas before JSON.parse (matches assertRateLimiters) so the JSONC parses - deploy.yml passes SIGMA_REPORTS_NAME + SIGMA_VECTORIZE_NAME and the non-prod guard rejects reusing the production names Production keeps its committed defaults (sigma-reports / sigma-assistant); staging renders sigma-reports-stage / sigma-assistant-stage.
midt-admin
approved these changes
Jul 3, 2026
midt-admin
left a comment
There was a problem hiding this comment.
Deploy env-separation fix. renderJson + deploy.yml verified locally (staging render -> -stage names; prod render unchanged). Resources provisioned in both envs. Approving to unblock the staging deploy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the broken staging deploy by giving the two resources #80 added (
REPORTSR2 bucket,VECTORIZEindex) proper per-environment names, matching how the worker/D1/CSV-cache are already parameterized.Changes (2 files):
scripts/wrangler-render.mjs: renderJson targets R2 buckets by binding (CSV_CACHE→SIGMA_CSV_CACHE_NAME,REPORTS→SIGMA_REPORTS_NAME) instead of blanket-renaming every bucket; substitutes the Vectorizeindex_namefromSIGMA_VECTORIZE_NAME; and strips trailing commas beforeJSON.parse(mirrorsassertRateLimiters) so the JSONC parses..github/workflows/deploy.yml: passesSIGMA_REPORTS_NAME+SIGMA_VECTORIZE_NAME; the non-prod guard rejects reusing the production names.Resources already provisioned (both envs): R2
sigma-reports/sigma-reports-stage, Vectorizesigma-assistant/sigma-assistant-stage(1024-dim, cosine). Staging env vars set to the-stagenames.Prod is untouched: it keeps committed defaults (
sigma-reports/sigma-assistant) and only deploys on a version tag. Verified locally: staging render →-stagenames; prod render → unchanged.