Skip to content

fix(map-store): bound and never-prompt the partial-clone checkout - #1428

Merged
BenSheridanEdwards merged 1 commit into
mainfrom
fix/map-store-checkout-timeout
Nov 16, 2026
Merged

BenSheridanEdwards merged 1 commit into
mainfrom
fix/map-store-checkout-timeout

Conversation

@BenSheridanEdwards

Copy link
Copy Markdown
Owner

Why

Map-store checkout of a partial clone runs git sparse-checkout set and git checkout through the plain git() helper, which has no timeout and allows terminal prompts. On a filter clone that checkout is where the trees and blobs are actually downloaded. A stalled remote therefore hangs until the CI job timeout, instead of failing after mapStore.gitTimeoutMs and being retried as an infra fault, as ls-remote and clone already are.

Fixes #1410.

What changed

  • checkoutSparseSegment now takes gitTimeoutMs and runs both commands through networkGit, which sets the timeout and GIT_TERMINAL_PROMPT=0.
  • Failures use gitFailureMessage, so a stall surfaces as ETIMEDOUT. restoreMapStoreAttempt still classifies that as infra, and retryBlocking retries it.
  • Clone, ls-remote, and default timeout values are unchanged.
  • Tests intercept spawnSync with a 37 ms timeout: both commands are asserted to be bounded and never-prompting, and a simulated stall on either command is retried twice with the timeout message preserved.
  • CHANGELOG records the fix under Unreleased.

Reviewer view

function checkoutSparseSegment(tmp, branch, segment, gitTimeoutMs) {
  const sparse = networkGit(tmp, ['sparse-checkout', 'set', segment], gitTimeoutMs);
  const checkout = sparse.status === 0 ? networkGit(tmp, ['checkout', '-q', branch], gitTimeoutMs) : sparse;
}

Proof

  • Tests: pnpm run build && node --test test/map-store-checkout-timeout.test.mjs — red 3 failed (timeout undefined vs 37); green 3 passed, 0 failed, about 0.6s.
  • Proof Law: this PR is false if sparse-checkout set or the branch checkout still run through git() with no timeout or with prompts allowed; or if a timeout on either command is no longer retried as an infra fault.
  • Screenshots: Not applicable. This is git transport, not a visual surface.

Behaviour changes

  • A stalled partial-clone checkout now fails after gitTimeoutMs and is retried as infra, instead of hanging until the job timeout. Successful checkouts are unchanged.

Not asked for

Review guide

  • Start here: checkoutSparseSegment in src/map-store/git-transport.ts.
  • Then test/map-store-checkout-timeout.test.mjs.

Verification summary

  • Commands run: pnpm run build; pnpm exec prettier --write src/map-store/git-transport.ts test/map-store-checkout-timeout.test.mjs; node --test test/map-store-checkout-timeout.test.mjs.

  • Results: red 3 failed; green 3 passed, 0 failed. Raw insertions versus origin/main after prettier: 61/400 (src/map-store/git-transport.ts 5, new test 56). CHANGELOG is excluded from that cap.

  • Unrelated failures: none in the focused run.

  • Known risks or skipped checks: the tests stub spawnSync rather than stalling a real git transfer. Standalone pnpm run verify was not run for this rebase; verification below records the actual hooks-on gates. One browser test was skipped by the suite; CI owns remaining verification.

  • Hooks-on rebase push: anti-slop lint and build passed; affected unit tests 4006 passed, 0 failed, 0 skipped (300.387s); browser E2E 1267 passed, 1 skipped (9.6m). Push passed with hooks enabled. Start 2026-11-16 20:09:39 GMT; end 20:24:36 GMT (Europe/London), total 14m57s.

  • Rebased head: d7cae72e7914e7087c3de790af4f63afe0f4414f onto main 48dbb25d709fa3f7dcfaac76bb4d354dd56134ca; no conflicts or fixes.

Sparse checkout after a filter clone is where the trees and blobs are
fetched. Run those commands through networkGit so a stall fails after
gitTimeoutMs and can be retried as infra.

Fixes #1410.
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Note

Synthetic action dogfood receipt. This report is the final deliberately failing fixture in the action contract suite. It proves that unproven evidence is rejected; it does not certify this pull request.

🗺️ StyleProof report

📊 View the side-by-side visual report →


Coverage, determinism, report/diff consistency, or Change Reach (changeReach: 'gate') evidence is incomplete — this is not a base recapture failure. Repair the named evidence in the report.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Note

Live StyleProof-on-StyleProof (advisory). This report is captured from the surfaces declared in styleproof.config.ts (example/demo). home@* carries matching productState {id, revision} (comparable / certifying path); the product-state acknowledgement file stays armed but empty so undeclared new pairs fail closed. fail-on-diff is false; the check is not part of hosted required CI. The synthetic Action contract suite remains action-dogfood.yml.

🗺️ StyleProof report

Nothing changed, so no report was uploaded. The verdict is in the run summary.


Advisory-only mode: no reviewable changes detected — the StyleProof dogfood check remains green.

@BenSheridanEdwards
BenSheridanEdwards merged commit 966b705 into main Nov 16, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map-store checkout of a partial clone runs network git with no timeout and with prompts allowed

1 participant