Skip to content

test(cli): the packed gather-cache fixture keeps one guard against the background Core download [skip ci] - #13153

Closed
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/packed-gather-offline-release-check
Closed

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/packed-gather-offline-release-check

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

User impact

None for users. Test support only.

Problem and solution fit

  • The packed gather-cache tests compare a kept run with a fresh run. Once a CLI release is published, the packed CLI's background Core download (a global copy installs its own release into the release cache after a run) filled the kept temp folder's release cache, so the two runs named different versions in meta.answeredBy.
  • Main now guards against that twice: the fixture deletes the packed CLI's core-worker.mjs, so the download cannot start and a renamed step fails at once, and the fixture's runs also point npm at an unreachable registry.
  • One guard is enough, and the removed step is the precise one. This change drops the unreachable-registry settings (OFFLINE_REGISTRY) and their two uses. Their comment also described the download as a "release check" with a retry limit that never reached that npm call.
  • The answeredBy comparison stays.

Smallest restoration

  • packages/cli/test-utils/packed-gather-cache-fixture.mjs: 17 lines removed. No product code or record changes.

Scope

Components: none (test support only).

  • One defect is restored.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • packed-gather-cache.npm-packed.test.mjs on this head: 6/6 with the npm registry reachable (the case that failed before the core step was removed) and 6/6 with it unreachable.

preflight: pass 35a2e38

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

vercel Bot commented Nov 21, 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 21, 2026 1:19am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 1:41 AM UTC

@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 registry redirect fixes the kept/fresh mismatch, but the fixture's fetch-limit settings never take effect.

  • packed-gather-cache-fixture.mjs lines 108-109 and the description say npm is asked once with a short limit, but the CLI passes --fetch-retries=1 --fetch-timeout=30000 on npm's command line (BOUNDED_FETCH in foundation/release/cache.mjs), which outranks the npm_config_fetch_retries and npm_config_fetch_timeout variables, so drop lines 118-119 and correct the comment and the description (port 9 on loopback refuses at once, which is what keeps the runs fast).

