Skip to content

test(zip): run the notifier archive gate through bash on Windows - #409

Open
i-so-late wants to merge 1 commit into
tt-a1i:mainfrom
i-so-late:test/windows-notifier-archive-spawn
Open

test(zip): run the notifier archive gate through bash on Windows#409
i-so-late wants to merge 1 commit into
tt-a1i:mainfrom
i-so-late:test/windows-notifier-archive-spawn

Conversation

@i-so-late

Copy link
Copy Markdown
Contributor

Problem and value

Current-main trigger: on Windows, node --test test/release-package-gates.test.mjs fails built archives contain the embedded notifier runtime with null !== 0 and no build output. The test spawns scripts/build-zip.sh directly, and Windows cannot execute a .sh file as a process (spawnSync returns error.code === 'EFTYPE', status === null).

Why it slipped through: #181 added this test on 2026-08-30; #132 introduced the spawnBuildZip helper (bash on Windows, direct execution elsewhere) on 2026-09-01 from a branch that predated #181, so the three older build-zip.sh callers in this file were converted and this one was not.

Intended outcome: the gate runs on Windows through the same helper as the other archive gates. With #385 merged, a Windows build is byte-identical to the committed archify.zip, so the gate's real assertions (the three notifier entries are present in the archive) now hold on Windows instead of failing before the build starts.

Approach: replace the direct spawnSync(...build-zip.sh...) call with the existing spawnBuildZip(archive). No linked issue; this is a focused test-only correction with #132 as the precedent and #385 as the change that made it meaningful.

Stability impact

  • Impact class and changed behavior/shared callers: Local behavior, focused test correction. One test in archify/test/release-package-gates.test.mjs (+1/-4). No runtime, schema, renderer, Viewer, package, or generated-artifact change.
  • Existing behavior preserved / intended compatibility changes / failure behavior: on non-Windows platforms spawnBuildZip still executes the script directly with the same cwd and encoding, so the gate is unchanged there. On Windows a failing build still fails the assertion, now with the script's stdout/stderr attached instead of two undefineds.
  • No unrelated changes: confirmed; git diff --stat covers only the one test file.

Tests run

Base a07fa1d -> candidate c159256 (one commit). Windows 10 Pro 10.0.19045, Git for Windows 2.32.0, GNU bash 4.4.23 (msys), Node v22.21.1, npm 10.9.4, unzip from Git for Windows, clean checkout.

  • Targeted, from archify/: node --test --test-name-pattern="built archives contain the embedded notifier runtime" test/release-package-gates.test.mjs -> base: 1 fail (null !== 0); candidate: 1 pass.
  • node --test test/release-package-gates.test.mjs -> base: 23 tests, 20 pass / 2 fail / 1 skip; candidate: 23 tests, 21 pass / 1 fail / 1 skip. The test that stops failing is this gate. The remaining failure on both is archive build excludes untracked files and external symlinks from the live working tree, which needs symlink privilege (EPERM from fs.symlinkSync) and is unrelated. The skip on both is archive build rejects non-canonical Node versions before publishing output, which requires a Node major other than 22.
  • npm test from archify/ (after npm ci) -> base: 1348 tests, 1267 pass / 24 fail / 57 skip; candidate: 1348 tests, 1267 pass / 24 fail / 57 skip. The failing names differ by exactly one swap: built archives contain the embedded notifier runtime fails on base and passes on the candidate; a last-good notice remains acknowledgeable after the refresh commits a new candidate (test/update-notifier.test.mjs, unchanged by this PR) failed in the candidate's full run and passes 3/3 when run in isolation on the candidate. That test and its sibling an empty precheck snapshot cannot start a second concurrent network request are the same two update-notifier cases test: make clean staging mode checks portable #349 reported as intermittent on Ubuntu; the sibling fails in both full runs here. The other 22 failures are identical on base and candidate and are Windows-environment causes: 16 need symlink privilege (EPERM from fs.symlinkSync), 3 are the core.autocrlf checkout cases (test: make checkout Git isolation portable on Windows #318), and one each are the stager stat-mode assertion (test: make clean staging mode checks portable #349), the installed-preview shutdown (test: exercise preview graceful shutdown on Windows #320), and the workflow-migration preload path (test: load workflow migration preload via a file URL #319).
  • node --check on the test file and git diff --check: clean.
  • Linux/macOS: not run locally. The changed call site takes the non-win32 branch of spawnBuildZip, which is the same direct spawnSync the test used before, so the ubuntu npm test job exercises identical behavior.

Visual evidence

Not applicable: a test's process-spawning call changes; no rendered output, Viewer, or package content is affected.

Generated artifacts

None regenerated. The changed file lives under the repository-only archify/test/ tree, which the Skill stager excludes, so archify.zip, the Gallery, and the site outputs remain fresh; zip-freshness will confirm.

`built archives contain the embedded notifier runtime` still spawned
scripts/build-zip.sh directly, so on Windows spawnSync fails with EFTYPE
and the assertion reports `null !== 0` with no build output. The test was
added by tt-a1i#181 two days before tt-a1i#132 introduced the spawnBuildZip helper for
the other build-zip.sh callers in this file, so it never picked it up.

Use the existing helper. Non-Windows platforms still execute the script
directly, so the gate's behavior there is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011b5aCHD8zdVjCjr5FCc6EJ
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c4a0fe0a-5fa2-4994-ae31-705ab03491eb

📥 Commits

Reviewing files that changed from the base of the PR and between a07fa1d and c159256.

📒 Files selected for processing (1)
  • archify/test/release-package-gates.test.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Summary

Reviewed base a07fa1d5b2a10cbea110c5a2be2817397a301cdc and head c159256daa2e00124c6dc6948219beeac33936cc. The test now uses spawnBuildZip(archive), which enables Bash execution on Windows and preserves non-Windows behavior. Author-reported validation shows the affected Windows test passes. No reused evidence at another revision or observed CI results were provided. This summary does not claim browser or perceptual acceptance.

Walkthrough

The canonical ZIP test now calls spawnBuildZip(archive) instead of directly spawning scripts/build-zip.sh. The shared helper provides Bash resolution and fallback logic for Windows environments. The removed direct call no longer passes cwd and encoding options at the test site.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to c1592

The test now uses the shared cross-platform build helper, and targeted Windows testing passes.

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Validation Evidence ❓ Inconclusive The PR provides the required local evidence for a focused test correction. The description records the base a07fa1d and head c159256, the Windows before/after targeted result, compatibility and re… Maintainer: wait for workflow run 34799857803 on head c159256daa2e00124c6dc6948219beeac33936cc to finish and verify that all remaining checks pass. If the run remains stuck, rerun the final-head CI and reassess only the affected checks.
✅ Passed checks (1 passed)
Check name Status Explanation
Contribution Scope ✅ Passed PASS. CONTRIBUTING.md permits narrow test corrections without a planning issue when they include a concrete reproduction or rationale. The PR provides the Windows EFTYPE/status === null reproducti…
Full details: Validation Evidence

Explanation

The PR provides the required local evidence for a focused test correction. The description records the base a07fa1d and head c159256, the Windows before/after targeted result, compatibility and regression checks, disclosed unrelated failures, Not applicable visual evidence, and why no generated artifact changed. The review diff confirms one test-file change, and final-head CI has already passed zip-freshness, all three package smoke jobs, and published-update-manifest. However, required final-head CI is not complete for head c159256daa2e00124c6dc6948219beeac33936cc: the workflow run is still in progress, with test (18), test (20), test (22), and webm-artifact not concluded. The author report cannot replace those current remote results.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant