From 2e584dd2dfd351f7d72835b952c21401d223a364 Mon Sep 17 00:00:00 2001 From: Chris Olszewski Date: Tue, 14 Jan 2025 09:17:25 -0500 Subject: [PATCH] fix(cache): suggest proper --cache flag for --remote-cache-read-only --- crates/turborepo-cache/src/config.rs | 4 ++++ crates/turborepo-lib/src/cli/mod.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/turborepo-cache/src/config.rs b/crates/turborepo-cache/src/config.rs index 3c1289965bbf6..ee6f2bdccef1a 100644 --- a/crates/turborepo-cache/src/config.rs +++ b/crates/turborepo-cache/src/config.rs @@ -211,6 +211,10 @@ mod test { )] #[test_case("local:r", Ok(CacheConfig { local: CacheActions { read: true, write: false }, remote: CacheActions { read: false, write: false } }) ; "local:r" )] + #[test_case("remote:r", Ok(CacheConfig { local: CacheActions { read: false, write: false }, remote: CacheActions { read: true, write: false } }) ; "remote:r" + )] + #[test_case("local:rw,remote:r", Ok(CacheConfig { local: CacheActions { read: true, write: true }, remote: CacheActions { read: true, write: false } }) ; "local:rw,remote:r" + )] #[test_case("local:", Ok(CacheConfig { local: CacheActions { read: false, write: false }, remote: CacheActions { read: false, write: false } }) ; "empty action" )] #[test_case("local:,remote:", Ok(CacheConfig { local: CacheActions { read: false, write: false }, remote: CacheActions { read: false, write: false } }) ; "multiple empty actions" diff --git a/crates/turborepo-lib/src/cli/mod.rs b/crates/turborepo-lib/src/cli/mod.rs index 40c2c539bd979..2c2831dab588d 100644 --- a/crates/turborepo-lib/src/cli/mod.rs +++ b/crates/turborepo-lib/src/cli/mod.rs @@ -391,7 +391,7 @@ impl Args { if run_args.remote_cache_read_only.is_some() { warn!( "--remote-cache-read-only is deprecated and will be removed in a future major \ - version. Use --cache=remote:r" + version. Use --cache=local:rw,remote:r" ); } }