With a stand-in registry that serves 0.7.17, the base fails the kept/fresh comparison on meta.answeredBy.core and this head passes 6/6 without contacting that registry. CI has not run on this head because its commit message carries [skip ci].

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Two npm-packed cases fail on main wherever the registry is reachable, because kept and fresh runs name different Core versions: verified (reproduced against a stand-in registry serving 0.7.17; the base reports core as "0.7.17" against null).
  • Each packed run starts the background release install, and since 0.7.17 was published it fills only the kept folder's release cache: verified (foundation/release/handoff.mjs:241-243, global-state.mjs:325-358, run-context.mjs:161-168).
  • NO_UPDATE_NOTIFIER does not turn that install off: verified (global-state.mjs:332 checks only CI and Windows; the fixture removes CI on purpose).
  • run() and runAsync() point npm and the @astryxdesign scope at a registry no request can reach: verified (fixture lines 115-117, 153 and 200).
  • They do so with one try and a short limit: false (the CLI's own --fetch-retries=1 --fetch-timeout=30000 override lines 118-119, so npm tries twice with a 30 s limit).
  • The door-conformance runs already use these settings: verified (test-utils/door-conformance.mjs:192-194).
  • A case that sets its own registry still wins: verified (...env comes last, fixture lines 166 and 204).
  • The answeredBy comparison stays: verified (the test file is unchanged and compares whole answers).
  • Test support only, with no product code or record changes: verified (one file under packages/cli/test-utils/, outside the published files list).
  • Main fails 2 of 6 cases with the registry reachable, and this change passes 6/6: verified in substance (against the stand-in, the base fails 4 of 6, the two named among them, and the head passes 6/6).

Files:

  • packages/cli/test-utils/packed-gather-cache-fixture.mjs: one finding (the inert fetch limits and the comment that describes them).

Automated review (maintainer link)

@josephfarina josephfarina changed the title test(cli): packed gather-cache runs keep the background release check offline [skip ci] test(cli): packed gather-cache runs keep the background Core download offline [skip ci] Nov 21, 2026
@josephfarina
josephfarina force-pushed the josephfarina/packed-gather-offline-release-check branch from 8e58582 to 9a1453d Compare November 21, 2026 00:42

@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 registry redirect fixes the kept/fresh mismatch and the earlier fetch-limit finding is fixed, but one sentence in the new comment is wrong.

  • The comment in packages/cli/test-utils/packed-gather-cache-fixture.mjs (lines 110-112) and the description say these runs clear CI because a CI run keeps no catalogs, but a CI: '1' run through this fixture keeps a catalog and reads it back (as packed-gather-cache.changes.test.mjs:166 already expects), so please state the actual reason for clearing CI in both places.

Against a stand-in registry that serves 0.7.17, the base fixture fails the kept/fresh comparison on meta.answeredBy.core and this head passes 6 of 6 without contacting it, and all 15 test files that import the fixture pass. CI has not run on this head because its commit message carries [skip ci].

Claims and files checked

Review mode: full; reason: history

Claims:

  • Two npm-packed cases fail on main wherever the registry is reachable, because kept and fresh runs name different Core versions: verified (against a stand-in registry serving 0.7.17, the base fails the two named cases and two more, with core "0.7.17" against null).
  • The packed CLI is a global copy whose exit-time background step installs its own release into the release cache beside the kept catalogs: verified (foundation/release/handoff.mjs:238-246, foundation/release/global-state.mjs:325-358; a fixture run leaves a failed-install record in its temp release cache).
  • Once the release is published, that install fills only the kept folder's release cache, so the two runs name different versions: verified (foundation/release/run-context.mjs:161-168 and the red-first run).
  • Only CI turns that download off: verified as an environment switch (global-state.mjs:332; NO_UPDATE_NOTIFIER does not).
  • These runs clear CI because a CI run keeps no catalogs: false (a CI: '1' run keeps a catalog and reads it back; packed-gather-cache.changes.test.mjs:166).
  • run() and runAsync() point npm and the @astryxdesign scope at a registry no request can reach: verified (fixture lines 117-120, spread at 153 and 200).
  • A case that sets its own registry keys still wins: verified (...env comes last, lines 166 and 204).
  • The answeredBy comparison stays: verified (no test file changes).
  • Test support only, with no product code or record changes: verified (one file under packages/cli/test-utils/, outside the published files list).
  • The fixture is shared by 15 test files: verified (15 importers).
  • The repository's Node tests pass with it: verified for the 15 files the change can affect (111 passed, 1 skipped); the rest do not import the fixture.
  • With the registry reachable main fails 2 of 6 and this change passes 6 of 6, and with it unreachable this change passes 6 of 6: verified in substance (against the stand-in the base fails 4 of 6, the two named among them, and the head passes 6 of 6; offline, the head passes 6 of 6).

Files:

  • packages/cli/test-utils/packed-gather-cache-fixture.mjs: one finding (the reason its comment gives for clearing CI).

Automated review (maintainer link)

…e background Core download, the removed core step [skip ci]
@josephfarina josephfarina changed the title test(cli): packed gather-cache runs keep the background Core download offline [skip ci] test(cli): the packed gather-cache fixture keeps one guard against the background Core download [skip ci] Nov 21, 2026
@josephfarina
josephfarina force-pushed the josephfarina/packed-gather-offline-release-check branch from 9a1453d to 35a2e38 Compare November 21, 2026 01:09

@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 run on this head yet.

Removing the registry redirect leaves the core-worker.mjs deletion as a complete guard: against a registry that serves 0.7.17, packed-gather-cache.npm-packed.test.mjs passes 6 of 6 at this head without a single registry request, while the fixture with neither guard fails 4 of 6 on meta.answeredBy.core. All 15 test files that import the fixture pass with no registry reachable. Both earlier findings went with the lines they were on.

  • Suggestion (non-blocking): packed-gather-cache.records.test.mjs lines 215-218 override only npm_config_registry, so for a contributor whose npm config sets an @astryxdesign scope registry, the "keeps no catalog gathered while Core could not be had" case now installs Core; adding 'npm_config_@astryxdesign:registry': 'http://127.0.0.1:9/' there (and dropping the inert npm_config_fetch_retries) keeps it offline.
Claims and files checked

Review mode: full; reason: history

Claims:

  • No user impact, test support only: verified (one file under packages/cli/test-utils/, outside the published files list).
  • Once a release is published, the packed CLI's background Core install filled only the kept temp folder's release cache, so kept and fresh runs named different versions in meta.answeredBy: verified (foundation/release/handoff.mjs:241-247, global-state.mjs:325-359; the fixture with neither guard fails 4 of 6 with core "0.7.17" against null).
  • Main guards twice: the fixture deletes core-worker.mjs, so the install cannot start and a renamed step fails at once, and its runs also point npm at an unreachable registry: verified (fixture line 564 without force; global-state.mjs:357 returns when the worker is missing; the redirect and its two spreads at the base).
  • One guard is enough, and the removed step is the precise one: verified for the background install (the head passes npm-packed 6 of 6 against a registry serving 0.7.17 with no request).
  • The change drops OFFLINE_REGISTRY and its two uses: verified (the diff).
  • The removed comment called the install a release check with a retry limit that never reached that npm call: verified (the CLI passes --fetch-retries=1 --fetch-timeout=30000 on npm's command line, foundation/release/cache.mjs:586-592 and :1366, which outranks npm_config_* variables).
  • The answeredBy comparison stays: verified (no test file changes; expectSameAsFresh compares whole answers).
  • 17 lines removed, no product code or record changes, no new public API: verified.
  • Public text carries no internal context: verified (title, body, branch and commit message).
  • npm-packed passes 6 of 6 with the registry reachable and 6 of 6 with it unreachable: verified (against a local registry serving the published 0.7.17 packages, and offline).

Files:

  • packages/cli/test-utils/packed-gather-cache-fixture.mjs: clear (one non-blocking note on a test that relied on the removed scope key).

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 21, 2026
- #13153 test(cli): the packed gather-cache fixture keeps one guard against the background Core download 
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #13165.

@github-actions
github-actions Bot deleted the josephfarina/packed-gather-offline-release-check branch November 21, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 35a2e387 Deployed Nov 21, 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