Skip to content

test(cli): the kept-value cases that read a value back skip on a Node without module hooks - #12353

Merged
cixzhang merged 1 commit into
mainfrom
lane4/gather-value-min-node
Nov 18, 2026
Merged

cixzhang merged 1 commit into
mainfrom
lane4/gather-value-min-node

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

On Node 22.13.0, the oldest Node the CLI supports, three cases in packages/cli/foundation/fs/gather-cache.value.test.mjs fail (expected 2 to be 1, expected 3 to be 2, and The "path" argument must be … Received undefined). That keeps the daily minimum-Node run red. The cases are:

  • "a value kept by its key › is kept in a run that keeps catalogs, and a later run reads it back without working it out"
  • "… › is a miss, and is stored over, when its kept value was changed"
  • "… › is a miss under another CLI build"

Intended invariant

Users of 22.13 lose nothing. recordRun() in gather-cache.mjs keeps catalogs only through module.registerHooks, which Node has from 22.15 and 23.5. Without it, the run works out every value and keeps nothing, by design (if (typeof registerHooks !== 'function' …) return fn()): the answers are the same, only uncached. The three cases read a kept value back, so on 22.13 there is nothing to read. gather-cache.test.mjs already skips its own kept-run cases the same way.

Change

  • The three cases are it.skipIf(!hasModuleHooks), with the shared hasModuleHooks from test-utils/module-hooks.mjs, and a comment says why. The three cases that check what happens outside a kept run, or when nothing is kept, still run on every Node.
  • No product file changes.

The cases came in with #12166, which added this test file.

Scope

  • 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.

Testing

  • Node 22.13.0: 3 passed, 3 skipped (before: 3 failed, 3 passed).
  • On current Node the three cases run as before. On this macOS machine they fail at this base as well, for a reason this change does not touch; Linux CI passes them.

Overlap checked: #12219 (it edits gather-cache.mjs, not this test file)

Owner: fix-loop lane 4. Land path: Specs ledger row, CodeBunny, CI, then the drain merges.

… without module hooks

A run keeps catalogs only through module.registerHooks, which Node has
from 22.15 and 23.5. On Node 22.13, the oldest the CLI supports, every
value is worked out and nothing is kept, by design, so the three cases
that read a kept value back failed there. They now skip on that Node, as
gather-cache.test.mjs already does.
@vercel

vercel Bot commented Nov 17, 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 17, 2026 3:44pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 9:13 AM UTC

@cixzhang cixzhang added the lane:4 Astryx fix-loop lane 4 owns this label Nov 17, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec d299da1

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d299da1

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.


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.

Approved pending CI: the required checks are still running on this head.

The change does what it says: on Node 22.13.0 the three read-back cases now skip instead of failing, the three nothing-kept cases still pass, and on current Node all six cases run and pass. No product code, public API or spec record changes. The daily minimum-Node run on main also fails in other test files and its global-mode smoke today, so this change alone will not turn that run green.

Claims and files checked

Review mode: same-head; reason: none

  • Claim: on Node 22.13.0, the oldest Node the CLI supports, the three named cases fail with the three quoted errors and keep the daily minimum-Node run red: verified (engines.node is >=22.13.0; reproduced at the base on 22.13.0; the latest daily run reports the same three failures, beside failures in other files).
  • Claim: a run keeps catalogs only through module.registerHooks, which Node has from 22.15 and 23.5, and without it every value is worked out and nothing is kept: verified (gather-cache.mjs:374-375 and :1145).
  • Claim: gather-cache.test.mjs already skips its kept-run cases the same way: verified (gather-cache.test.mjs:17-23).
  • Claim: the three cases use it.skipIf(!hasModuleHooks) with the shared helper and a comment, and the other three still run on every Node: verified (lines 15, 103-107, 170 and 192; the other three pass on 22.13.0).
  • Claim: users of Node 22.13 lose nothing and no product file changes: verified (only this test file changes).
  • Claim: the cases came in with #12166: verified (the file's history).
  • Claim: Node 22.13.0 gives 3 passed and 3 skipped, against 3 failed and 3 passed before: verified (reproduced, also with this change merged into current main).
  • Claim: on current Node the three cases run as before and pass on Linux: verified (Node 24.20.0 on Linux, 6 passed); the macOS failure at the base was not reproduced and is outside this change.
  • Claim: #12219 edits gather-cache.mjs, not this test file: verified (its file list).
  • File packages/cli/foundation/fs/gather-cache.value.test.mjs: clear; consistent with the unchanged test-utils/module-hooks.mjs and gather-cache.mjs.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 18, 2026 08:48
@cixzhang
cixzhang merged commit d0d7121 into main Nov 18, 2026
138 checks passed
@github-actions
github-actions Bot deleted the lane4/gather-value-min-node branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — d299da10 Deployed Nov 17, 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. lane:4 Astryx fix-loop lane 4 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant