-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
handle VERCEL_ARTIFACTS_* env vars override #9249
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Skipped Deployments
|
cc28be2
to
5de06ba
Compare
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.
This is an amazing write up of the existing + desired behavior.
The only blocking comment is making sure that we keep the same level of user facing error messaging if we encounter a non-UTF8 value.
I feel that changing the parameter for get_configuration_options
doesn't provide us with much, but that's just an opinion.
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.
LGTM!
Comment on the Output::from
implementation is total taste and up to you.
Hi there 👋 It looks like this PR introduces broken links to the docs, please take a moment to fix them before merging:
Thank you 🙏 |
531c833
to
65a4203
Compare
- ConfigurationOptions.token corresponds to TURBO_TOKEN or VERCEL_ARTIFACTS_TOKEN | ||
- ConfigurationOptions.team_id corresponds to TURBO_TEAMID or VERCEL_ARTIFACTS_OWNER | ||
- ConfigurationOptions.team_slug corresponds to TURBO_TEAM | ||
1. We're ultimately poking around the env vars looking for _paris_ that make sense. |
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.
1. We're ultimately poking around the env vars looking for _paris_ that make sense. | |
1. We're ultimately poking around the env vars looking for _pairs_ that make sense. |
Hi! If you're new here: | ||
1. The general pattern is that: | ||
- ConfigurationOptions.token corresponds to TURBO_TOKEN or VERCEL_ARTIFACTS_TOKEN | ||
- ConfigurationOptions.team_id corresponds to TURBO_TEAMID or VERCEL_ARTIFACTS_OWNER | ||
- ConfigurationOptions.team_slug corresponds to TURBO_TEAM | ||
1. We're ultimately poking around the env vars looking for _pairs_ that make sense. | ||
Since we presume that users are the only ones sending TURBO_* and Vercel is the only one sending VERCEL_*, we can make some assumptions. Namely, we assume that if we have one of VERCEL_ARTIFACTS_OWNER or VERCEL_ARTIFACTS_TOKEN we will always have both. | ||
1. Watch out for mixing up `TURBO_TEAM` and `TURBO_TEAMID`. Same for ConfigurationOptions.team_id and ConfigurationOptions.team_slug. |
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.
🙏🏼
Description
The prior intended state of EnvVars overrides looked like this:
But we've realized this is not good enough. We want to better handle the scenario where users have provided custom remote cache - even if they deploy on Vercel.
After this PR, the precedence works like this.
TURBO_TEAMID
+TURBO_TOKEN
are set we use those. ifTURBO_TEAM
is also set, we pass that along, too.TURBO_TEAM
+TURBO_TOKEN
are set we use those. ifTURBO_TEAMID
is also set we pass that along, too.VERCEL_ARTIFACTS_OWNER
+VERCEL_ARTIFACTS_TOKEN
are set, we use those (all else is ignored).TURBO_TEAMID
+TURBO_TEAM
, we pass those along.TURBO_TEAMID
is set, we pass that along.TURBO_TEAM
is set, we pass that along.TURBO_TEAM
andVERCEL_ARTIFACTS_OWNER
are set, we pass those alongVERCEL_ARTIFACTS_OWNER
is set, we pass that alongVERCEL_ARTIFACTS_TOKEN
andTURBO_TEAMID
are set, this is considered undefined/unsupported behavior. The reasons are that:VERCEL_ARTIFACTS_*
familyTesting Instructions
Take a look at the newly added tests in
override_env.rs
. You could run turbo while manually setting those same env vars.