Skip to content

fix(deploy): per-env names for REPORTS + VECTORIZE bindings#191

Merged
todorkolev merged 1 commit into
mainfrom
fix/deploy-env-separation
Jul 3, 2026
Merged

fix(deploy): per-env names for REPORTS + VECTORIZE bindings#191
todorkolev merged 1 commit into
mainfrom
fix/deploy-env-separation

Conversation

@todorkolev

Copy link
Copy Markdown
Collaborator

Fixes the broken staging deploy by giving the two resources #80 added (REPORTS R2 bucket, VECTORIZE index) 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_CACHESIGMA_CSV_CACHE_NAME, REPORTSSIGMA_REPORTS_NAME) instead of blanket-renaming every bucket; substitutes the Vectorize index_name from SIGMA_VECTORIZE_NAME; and strips trailing commas before JSON.parse (mirrors assertRateLimiters) so the JSONC parses.
  • .github/workflows/deploy.yml: passes SIGMA_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, Vectorize sigma-assistant/sigma-assistant-stage (1024-dim, cosine). Staging env vars set to the -stage names.

Prod is untouched: it keeps committed defaults (sigma-reports/sigma-assistant) and only deploys on a version tag. Verified locally: staging render → -stage names; prod render → unchanged.

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 midt-admin 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.

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.

@todorkolev todorkolev merged commit 5d99fd9 into main Jul 3, 2026
1 check passed
@todorkolev todorkolev deleted the fix/deploy-env-separation branch July 3, 2026 12:39
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.

2 participants