Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/turborepo-lib/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ pub struct ConfigurationOptions {
pub(crate) allow_no_turbo_json: Option<bool>,
pub(crate) tui_scrollback_length: Option<u64>,
pub(crate) concurrency: Option<String>,
#[serde(rename = "noUpdateNotifier")]
pub(crate) no_update_notifier: Option<bool>,
pub(crate) sso_login_callback_port: Option<u16>,
#[serde(skip)]
Expand Down
7 changes: 2 additions & 5 deletions crates/turborepo-lib/src/shim/local_turbo_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,10 @@ impl LocalTurboConfig {
}

// Used for testing when we want to manually set the controlling env var
fn infer_internal(repo_state: &RepoState, is_enabled: Option<bool>) -> Option<Self> {
fn infer_internal(repo_state: &RepoState, _is_enabled: Option<bool>) -> Option<Self> {
// TODO: once we have properly communicated this functionality we should make
// this opt-out.
if !is_enabled.unwrap_or(false) {
debug!("downloading correct local version not enabled");
return None;
}
debug!("FORCING local turbo binary. Download disabled.");
let turbo_version = Self::turbo_version_from_lockfile(repo_state)?;
Some(Self { turbo_version })
}
Expand Down
1 change: 1 addition & 0 deletions crates/turborepo-lib/src/shim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ fn try_check_for_updates(
None,
interval,
package_manager,
config.no_update_notifier.unwrap_or(false)
);
}
}
Expand Down
13 changes: 9 additions & 4 deletions crates/turborepo-updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ fn get_tag_from_version(pre: &semver::Prerelease) -> VersionTag {
}
}

fn should_skip_notification() -> bool {
fn should_skip_notification(config_no_update: bool) -> bool {
if config_no_update {
return true;
}

NOTIFIER_DISABLE_VARS
.iter()
.chain(ENVIRONMENTAL_DISABLE_VARS.iter())
Expand All @@ -99,11 +103,12 @@ pub fn display_update_check(
timeout: Option<Duration>,
interval: Option<Duration>,
package_manager: &PackageManager,
config_no_update: bool,
) -> Result<(), UpdateNotifierError> {
// bail early if the user has disabled update notifications
if should_skip_notification() {
return Ok(());
}
if should_skip_notification(config_no_update) {
return Ok(());
}

let version = check_for_updates(package_name, current_version, timeout, interval);

Expand Down