ci: Capture actual task durations under turbo 2.x summary schema#30908
Open
shortstacked wants to merge 2 commits into
Open
ci: Capture actual task durations under turbo 2.x summary schema#30908shortstacked wants to merge 2 commits into
shortstacked wants to merge 2 commits into
Conversation
…changelog) `send-build-stats.mjs` was reading `task.execution.durationMs` and `summary.durationMs`, neither of which exist in turbo 2.x summaries. Every row written to `qa_performance_metrics` therefore had value=0, silently breaking all duration-based queries against the table. Fix: derive durations from `execution.startTime`/`endTime`. For cache hits, use `cache.timeSaved` (the duration of the run that was avoided) because the execution window only covers cache restore overhead (~ms). Smoke-tested locally against a real `.turbo/runs/*.json` from turbo 2.9.4: 32/32 cache hits and 27/27 misses now report non-zero durations. No backfill possible — historical 0-value rows stay 0. Going forward, duration data starts flowing on the next CI run. Linear: https://linear.app/n8n/issue/DEVP-173 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Recommended reviewersBased on ownership of the 1 changed file in this PR:
|
…e-actual-task-durations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/scripts/send-build-stats.mjswas readingtask.execution.durationMsandsummary.durationMs— neither exist in turbo 2.x summariesqa_performance_metricstherefore hadvalue = 0, silently breaking all duration-based queries against the tableexecution.startTime/endTimefor misses, and usescache.timeSavedfor hits (the duration of the run that was avoided — more useful than the ~ms cache-restore window)Linear: https://linear.app/n8n/issue/DEVP-173
Root cause
Turbo 2.x summary schema (confirmed against an actual
.turbo/runs/*.jsonfrom 2.9.4):No
durationMsfield. The?? 0fallback in the script null-coalesced every row to 0. Counts (hit/miss) survived because they come fromtask.cache.status, but no timing data ever reached BigQuery under this turbo version.Bonus capture:
cache.timeSavedCache hits include
cache.timeSaved— the duration of the task whose execution turbo skipped. Far more useful for analytics than the cache-restore time (typically <5 ms). Now captured as the hit-side duration.Smoke test
Patched logic verified locally against a real summary file (build run, 59 tasks):
cache.timeSaved)endTime − startTime)Impact
qa_performance_metricsrows have correct durationsavg_miss_s,p95_miss_s,avg_hit_s,total_miss_hours)Expect
MAX(value) > 0for bothhitandmissrows.Test plan
qa-ci-cache-hit-dashboard.mdqueries in Hex against the fresh data — timing columns should populate🤖 Generated with Claude Code