-
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.
fix(affected): don't respect empty scm env vars (#9053)
### Description Users can set empty string env vars which will end up getting chosen over our defaults. Empty env vars can accidentally get set when using [`docker compose`](https://docs.docker.com/compose/environment-variables/set-environment-variables/#additional-information) if a pass through env is declared in the YAML, but the shell does not have the var defined. This means that `Some("")` will no longer be a valid value in for `from_ref`. This is already the case for `TargetSelector`s from `--filter`s: [source](https://github.com/vercel/turborepo/blob/main/crates/turborepo-lib/src/run/scope/target_selector.rs#L145) This also allows us to remove the awkward comparison where we check if the scm base and skip calculating changes if it is `Some("")`, but do the calculation if it is `None`. ### Testing Instructions Added unit test to verify that empty scm env vars will not be respected.
- Loading branch information
1 parent
933d3a2
commit ca29f0f
Showing
2 changed files
with
22 additions
and
21 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