-
Notifications
You must be signed in to change notification settings - Fork 874
fix: display build timings when all timings are loaded #15728
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
Conversation
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.
Looks good! Had one question to make sure I'm properly understanding something, but it's tiny and shouldn't cause any problems
const expectedScriptTimingsCount = workspace.latest_build.resources | ||
.flatMap((r) => r.agents) | ||
.flatMap((a) => a?.scripts) | ||
.filter((s) => s !== undefined).length; |
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.
Tiny nit, but I want to say this can be cleaned up as:
const expectedScriptTimingsCount = workspace.latest_build.resources
.flatMap((r) => r.agents)
.flatMap((a) => a?.scripts ?? []).length;
"workspaceBuilds", | ||
workspaceBuildId, | ||
"timings", | ||
{ readyAgentsCount }, |
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.
What was the readyAgentCount
value doing before? I see that we were only using it for the query key, and now it's gone
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.
It was to refetch the query when a new agent was marked as ready but it was very buggy and a bad decision on my end. The current refetch logic makes more sense and it is easier to follow.
Fix #15273