-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli] Don't pull system environment vars in dev #11526
[cli] Don't pull system environment vars in dev #11526
Conversation
This stops exposing system env vars in development.
The old test fails because we don't expose system env vars in development anymore.
🦋 Changeset detectedLatest commit: 8f2c032 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -390,7 +390,7 @@ function exposeSystemEnvs( | |||
) { | |||
const envs: Env = {}; | |||
|
|||
if (autoExposeSystemEnvs) { | |||
if (autoExposeSystemEnvs && target !== 'development') { | |||
envs['VERCEL'] = '1'; | |||
envs['VERCEL_ENV'] = target || 'development'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (soft-blocking): If target
is not development, do we still want to default VERCEL_ENV
to "development" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a mock, to match the api behavior it should not provide a default VERCEL_ENV
for dev. I made that decision in https://github.com/vercel/api/pull/27777 because it feels more consistent to just not send any system env vars in dev. But, I'm open to changing the api behavior to make VERCEL_ENV
and maybe VERCEL
exceptions.
const exitCodePromise = env(client); | ||
await expect(client.stderr).toOutput( | ||
'Downloading `development` Environment Variables for Project vercel-env-pull' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (soft-blocking): Add assertion (or new test) somewhere that development env pulls do not include system env vars at all.
7486c4b
to
790d1aa
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @vercel/build-utils@8.2.0 ### Minor Changes - fix corepack detection for package manager version determination ([#11596](#11596)) ### Patch Changes - Fix triggering of ignored project settings node version warning ([#11550](#11550)) ## vercel@34.2.0 ### Minor Changes - Stop sending system environment variables in dev ([#11526](#11526)) ### Patch Changes - Updated dependencies \[[`d3c1267e2`](d3c1267), [`ccd7eb1fb`](ccd7eb1)]: - @vercel/build-utils@8.2.0 - @vercel/node@3.1.5 - @vercel/static-build@2.5.9 ## @vercel/client@13.2.7 ### Patch Changes - Updated dependencies \[[`d3c1267e2`](d3c1267), [`ccd7eb1fb`](ccd7eb1)]: - @vercel/build-utils@8.2.0 ## @vercel/gatsby-plugin-vercel-builder@2.0.31 ### Patch Changes - Updated dependencies \[[`d3c1267e2`](d3c1267), [`ccd7eb1fb`](ccd7eb1)]: - @vercel/build-utils@8.2.0 ## @vercel/node@3.1.5 ### Patch Changes - Updated dependencies \[[`d3c1267e2`](d3c1267), [`ccd7eb1fb`](ccd7eb1)]: - @vercel/build-utils@8.2.0 ## @vercel/static-build@2.5.9 ### Patch Changes - Updated dependencies \[]: - @vercel/gatsby-plugin-vercel-builder@2.0.31 ## @vercel-internals/types@1.0.36 ### Patch Changes - Updated dependencies \[[`d3c1267e2`](d3c1267), [`ccd7eb1fb`](ccd7eb1)]: - @vercel/build-utils@8.2.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
System environment variables would get set with empty strings in development which breaks some builds. This fixes that by using the v2 of
/env/pull
introduced in https://github.com/vercel/api/pull/27777.