Repository navigation
ci: the Node record refresh reads each leg's whole log, and stops when a leg's log misses test files - #12657
Conversation
…n a leg's log misses test files
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 0a30bb8 |
…es too, and names a leg with no summary
|
/approve-spec 0ab8c46 |
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 219 | 219 | 0 |
| Runner pool, runner-minutes a day | 71,349 | 71,349 | 0 (0%) |
| Average concurrent jobs | 49.5 | 49.5 | 0 |
| Time to green (median → this run) | 64.5 min | 50 min | −14.6 min |
| Runs a day | 326 | 326 | 0 |
Other workflows: node-record-refresh.yml changed: runs on workflow_run, schedule (41 */6 * * *), workflow_dispatch; standard runners; its minutes are not measured here
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/node-record-refresh.mjs, .github/scripts/node-record-refresh.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes. The per-leg log read fixes the refresh's silent loss, and it checks out on main's run 44309827137: every leg's file count matches its Vitest summary, and record times 1,688 files. Two things need fixing first:
incompleteLegskeeps its own copy of the leg-log reader thatrecordDurationsinscripts/vitest-shard-sequencer.mjsalready owns (the colour-code strip and file-line patterns at.github/scripts/node-record-refresh.mjs:46-48and:119), and the two already disagree, since a todo-only file passes the guard but is never timed: export one reader from the sequencer, build both on it, and group the legs once fordriftedEntriesandincompleteLegs.- The description's test counts are wrong at this head: with the workflow and script changes reverted, 6 tests fail (four guard cases, not three), and the five-file run passes 506 tests, not 505.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the refresh read main's run with
gh run view --log. Verified in the base workflow's read step. - Claim: that reader stops at a job's first line over 64 KiB, and one Node test prints a 65,565-character line. Verified by reproduction: leg 11's log holds that line, and stopping there gives exactly the 74 files and the 67 older times in the open refresh pull request.
- Claim: leg 11 gave 74 of 141 files, the record took 1,621 of 1,688 results, and 26 entries kept older times. Verified against the run's leg logs and the refresh pull request's record.
- Claim: the read step downloads each leg's complete log and keeps the column shape the readers expect. Verified in
node-record-refresh.yml:81-91;recordreads the shaped logs. - Claim: a leg is complete when its log names as many files as its summary, skipped and todo files included, and
checkotherwise fails and writes no reasons. Verified innode-record-refresh.mjs:110-132and:258-264and by the four guard tests; the recorder does not time todo-only files (finding above). - Claim: the per-leg logs pass the guard,
recordtimes 1,688 files, andchecknames the same three drifted files. Verified. - Claim: with the changes reverted, 5 tests fail. False: 6 fail at this head.
- Claim: 27 tests pass in the refresh test file. Verified. Claim: 505 tests pass over the five listed files. False: 506 pass.
- Claim: Prettier is clean on the changed files. Verified.
- Claim: CI-only change, with no pull-request job, package or grader effect. Verified: the triggers are unchanged, and only comments elsewhere name these files.
- Claim: the open refresh pull request stays open and the next refresh updates it. Verified: the
prstep edits the open one. - File
.github/workflows/node-record-refresh.yml: clear; consistent with the script's input shape. - File
.github/scripts/node-record-refresh.mjs: duplicated log reader (first finding). - File
.github/scripts/node-record-refresh.test.mjs: clear; covers the read step, the long-line prefix and the guard cases.
…leteness checks share it, and a todo-only file is timed at 0
|
/approve-spec 899dd9d |
There was a problem hiding this comment.
Requesting changes. The leg-log reader now lives in one place and the guard counts exactly the files record writes, which fixes both earlier findings; on main's run 44309827137 every leg's file count matches its Vitest summary and record times 1,688 files. One thing needs fixing first:
- The description's Grader line says the change touches only the refresh workflow and its script, but this head also changes
scripts/vitest-shard-sequencer.mjs(the sequencervitest.config.tsloads for every sharded Vitest run) and its test, so please reword it to name the sequencer's log reader.
Optional: scripts/vitest-shard-sequencer.d.mts does not declare the three new exports (plainLog, nodeLegLogs, countedTestFiles); adding them keeps the declaration file complete.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: the refresh read main's run with
gh run view --log. Verified in the base workflow's read step. - Claim: that reader stops at a job's first line over 64 KiB, and one Node test prints a 65,565-character line. Verified: leg 11's job log holds that line, and stopping there leaves 74 of its 141 files.
- Claim: on that run, leg 11 gave 74 of 141 files, the record took 1,621 of 1,688 results, and 26 entries kept older times. Verified on the run's leg logs at this head.
- Claim: the read step lists the run's
test-node (N)jobs, downloads each job's whole log and gives each line its leg's name and a step column. Verified innode-record-refresh.yml:81-91and by the long-line test. - Claim: the sequencer owns the one leg-log reader (
plainLog,nodeLegLogs,countedTestFiles,recordDurations). Verified invitest-shard-sequencer.mjs:95-169. - Claim:
recordDurationsrecords a file whose tests are all skipped or todo at 0, as it did for a wholly skipped file. Verified invitest-shard-sequencer.mjs:152-166, the base code and the new test. - Claim:
driftedEntriesandincompleteLegsboth read the legs throughnodeLegLogsandrecordDurations. Verified innode-record-refresh.mjs:78-111. - Claim: a leg is complete when it times as many files as its summary counts, and
checkotherwise fails, writes no reasons and names the leg. Verified innode-record-refresh.mjs:109and:237-243, the workflow's step order and the four guard tests. - Claim: before the change, the guard on the old read reports leg 11 at 74 files with no summary, and
recordtimes 1,621. Verified. - Claim: after the change, every leg passes (leg 11: 141,
139 passed | 2 skipped (141)),recordtimes 1,688, andchecknames the same three drifted files. Verified. - Claim: with the workflow, script and sequencer reverted, 8 of 52 tests fail, as listed. Verified.
- Claim: product and runtime behaviour is unchanged, with no package code. Verified: no package file changes.
- Claim: no pull-request job changes, and the refresh runs on a standard runner about hourly after main's full unit run, with one jobs listing and one log download per Node leg. Verified; the few added seconds were not measured.
- Claim: no grader effect, because the change touches only the refresh workflow and its script. False: it also changes the sequencer and its test (finding above); no grader reads any of these files.
- Claim: no public API, product or policy change, and no internal context in public text. Verified.
- Claim: the open refresh pull request stays open, and the next refresh updates it. Verified: the
prstep edits the open one. - Claim: the two test files pass 52 tests, the seven-file run passes 549, and Prettier is clean. Verified.
- File
.github/workflows/node-record-refresh.yml: clear. - File
.github/scripts/node-record-refresh.mjs: clear; the duplicated reader is gone. - File
.github/scripts/node-record-refresh.test.mjs: clear. - File
scripts/vitest-shard-sequencer.mjs: clear; optional declaration update above. - File
scripts/vitest-shard-sequencer.test.mjs: clear.
|
/approve-spec 1f49bc3 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet. Both points from the last review are addressed. The description's Grader line now names the sequencer's leg-log reader, and scripts/vitest-shard-sequencer.d.mts declares plainLog, nodeLegLogs and countedTestFiles. Replayed through this head, main's run 44309827137 has every Node leg timing exactly its summary's file count, record times 1,688 files, and cutting leg 11 at its 65,565-character line makes check fail by name and write nothing.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: the refresh drops part of one Node leg on every run, so its pull request keeps older times and its "every measured file takes that run's time" line is false. Verified on runs 44309827137 (leg 11) and 44369635194 (leg 10), which lose 67 results each.
- Claim: the old read used
gh run view --log. Verified in the base workflow. - Claim: that reader stops at a job's first line over 64 KiB, and one Node test prints a 65,565-character line. Verified: the line is in leg 11's job log, and stopping there leaves 74 of its 141 files.
- Claim: on run 44309827137, leg 11 gave 74 of 141 files, the record took 1,621 of 1,688 results, and 26 entries kept older times. Verified. The open refresh pull request has since been refreshed from run 44369635194, which loses results the same way.
- Claim: the refresh records every file a leg ran or writes no record, and the legs still split by recorded time. Verified:
checkstops before the record step, and the split and order code is unchanged. - Claim: the read step lists the run's
test-node (N)jobs, downloads each whole log, and gives each line its leg's name and a step column. Verified innode-record-refresh.yml:81-91and by the long-line test. - Claim: the sequencer owns the one leg-log reader and records a file whose tests are all skipped or todo at 0. Verified in
vitest-shard-sequencer.mjs:91-169and by its new test. - Claim: both refresh checks read the legs through that reader. A leg is complete when it times as many files as its summary counts; otherwise
checkfails, writes no reasons and names the leg. Verified innode-record-refresh.mjs:78-111and:232-243and by the four guard tests. - Claim: before the change, the guard on the old read reports leg 11 at 74 files with no summary, and
recordtimes 1,621. Verified by replay. - Claim: after the change, every leg passes (leg 11: 141 of 141),
recordtimes 1,688 andchecknames the same three drifted files. Verified by replay. - Claim: with the workflow, script and sequencer reverted, 8 of 52 tests fail, as listed. Verified.
- Claim: no product or package code changes. Verified.
- Claim: no pull-request job changes, and the refresh runs on a standard runner about hourly after main's full unit run, with one jobs listing and one log download per Node leg. Verified; the added seconds were not measured.
- Claim: no grader effect, because the change touches the refresh workflow, its script and the sequencer's leg-log reader and leaves the split and order alone. Verified: no grader reads these files.
- Claim: no public API, product or policy change, and no internal context in public text. Verified.
- Claim: the open refresh pull request stays open, and the next refresh updates it. Verified: the
prstep edits the open one. - Claim: the two test files pass 52 tests, the seven-file run passes 549, the declaration file lists the three helpers, and Prettier is clean. Verified.
- File
.github/workflows/node-record-refresh.yml: clear. - File
.github/scripts/node-record-refresh.mjs: clear. - File
.github/scripts/node-record-refresh.test.mjs: clear. - File
scripts/vitest-shard-sequencer.mjs: clear. - File
scripts/vitest-shard-sequencer.d.mts: clear; it declares the three new exports. - File
scripts/vitest-shard-sequencer.test.mjs: clear.
Maintainer impact
The scheduled Node record refresh drops part of one Node leg on every run, so its pull request keeps older times for those files, and its description ("every measured file takes that run's time") is false each time. The refresh read main's run with
gh run view --log. That command stops reading a job's log at the first line over 64 KiB. One Node test prints a 65,565-character line, so the leg that runs it loses every result after that line. On the latest refresh (main's run https://github.com/meta/astryx/actions/runs/44309827137),test-node (11)gave 74 of its 141 files. The record took 1,621 of the 1,688 results, and 26 entries kept older times.Intended invariant
The refresh records every Node test file a leg ran, or it writes no record. The Node legs still split by recorded time; which files run never depends on the record (AST-030 FR22).
Change
.github/workflows/node-record-refresh.yml: the read step lists the run'stest-node (N)jobs and downloads each job's complete log from the jobs logs endpoint, which returns the raw text. Each line gets its leg's name and a step column, the same shapegh run view --logprinted, so the check andrecordread it unchanged.scripts/vitest-shard-sequencer.mjsowns the one leg-log reader:plainLog(colour codes out),nodeLegLogs(a run's lines grouped by Node leg),countedTestFiles(a leg's VitestTest Files … (N)total, or null) andrecordDurations.recordDurationsnow also records a file none of whose tests run (each skipped or todo) at 0, as it already did for a wholly skipped file, so every file the reporter names gets an entry..github/scripts/node-record-refresh.mjs:driftedEntriesand the newincompleteLegsboth read the legs throughnodeLegLogsandrecordDurations. A leg counts as complete when it times as many files as its summary counts.checkfails, writes no reasons, and so opens or refreshes no pull request, when a leg times fewer files or has no summary (a leg that crashed). The error names each such leg.Evidence
check --log <gh run view --log output>with this branch's guard reportstest-node (11): 74 files read, no Test Files summary.recordon that log times 1,621 files.test-node (11): 141,Test Files 139 passed | 2 skipped (141)).recordtimes 1,688 files, every result in the leg logs.checknames the same three drifted files.node-record-refresh.test.mjsthe read step, the long-line prefix and the four guard cases; invitest-shard-sequencer.test.mjsthe todo-only file and the leg grouping with its summary count.scripts/vitest-shard-sequencer.mjs(recordDurationsand its new helpers). The sequencer's split and order, which every sharded Vitest run loads, are unchanged, and no grader reads the record or these logs.Scope
Components: none
The open refresh pull request on
ci/node-durations-refreshstays open. The next refresh after this merges re-records from complete leg logs and updates it.Testing
CI=1 vitest run --project node .github/scripts/node-record-refresh.test.mjs scripts/vitest-shard-sequencer.test.mjs: 52 passed.gh run view.checkexits 1 on an incomplete leg and on a leg with no summary, names the leg, and writes no reasons.CI=1 vitest run --project nodeovernode-record-refresh,vitest-shard-sequencer,vitest-node-legs,ci-actionlint,ci-run-scripts-parse,workflow-pathsandtooling-surface-contract: 549 passed.scripts/vitest-shard-sequencer.d.mtsdeclaresplainLog,nodeLegLogsandcountedTestFiles.