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
fix: add extra detail to summary showing items from remote cache #7697
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
9 Ignored Deployments
|
🟢 Turbopack Benchmark CI successful 🟢Thanks |
🟢 CI successful 🟢Thanks |
@@ -159,14 +168,23 @@ impl<'a> ExecutionSummary<'a> { | |||
fn successful(&self) -> usize { | |||
self.success + self.cached | |||
} | |||
|
|||
fn add_cached(&mut self, source: CacheSource) { | |||
self.cached += 1; |
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.
To preserve run summary output we just add a new field for remote rather than splitting into two. Naturally cached - cached_remote = cached_local if we need it one day.
@@ -159,14 +168,23 @@ impl<'a> ExecutionSummary<'a> { | |||
fn successful(&self) -> usize { | |||
self.success + self.cached | |||
} | |||
|
|||
fn add_cached(&mut self, source: CacheSource) { |
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 don't see this used anywhere so I think it can get removed? In general I think we don't want to be changing the counts on the ExecutionSummary
and have all modifications happen to SummaryState
@@ -82,6 +86,12 @@ impl<'a> ExecutionSummary<'a> { | |||
String::new() | |||
}; | |||
|
|||
let cache_line = if self.cached_remote > 0 { | |||
format!("{} (of which {} remote)", self.cached, self.cached_remote) |
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.
Don't want to bikeshed this a ton, but I feel like we can simplify this to just 10 (8 remote)
or 10 (2 local, 8 remote)
.
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'd love to see something like this in our run summary:
interface Cache {
restoredFrom: "local" | "remote" | undefined,
hit: {
local: boolean | "unknown",
remote: boolean | "unknown",
},
enabled: {
local: boolean,
remote: boolean,
}
};
Description
A quick fix that closes #2129
It adds a small additional UI when tasks are loaded from the remote
cache. Tasks that were not fetched from cache do not have the extra
annotation and retain the original formatting.
Testing Instructions
Run a build with remote cache set up:
Tasks: 0 successful, 2 total
Cached: 2 (of which 2 remote) cached, 2 total
Time: 1.141s
Run another build:
Tasks: 0 successful, 2 total
Cached: 2 cached, 2 total
Time: 1.141s
Closes TURBO-2590