Skip to content

ci: the Node record refresh reads each leg's whole log, and stops when a leg's log misses test files - #12657

Merged
josephfarina merged 4 commits into
mainfrom
ci/node-record-whole-leg-logs
Nov 18, 2026
Merged

josephfarina merged 4 commits into
mainfrom
ci/node-record-whole-leg-logs

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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's test-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 shape gh run view --log printed, so the check and record read it unchanged.
  • scripts/vitest-shard-sequencer.mjs owns the one leg-log reader: plainLog (colour codes out), nodeLegLogs (a run's lines grouped by Node leg), countedTestFiles (a leg's Vitest Test Files … (N) total, or null) and recordDurations. recordDurations now 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: driftedEntries and the new incompleteLegs both read the legs through nodeLegLogs and recordDurations. A leg counts as complete when it times as many files as its summary counts. check fails, 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

  • Failure before the change, on main's run 44309827137: check --log <gh run view --log output> with this branch's guard reports test-node (11): 74 files read, no Test Files summary. record on that log times 1,621 files.
  • Success after the change, on the same run: the per-leg logs pass the guard (each leg's file count equals its summary, for example test-node (11): 141, Test Files 139 passed | 2 skipped (141)). record times 1,688 files, every result in the leg logs. check names the same three drifted files.
  • Red first: with the workflow, refresh script and sequencer changes reverted to the base, 8 of 52 tests fail: in node-record-refresh.test.mjs the read step, the long-line prefix and the four guard cases; in vitest-shard-sequencer.test.mjs the todo-only file and the leg grouping with its summary count.
  • Product/runtime behavior verified unchanged: CI-only change; no package code.
  • CI impact: no pull-request job changes. The refresh job (standard runner, about hourly after main's full unit run) makes one jobs listing and one log download per Node leg (12) instead of one whole-run log download. That adds a few seconds, and the job reads only the Node legs instead of every job's log.
  • Grader: no grader effect. The change touches the refresh workflow, its script, and the leg-log reader in scripts/vitest-shard-sequencer.mjs (recordDurations and 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

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

The open refresh pull request on ci/node-durations-refresh stays 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.
    • The read step downloads each leg's job log and runs no gh run view.
    • A leg log with a 65,600-character line keeps every line, each led by its leg's name, and passes the guard.
    • A complete leg passes, and so does a leg with skipped and todo files.
    • A leg that timed fewer files than its summary, and a leg with no summary, are named.
    • check exits 1 on an incomplete leg and on a leg with no summary, names the leg, and writes no reasons.
    • The sequencer records a todo-only or skipped-and-todo file at 0, groups a run's lines by Node leg, and reads a leg's summary total, colour codes included.
  • CI=1 vitest run --project node over node-record-refresh, vitest-shard-sequencer, vitest-node-legs, ci-actionlint, ci-run-scripts-parse, workflow-paths and tooling-surface-contract: 549 passed.
  • scripts/vitest-shard-sequencer.d.mts declares plainLog, nodeLegLogs and countedTestFiles.
  • Prettier clean on the changed files.

@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 18, 2026 8:14pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 8:23 PM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0a30bb8

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0ab8c46

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 899dd9d

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

CI impact: 0 job-min per update · pool 0% · time to green −14.6 min · standard runners · 1 other workflow changed (not measured) · 2 CI action or script files changed (not measured)
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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • incompleteLegs keeps its own copy of the leg-log reader that recordDurations in scripts/vitest-shard-sequencer.mjs already owns (the colour-code strip and file-line patterns at .github/scripts/node-record-refresh.mjs:46-48 and :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 for driftedEntries and incompleteLegs.
  • 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; record reads the shaped logs.
  • Claim: a leg is complete when its log names as many files as its summary, skipped and todo files included, and check otherwise fails and writes no reasons. Verified in node-record-refresh.mjs:110-132 and :258-264 and by the four guard tests; the recorder does not time todo-only files (finding above).
  • Claim: the per-leg logs pass the guard, record times 1,688 files, and check names 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 pr step 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.

Automated review (maintainer link)

Comment thread .github/scripts/node-record-refresh.mjs Resolved
…leteness checks share it, and a todo-only file is timed at 0
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 899dd9d

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sequencer vitest.config.ts loads 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 in node-record-refresh.yml:81-91 and by the long-line test.
  • Claim: the sequencer owns the one leg-log reader (plainLog, nodeLegLogs, countedTestFiles, recordDurations). Verified in vitest-shard-sequencer.mjs:95-169.
  • Claim: recordDurations records a file whose tests are all skipped or todo at 0, as it did for a wholly skipped file. Verified in vitest-shard-sequencer.mjs:152-166, the base code and the new test.
  • Claim: driftedEntries and incompleteLegs both read the legs through nodeLegLogs and recordDurations. Verified in node-record-refresh.mjs:78-111.
  • Claim: a leg is complete when it times as many files as its summary counts, and check otherwise fails, writes no reasons and names the leg. Verified in node-record-refresh.mjs:109 and :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 record times 1,621. Verified.
  • Claim: after the change, every leg passes (leg 11: 141, 139 passed | 2 skipped (141)), record times 1,688, and check names 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 pr step 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.

Automated review (maintainer link)

Comment thread scripts/vitest-shard-sequencer.mjs Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 1f49bc3

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: check stops 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 in node-record-refresh.yml:81-91 and 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-169 and 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 check fails, writes no reasons and names the leg. Verified in node-record-refresh.mjs:78-111 and :232-243 and 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 record times 1,621. Verified by replay.
  • Claim: after the change, every leg passes (leg 11: 141 of 141), record times 1,688 and check names 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 pr step 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.

Automated review (maintainer link)

@josephfarina
josephfarina merged commit c0442f7 into main Nov 18, 2026
78 checks passed
@github-actions
github-actions Bot deleted the ci/node-record-whole-leg-logs branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 1f49bc3d Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant