这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@anthonyshew
Copy link
Contributor

Description

Fixes an issue where noUpdateNotifier: true in turbo.json did not suppress update notifications. The update notification logic was refactored to centralize all suppression checks (config and environment variables) in the caller, removing a redundant check that ignored the turbo.json setting.

Testing Instructions

  1. Add "noUpdateNotifier": true to your turbo.json.
  2. Ensure your turbo CLI version is older than the latest available.
  3. Run any turbo command (e.g., turbo run build).
  4. Verify that no update notification is displayed.

Linear Issue: TURBO-4878

Open in Cursor Open in Web

Move update notification check to shim to respect NO_UPDATE_NOTIFIER env var.

Co-authored-by: anthony.shew <anthony.shew@vercel.com>
@vercel
Copy link
Contributor

vercel bot commented Oct 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-designsystem-docs Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-gatsby-web Building Building Preview Comment Oct 7, 2025 5:19pm
examples-kitchensink-blog Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-nonmonorepo Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-svelte-web Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-tailwind-web Ready Ready Preview Comment Oct 7, 2025 5:19pm
examples-vite-web Ready Ready Preview Comment Oct 7, 2025 5:19pm
turbo-site Ready Ready Preview Comment Oct 7, 2025 5:19pm

@cursor
Copy link

cursor bot commented Oct 7, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments:

crates/turborepo-lib/src/config/turbo_json.rs (lines 48-82):
The no_update_notifier field from turbo.json is never transferred to ConfigurationOptions, causing the noUpdateNotifier setting to be completely ignored. This means users cannot disable update notifications via turbo.json configuration.

View Details
📝 Patch Details
diff --git a/crates/turborepo-lib/src/config/turbo_json.rs b/crates/turborepo-lib/src/config/turbo_json.rs
index 1041c18b8..89df31aef 100644
--- a/crates/turborepo-lib/src/config/turbo_json.rs
+++ b/crates/turborepo-lib/src/config/turbo_json.rs
@@ -78,6 +78,9 @@ impl<'a> TurboJsonReader<'a> {
         opts.env_mode = turbo_json.env_mode.map(|mode| *mode.as_inner());
         opts.cache_dir = cache_dir;
         opts.concurrency = turbo_json.concurrency.map(|c| c.as_inner().clone());
+        opts.no_update_notifier = turbo_json
+            .no_update_notifier
+            .map(|n| *n.as_inner());
         opts.future_flags = turbo_json.future_flags.map(|f| *f.as_inner());
         Ok(opts)
     }
@@ -227,4 +230,27 @@ mod test {
         let config = TurboJsonReader::turbo_json_to_config_options(turbo_json).unwrap();
         assert_eq!(config.allow_no_package_manager(), expected);
     }
+
+    #[test_case(None, false)]
+    #[test_case(Some(false), false)]
+    #[test_case(Some(true), true)]
+    fn test_no_update_notifier(value: Option<bool>, expected: bool) {
+        let turbo_json = RawRootTurboJson::parse(
+            &serde_json::to_string_pretty(
+                &(if let Some(value) = value {
+                    json!({
+                        "noUpdateNotifier": value
+                    })
+                } else {
+                    json!({})
+                }),
+            )
+            .unwrap(),
+            "turbo.json",
+        )
+        .unwrap()
+        .into();
+        let config = TurboJsonReader::turbo_json_to_config_options(turbo_json).unwrap();
+        assert_eq!(config.no_update_notifier(), expected);
+    }
 }

Analysis

Missing field transfer causes noUpdateNotifier configuration to be ignored

What fails: The turbo_json_to_config_options() function in crates/turborepo-lib/src/config/turbo_json.rs (line 48) does not transfer the no_update_notifier field from RawTurboJson to ConfigurationOptions, causing the noUpdateNotifier setting in turbo.json to be completely ignored.

How to reproduce:

  1. Create a turbo.json file with {"noUpdateNotifier": true}
  2. The field is properly deserialized into RawTurboJson.no_update_notifier (defined at line 136 of turbo_json/raw.rs)
  3. During conversion in turbo_json_to_config_options(), the field is never assigned to opts.no_update_notifier
  4. The ConfigurationOptions.no_update_notifier() method returns false (default) instead of true
  5. The check !config.no_update_notifier() in shim/mod.rs:319 fails to suppress update notifications

Result: Users cannot disable update notifications via turbo.json configuration. The setting is silently ignored.

Expected: The no_update_notifier field should be transferred during conversion, following the same pattern as other boolean fields like daemon and allow_no_package_manager (lines 77-78 of turbo_json.rs).

Evidence: The field exists in all necessary structs:

  • RawTurboJson (line 136 of turbo_json/raw.rs): pub no_update_notifier: Option<Spanned<bool>>
  • ConfigurationOptions (line 323 of config/mod.rs): pub(crate) no_update_notifier: Option<bool>
  • Getter method (line 479 of config/mod.rs): pub fn no_update_notifier(&self) -> bool

But the conversion in lines 73-83 of turbo_json.rs transfers 7 other fields (token, ui, allow_no_package_manager, daemon, env_mode, cache_dir, concurrency, future_flags) while omitting no_update_notifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants