Repository navigation
fix(vscode): bake production server URL and Stripe key into the VSIX - #1347
Conversation
getenv() now honors real environment variables (precedence .config -> .env -> process.env), for known keys only and ignoring empty values. The Build step exposes ROCKETRIDE_URI and RR_STRIPE_PUBLISHABLE_KEY from repo variables, scoped to the step so the Test step keeps the localhost defaults. Requires repo variables ROCKETRIDE_URI and RR_STRIPE_PUBLISHABLE_KEY.
📝 WalkthroughWalkthroughTwo build-time environment variables are added to the workflow, and ChangesEnvironment variable wiring and merge semantics
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete. |
kwit75
left a comment
There was a problem hiding this comment.
Reviewed — getenv() .config->.env->process.env precedence is correct + safe: the override loops over already-merged keys only (no arbitrary process.env leaks into the VSIX) and skips empty values (a blank CI var falls back to the committed default, not an empty bake). Build-step var scoping keeps Test on localhost. The repo vars ROCKETRIDE_URI (api.rocketride.ai) + RR_STRIPE_PUBLISHABLE_KEY (pk_live) are already set to prod, so a fresh VSIX will bake prod. LGTM.
…ocketride-org#1347) * fix(vscode): bake production server URL and Stripe key into the VSIX getenv() now honors real environment variables (precedence .config -> .env -> process.env), for known keys only and ignoring empty values. The Build step exposes ROCKETRIDE_URI and RR_STRIPE_PUBLISHABLE_KEY from repo variables, scoped to the step so the Test step keeps the localhost defaults. Requires repo variables ROCKETRIDE_URI and RR_STRIPE_PUBLISHABLE_KEY. * refactor(vscode): use for-in to iterate merged env keys
Summary
.configdev defaults (ROCKETRIDE_URI=http://localhost:5565,RR_STRIPE_PUBLISHABLE_KEY=pk_test_…) becausegetenv()only read.config/.envand ignored real environment variables — and CI has no.env, so production values could never be injected.getenv()now honorsprocess.envwith precedence.config -> .env -> process.env, for known keys only and ignoring empty values (a set-but-empty CI secret falls back to the committed default instead of baking an empty string).Buildstep exposesROCKETRIDE_URIandRR_STRIPE_PUBLISHABLE_KEYfrom repo variables, scoped to the step so theTeststep keeps the localhost defaults and integration tests do not hit production.Type
fix
Testing
./builder testpassesVerified
getenv()precedence locally: dev (no env) →localhost/pk_test; with real env →https://api.rocketride.ai/pk_live; set-but-empty → falls back to the.configdefault.Checklist
Deployment note
Requires two repo variables to be created (public, non-secret values):
ROCKETRIDE_URI=https://api.rocketride.aiRR_STRIPE_PUBLISHABLE_KEY=pk_live_…Linked Issue
No linked issue — to be added.
Summary by CodeRabbit
New Features
Bug Fixes