-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor(turborepo): derive Opts
from Config
#8759
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -682,8 +682,8 @@ pub struct ExecutionArgs { | |
/// Environment variable mode. | ||
/// Use "loose" to pass the entire existing environment. | ||
/// Use "strict" to use an allowlist specified in turbo.json. | ||
#[clap(long = "env-mode", default_value = "strict", num_args = 0..=1, default_missing_value = "strict")] | ||
pub env_mode: EnvMode, | ||
#[clap(long = "env-mode", num_args = 0..=1, default_missing_value = "strict")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We no longer assume |
||
pub env_mode: Option<EnvMode>, | ||
/// Use the given selector to specify package(s) to act as | ||
/// entry points. The syntax mirrors pnpm's syntax, and | ||
/// additional documentation and examples can be found in | ||
|
@@ -755,8 +755,8 @@ impl ExecutionArgs { | |
); | ||
} | ||
|
||
if self.env_mode != EnvMode::default() { | ||
telemetry.track_arg_value("env-mode", self.env_mode, EventType::NonSensitive); | ||
if let Some(env_mode) = self.env_mode { | ||
telemetry.track_arg_value("env-mode", env_mode, EventType::NonSensitive); | ||
} | ||
|
||
if let Some(output_logs) = &self.output_logs { | ||
|
@@ -1443,7 +1443,7 @@ mod test { | |
command: Some(Command::Run { | ||
execution_args: Box::new(ExecutionArgs { | ||
tasks: vec!["build".to_string()], | ||
env_mode: EnvMode::Strict, | ||
env_mode: Some(EnvMode::Strict), | ||
..get_default_execution_args() | ||
}), | ||
run_args: Box::new(get_default_run_args()) | ||
|
@@ -1452,28 +1452,13 @@ mod test { | |
} ; | ||
"env_mode: not fully-specified" | ||
)] | ||
#[test_case::test_case( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test is no longer needed since this behavior is not needed. |
||
&["turbo", "run", "build"], | ||
Args { | ||
command: Some(Command::Run { | ||
execution_args: Box::new(ExecutionArgs { | ||
tasks: vec!["build".to_string()], | ||
env_mode: EnvMode::Strict, | ||
..get_default_execution_args() | ||
}), | ||
run_args: Box::new(get_default_run_args()) | ||
}), | ||
..Args::default() | ||
} ; | ||
"env_mode: default strict" | ||
)] | ||
#[test_case::test_case( | ||
&["turbo", "run", "build", "--env-mode", "loose"], | ||
Args { | ||
command: Some(Command::Run { | ||
execution_args: Box::new(ExecutionArgs { | ||
tasks: vec!["build".to_string()], | ||
env_mode: EnvMode::Loose, | ||
env_mode: Some(EnvMode::Loose), | ||
..get_default_execution_args() | ||
}), | ||
run_args: Box::new(get_default_run_args()) | ||
|
@@ -1488,7 +1473,7 @@ mod test { | |
command: Some(Command::Run { | ||
execution_args: Box::new(ExecutionArgs { | ||
tasks: vec!["build".to_string()], | ||
env_mode: EnvMode::Strict, | ||
env_mode: Some(EnvMode::Strict), | ||
..get_default_execution_args() | ||
}), | ||
run_args: Box::new(get_default_run_args()) | ||
|
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.
Minor detail because
OptsInputs
derivesDebug
. This is a custom impl because printing thetoken
field seemed like a bad ideaThere 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.
is it possible this caused the CI failure by obscuring the token as
--token=***
?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.
Hmm I don't think so. Lemme see what's causing that