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

chore(cache): add deprecation warnings to old cache flags #9428

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

Merged
merged 3 commits into from
Nov 12, 2024

Conversation

chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Nov 12, 2024

Description

With introduction of --cache and TURBO_CACHE add deprecation flags to the "old" cache config options.

We also now will only throw on the mixing of cache env vars and TURBO_CACHE if they do not agree. An exception is TURBO_FORCE which will override.

Testing Instructions

[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_ONLY=1 turbo_dev @turbo/types#lint > /dev/null           
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:rw
[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 turbo_dev @turbo/types#lint > /dev/null
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_CACHE_READ_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:r
[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo_dev @turbo/types#lint --no-cache > /dev/null           
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
 WARNING  --no-cache is deprecated and will be removed in a future major version. Use --cache=local:r,remote:r
turbo 2.2.4-canary.9

[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo_dev @turbo/types#lint --remote-only > /dev/null           
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
 WARNING  --remote-only is deprecated and will be removed in a future major version. Use --cache=remote:rw
turbo 2.2.4-canary.9

[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ turbo_dev @turbo/types#lint --remote-cache-read-only > /dev/null      
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
 WARNING  --remote-cache-read-only is deprecated and will be removed in a future major version. Use --cache=remote:r
turbo 2.2.4-canary.9
[1 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 turbo_dev @turbo/types#lint > /dev/null 
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_CACHE_READ_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:r
[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 turbo_dev @turbo/types#lint > /dev/null
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_CACHE_READ_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:r
[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 TURBO_CACHE=remote:r turbo_dev @turbo/types#lint > /dev/null
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 TURBO_CACHE=remote:rw turbo_dev @turbo/types#lint > /dev/null
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_CACHE_READ_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:r
  x Cannot set `cache` config and other cache options (`force`, `remoteOnly`,
  | `remoteCacheReadOnly`) at the same time

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2024 10:36pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Nov 12, 2024 10:36pm

@chris-olszewski chris-olszewski marked this pull request as ready for review November 12, 2024 21:22
@chris-olszewski chris-olszewski requested a review from a team as a code owner November 12, 2024 21:22
@chris-olszewski chris-olszewski enabled auto-merge (squash) November 12, 2024 21:28
Comment on lines +85 to +88
warn!(
"TURBO_REMOTE_ONLY is deprecated and will be removed in a future major version. \
Use TURBO_CACHE=remote:rw"
);
Copy link
Member

Choose a reason for hiding this comment

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

@anthonyshew high priority we have to set this on vercel before we ship this. I can spin this up quick

@@ -80,7 +81,19 @@ impl ResolvedConfigurationOptions for EnvVars {

let force = self.truthy_value("force").flatten();
let remote_only = self.truthy_value("remote_only").flatten();
if remote_only.is_some() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we check for TURBO_REMOTE_ONLY and NOT TURBO_CACHE? Because we have to double set this on Vercel to get this to work without a deprecation warning

Copy link
Member Author

Choose a reason for hiding this comment

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

We throw if you use legacy cache options with TURBO_CACHE:

[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo $ TURBO_REMOTE_CACHE_READ_ONLY=1 turbo_dev @turbo/types#lint --cache=remote:rw > /dev/null
 WARNING  No locally installed `turbo` found. Using version: 2.2.4-canary.9.
turbo 2.2.4-canary.9

 WARNING  TURBO_REMOTE_CACHE_READ_ONLY is deprecated and will be removed in a future major version. Use TURBO_CACHE=remote:r
  x Cannot set `cache` config and other cache options (`force`, `remoteOnly`,
  | `remoteCacheReadOnly`) at the same time

@chris-olszewski chris-olszewski merged commit 3a34e34 into main Nov 12, 2024
39 checks passed
@chris-olszewski chris-olszewski deleted the olszewski/chore_deprecate_cache_flags branch November 12, 2024 23:06
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