-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle VERCEL_ARTIFACTS_* env vars override (#9249)
### Description The prior intended state of EnvVars overrides looked like this: <br /> <div align="center"> <div><sub><em>`VERCEL_ARTIFACTS_*` always wins</em></sub></div> <br /> <img width="75%" src="https://github.com/user-attachments/assets/b8f5428a-acaa-4323-9b47-006a3dbc9a42" /> </div> <br /> <br /> 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. 1. if both `TURBO_TEAMID`+`TURBO_TOKEN` are set we use those. if `TURBO_TEAM` is also set, we pass that along, too. 1. if both `TURBO_TEAM`+`TURBO_TOKEN` are set we use those. if `TURBO_TEAMID` is also set we pass that along, too. 1. if both `VERCEL_ARTIFACTS_OWNER`+`VERCEL_ARTIFACTS_TOKEN` are set, we use those (all else is ignored). 1. if both `TURBO_TEAMID`+`TURBO_TEAM`, we pass those along. 1. if just `TURBO_TEAMID` is set, we pass that along. 1. if just `TURBO_TEAM` is set, we pass that along. 1. if both `TURBO_TEAM` and `VERCEL_ARTIFACTS_OWNER` are set, we pass those along 1. if just `VERCEL_ARTIFACTS_OWNER` is set, we pass that along 1. we do not support or consider partial configurations. For example if only `VERCEL_ARTIFACTS_TOKEN` and `TURBO_TEAMID` are set, this is considered undefined/unsupported behavior. The reasons are that: - this shouldn't ever happen - Vercel sets both or none of the `VERCEL_ARTIFACTS_*` family - we tried doing this, but the combinatorial explosion that results is pretty major, and some of the cases are very strange to reason about, considering the above point that we don't expect there to be any genuine scenario where this happens, anyway. ### Testing Instructions Take a look at the newly added tests in `override_env.rs`. You could run turbo while manually setting those same env vars. --------- Co-authored-by: Chris Olszewski <[email protected]>
- Loading branch information
1 parent
5c36b0b
commit 9375ef9
Showing
3 changed files
with
463 additions
and
91 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.