Repository navigation
fix(cli): expand deploy env vars so shipped values match validation - #254
Merged
Brooooooklyn merged 1 commit intoJul 4, 2026
Conversation
Brooooooklyn
approved these changes
Jul 4, 2026
Brooooooklyn
deleted the
07-04-fix_cli_expand_deploy_env_vars_so_shipped_values_match_validation
branch
July 4, 2026 12:29
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
What
loadDeployEnvnow parses.envand.env.productionthrough the sharedparseDotenvFile(with expansion disabled) andmergeAndExpand, the same path env validation uses, instead of a hand rolled line parser that shipped raw values. It is now exported so the behavior can be tested directly.Why
void deployvalidates env by expanding${VAR}and$VARreferences across the env files, butloadDeployEnv, which builds the values actually shipped to the worker, used a separate hand rolled parser that only split on the first=and stripped quotes. It never expanded references. A.envwithAPI_HOST=api.example.comandAPI_URL=https://${API_HOST}/v1therefore passed validation against the expanded URL while the worker received the literalhttps://${API_HOST}/v1. Validation stayed green and the deployed value was silently broken, which is exactly the kind of divergence that is hard to notice until runtime.Safety
The shared path keeps the same file list and precedence,
.envfirst and.env.productionoverriding it, and runs the samestripInternalEnvKeysstep afterward, so plain values, quoted values, and override order behave as before. The only behavior that changes is that${VAR}and$VARreferences now resolve, which is what validation already assumed.Verification
A new regression test at
packages/void/test/unit/deploy-env-expand.test.tsdrivesloadDeployEnvagainst a temp project and asserts that a${VAR}reference resolves both within one file and across.envand.env.production. It fails when expansion is removed and passes with the fix. Thedeploy-project,deploy-drift,deploy-events, anddotenvsuites stay green (79 tests total), and the void package typechecks with tsgo and passes oxlint.