Skip to content

v1.93.31.0 test(cso): fixtureGit throws when git is killed or cannot start (#3476) - #3761

Merged
capy-ai[bot] merged 3 commits into
mainfrom
gsta-217-fixturegit-status
Nov 3, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
gsta-217-fixturegit-status

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3761,
  "head": "a3e3228b4ddc58b8559d285fd83d7396e090677a",
  "version": "1.91.379.0",
  "base": "main",
  "gate": {
    "cso": {
      "pass": 11,
      "fail": 0,
      "skip": 0
    },
    "typecheck": {
      "pass": 1,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "bfbe271b8dd155fe1466ee9eea89399abb078709",
  "product_patch_id": "none",
  "gstack_version": "1.91.378.0",
  "review_depth": {
    "depth": "light",
    "class": "tests",
    "runtime_lines": 0,
    "rules": "150435b0a543019a",
    "base": "2d1b55d7621df1a71e02037c79b63b7ee2fdc64f",
    "registry": "2d1b55d7621df1a71e02037c79b63b7ee2fdc64f",
    "gate_scan": {
      "tagged": 0,
      "head": "a3e3228b4ddc58b8559d285fd83d7396e090677a"
    },
    "reasons": [
      "runtime=0<=50"
    ]
  },
  "pregate": "requires-remote cleared @bfbe271b8dd1 (1 checks, current for a3e3228b4ddc)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41241286132",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41241283674",
    "pregate.json/remote_gate: remote-gate tree=bfbe271b8dd1 tests=130"
  ],
  "issues": {
    "fixes": [
      3476
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and CONTRIBUTING.md (fixtureGit, cso-git-hardening references)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "fix_checks": 1
  }
}

What changed

fixtureGit: a killed or missing git used to count as success; now it throws and names the git call

fixtureGit used to treat a killed or missing Git as success. Now it throws and names the Git call.

Before/after as text: fixtureGit: a killed or missing git used to count as success; now it throws and names the git call
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ bun demo3476b.ts   # fixtureGit on this branch
+killed git (1 ms timeout) -> throws: fixture git status failed (status null, signal SIGTERM): spawnSync /usr/bin/git ETIMEDOUT
+failing git (status 128) -> throws: fixture git rev-parse HEAD failed (status 128, signal null): fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
-$ bun demo3476b.ts   # fixtureGit as on main 2d1b55d
-killed git (1 ms timeout) -> no throw, returned ""
-failing git (status 128) -> throws: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
 
+Windows (no /usr/bin/git): beforeAll warm-up skipped, like every test in the file
-Windows (no /usr/bin/git): beforeAll warm-up -> ENOENT swallowed, file "passes"
 

Why

#3476 reported that fixtureGit in test/cso-git-hardening.test.ts accepts a null spawn status, so a killed git looks like success. That matters because the replaced-history hardening test sets up its condition with git replace. If that one call were killed, the test would pass without the replacement ever being in place. The helper now fails at the Git step that broke. The stricter helper then caught a real case in CI: on Windows, the file's warm-up step had called /usr/bin/git (which doesn't exist there) on every run, and passed only because the ENOENT was swallowed.

Blast radius

This is test-only. fixtureGit is local to test/cso-git-hardening.test.ts and isn't exported. The other fixtureGit functions in test/helpers/ are separate functions that already check result.error || status !== 0. All 11 tests in the file are test.skipIf(process.platform==='win32'), so skipping the warm-up on Windows removes nothing that ran. On Linux and macOS the warm-up runs as before, so the protection against a slow cold macOS runner stays. Evidence: Windows Free Tests run 41236157469 failed in the warm-up at the first commit, Linux runs 11 pass, and the fix-check read the touched hunks. Security read: no network calls, environment reads or permission changes.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 One-round eng plan for #3457 (fix in proxyServerEnv with failing-first tests) and #3476; drop #2973 “Approved: build both PRs as planned (#3457 fix in proxyServerEnv with the three-spelling failing-first tests and the end-to-end case; #3476 one-line throw on error or non-zero status). Dropping #2973 with the measurement is right. Leave the path-refusal narrowing for credential-…” (GStack Minder (GSTA-36)) approved #3457 and #3476 fixes, #2973 drop none

Source: gstack-approvals record for gsta-217-fixturegit-status (display only; not an approval citation).

Summary

fixtureGit now throws when spawnSync reports an error or any status other than 0, with the Git arguments, status and signal in the message. The beforeAll warm-up returns early on Windows, where every test in the file already skips.

Test Coverage

Coverage: skipped (no runtime file changed). The proof is the reproduction in the What changed section: the helper body from main, run with a 1 ms timeout, returns "" for a killed git (status null, ETIMEDOUT), and returns the same for a missing binary (ENOENT). The fixed helper throws in both cases. Windows Free Tests run 41236157469 is a second, unplanned proof: the stricter helper failed in the Windows warm-up, which the old helper had been hiding.

Tests ran: cso 11
Tests ran: typecheck count unavailable

Pre-Landing Review

No issues found. In pass 1, my core review and a cross-family outside voice (openai/gpt-6.1-sol) found nothing. A second outside-voice run was voided and redone, because it had diffed against a stale local main (it is in the decision trail). After the Windows fix, one fix-check read the touched hunks and found nothing.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen fix_checks=1
Gate edits: none detected (GATE_SCAN tagged=0)
Outside review: clean (openai/gpt-6.1-sol)

Exploratory QA

Smoke: bun test test/cso-git-hardening.test.ts on Linux gave 11 pass, plus the killed-git and failing-git probes shown above. Windows behavior was checked by CI only.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The approved plan is in the Approvals row above.

Issues

Fixes #3476

Verification Results

Remote pregate at tree bfbe271: 130 tests, 0 failed ($0.05). Free Tests run 41241286132: success.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The diff is test-only and no documentation changes are needed.

Scope: candidate ship3476-docs2 (base 2d1b55d to head a3e3228, branch gsta-217-fixturegit-status). Committed: test/cso-git-hardening.test.ts and changelog.d/gsta-217-fixturegit-status.md. No staged, unstaged or new files. I searched the docs inventory for references to the changed helper and test file and found none in authored docs.

Documentation health:

  • test/cso-git-hardening.test.ts: reviewed. fixtureGit now throws on a spawn error or a non-zero or null status, and the beforeAll warm-up skips on win32, where every test already uses skipIf.
  • changelog.d/gsta-217-fixturegit-status.md: reviewed, not edited (changelog metadata belongs to the parent). It is accurate against the diff.

Coverage debt: none. The diff adds no public surface. Diagram drift: none.

Test plan

  • bun test test/cso-git-hardening.test.ts: 11 pass, 0 fail
  • bun run typecheck: clean
  • Remote pregate (Ubicloud, gsta217): 130 tests, 0 failed

garrytan and others added 2 commits October 31, 2026 18:52
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ile already skips

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title test(cso): fixtureGit throws when git is killed or cannot start (#3476) v1.93.31.0 test(cso): fixtureGit throws when git is killed or cannot start (#3476) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 9514b76 into main Nov 3, 2026
58 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

1 participant