-
Notifications
You must be signed in to change notification settings - Fork 2k
Error on no caches #1169
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
Error on no caches #1169
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -65,11 +71,11 @@ func newSyncCache(config *config.Config, remoteOnly bool, recorder analytics.Rec | |||
mplex.caches = append(mplex.caches, newHTTPCache(config, recorder)) | |||
} | |||
if len(mplex.caches) == 0 { | |||
return nil | |||
return nil, ErrNoCachesEnabled |
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.
Upstream addressed this a bit differently: thought-machine/please@e0b5e29
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.
I thought about doing that, but decided against it because having no available caches likely represents user error. Currently, the only way to disable filesystem caching entirely is by passing --remote-only
, which definitely suggests a desire to use the http cache. Even in the case of --no-cache
, we still try to read from the cache. So in the event that we cannot use any cache, it's probably an error that should be reported.
FWIW, for future direction, I don't think our architectural needs directly track with upstream, and I am not sure that reading from the cache when --no-cache
is passed is the right thing to do, and I think that we could do with a bit of a refactor of our cache abstraction to simplify the code in run.go
.
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.
turbo
still gives benefits from the topsort so running without using cache isn't entirely nonsensical. Intentionally not using caches is likely a debugging scenario.
Aside, this is itching for a better UI:
- Don't write cache:
--no-cache
- Don't read cache:
--force
orTURBO_FORCE
- Don't read/write local cache:
--remote-only
orTURBO_REMOTE_ONLY
- Don't read/write remote cache:
turbo logout
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.
I'm all for a better set of flags here, including a way to run local-only without logging out (or unlinking)
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.
Because I can't configure Kodiak to play nicely without a review in #1171, I can't approve this without it being auto-merged. This is a perfect fixship
candidate but I can't do it yet. 🤷♂️
…t. (#1317) This makes it possible for a repository whose CI configuration is `--remote-only` to work when receiving pull-requests from forked repositories that do not have access to secrets configuration in CI. Example failures: - #1302: [Error](https://github.com/vercel/turborepo/runs/6681959655?check_suite_focus=true#step:8:56) - vercel/vercel#7575: [Error](https://github.com/vercel/vercel/runs/6599439965?check_suite_focus=true#step:10:12) One example workaround: vercel/vercel#7873 However, since this does not prevent the build from running to completion, I do not believe that it should be a hard error. While in the process of addressing this I also discovered that, since the `httpCache` can remove itself, there is an alternative path to triggering a panic if the `httpCache` is the only cache you have enabled and it removes itself. Using a `noopCache` as a cache of last resort (similar to the [upstream solution](thought-machine/please@e0b5e29)) resolves both of these issues. Related to: #1169
Fixes #1167