Skip to content

ci(install-test): make the npm jobs test npm's ant, not Apache Ant's - #228

Open
Nic-dorman wants to merge 2 commits into
mainfrom
fix/install-test-npm-checks
Open

Nic-dorman wants to merge 2 commits into
mainfrom
fix/install-test-npm-checks

Conversation

@Nic-dorman

@Nic-dorman Nic-dorman commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Two of install-test.yml's npm jobs could never pass. Both failures were bugs in the tests, not in the package. Found while verifying #223.

  • test npm install (Linux) failed after uninstall if any ant was still on PATH. GitHub's ubuntu image ships Apache Ant, which is also called ant, at /usr/bin/ant. The check now asserts that npm's own ant ($(npm prefix -g)/bin/ant) is gone. The macOS and Windows uninstall steps, which didn't check removal before, gain the same check. On Windows that means every shim npm writes: ant (for sh), ant.cmd and ant.ps1. PowerShell runs ant.ps1 in preference to ant.cmd, so the step fails if any file named ant is left in npm's global prefix, whatever its extension.
  • test npm install --ignore-scripts grepped for "embedded bootstrap peer". The binary logs No bootstrap config file; using N bundled bootstrap seed(s) (ant-core/src/config.rs). Both strings arrived in the same commit (b70d808), so the job had never been able to pass. The run before this fix shows the binary using the bundled seeds; only the grep was wrong.

Every "verify binary" step also ran ant --help, which Apache Ant answers too, so a broken npm install could still pass. Each one now checks first that ant resolves to npm's install.

Linear issue

Closes V2-1525

Risk tier

  • T0 — docs / tooling / CI / pure UX-output. Repo CI only.
  • T1 — client-only, no network-facing behavior change. CI + prod compat smoke.
  • T2 — node/client logic with behavioral surface, no protocol/format/economics change. Dev testnet + ADR.
  • T3 — protocol / storage format / payments / routing. T2 evidence + adversarial testing.

Workflow-only change to a workflow_dispatch job.

Compatibility

  • Wire: none
  • Storage: none
  • API: none

Semver impact

  • breaking
  • feature
  • fix

Test evidence

Review fix 41da35d (2026-10-27): the Windows uninstall check covers all of npm's shims. Dispatched install-test.yml on this head against npm @withautonomi/ant@0.3.12: run 40503434356. All 7 jobs passed. Windows npm's uninstall step ends with Binary removed, config preserved, and so does Linux npm's, after removed 2 packages. The --ignore-scripts job reports Bootstrap peers resolved from the bundled seeds, with no config file present.

Before pushing, I ran the new check on its own under Windows PowerShell 5.1, with $ErrorActionPreference = 'stop' as GitHub's pwsh steps set it, against temp folders:

  • ant + ant.cmd + ant.ps1 left behind: fails and names all three.
  • ant.ps1 alone left behind: fails and names it. So does ant alone.
  • Only nearby names left (gemini*, antd.cmd, ant-ui.ps1) plus an ant directory: passes.
  • A prefix that doesn't exist: fails.

actionlint is clean.

Original evidence follows. It was run on 656bbee, before the 10-23 rebase to 16749cc. The rebase didn't change this PR's patch.

Dispatched install-test.yml on this branch against npm @withautonomi/ant@0.3.10 (run 38378605487). All 7 jobs passed:

  • test npm install (Linux): success. It used to fail on Apache Ant at /usr/bin/ant.
  • test npm install --ignore-scripts (Linux): success. It used to fail on the grep.
  • test npm install (macOS), test npm install (Windows): success, with the new resolves-to-npm and removal checks.
  • test install.sh (Linux), test install.sh (macOS), test install.ps1 (Windows): success. Unchanged here.

The earlier run (38253772727, for #223) had the two Linux npm jobs failing for the reasons above. Its --ignore-scripts log shows the binary printing No bootstrap config file; using 7 bundled bootstrap seed(s).

New dependency

none

ADR

n/a

Mitigation / rollback

Revert the commit. It only touches .github/workflows/install-test.yml, which runs only when dispatched.

🤖 Generated with Claude Code

Two npm jobs could never pass, for reasons in the tests themselves:

- test npm install (Linux) failed after uninstall if any `ant` was
  still on PATH. GitHub's ubuntu image ships Apache Ant, also called
  `ant`, at /usr/bin/ant. The check now asserts that npm's own ant is
  gone, and the macOS and Windows uninstall steps gain the same check.
- test npm install --ignore-scripts grepped for "embedded bootstrap
  peer", but the binary logs "No bootstrap config file; using N
  bundled bootstrap seed(s)" (ant-core/src/config.rs). Both strings
  arrived in the same commit, so the job had never been able to pass.

Every "verify binary" step also ran `ant --help`, which Apache Ant
answers as well. Each one now checks first that `ant` resolves to
npm's install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nic-dorman
Nic-dorman force-pushed the fix/install-test-npm-checks branch from 656bbee to 16749cc Compare October 23, 2026 18:52

@MaidSafe-Hermes MaidSafe-Hermes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — 1 confirmed P2 finding. Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). The seats disagreed on whether the Windows uninstall gap blocks; I verified the gap against npm RFC 0032: npm creates a .ps1 shim as well as .cmd, and PowerShell prioritizes .ps1. This workflow is workflow_dispatch-only, so the reported green PR checks do not exercise these changes; the install-test workflow itself was not run on this head.

Comment thread .github/workflows/install-test.yml Outdated
run: |
npm uninstall -g @withautonomi/ant
$npmPrefix = (npm prefix -g).Trim()
if (Test-Path (Join-Path $npmPrefix "ant.cmd")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ P2 — Windows uninstall check misses the PowerShell shim. This checks only ant.cmd. npm also installs ant.ps1, and PowerShell prioritizes that wrapper. If uninstall leaves ant.ps1 but removes ant.cmd, this test passes although the npm-installed ant command remains callable. Check that ant.ps1 is absent too (and any other shims produced by the supported npm version) before reporting the npm binary removed.

npm writes three shims on Windows: `ant` (for sh), `ant.cmd` and
`ant.ps1`, and PowerShell runs `ant.ps1` in preference to `ant.cmd`. The
uninstall check only looked for `ant.cmd`, so a leftover `ant.ps1` would
pass while `ant` stayed callable. It now fails on any file named `ant` in
npm's global prefix, whatever its extension.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nic-dorman

Copy link
Copy Markdown
Member Author

Addressed in 41da35d.

P2: the Windows uninstall check misses the PowerShell shim. You're right. npm writes three shims on Windows: ant (for sh), ant.cmd and ant.ps1, and PowerShell runs ant.ps1 first. That's the layout in a local npm 11 global prefix too. The step now fails if any file whose base name is ant is left in npm prefix -g after uninstall, whatever its extension. That covers all three shims and any other kind a later npm writes. The error names each file it finds.

Before pushing, I ran the check on its own under Windows PowerShell 5.1, with the $ErrorActionPreference = 'stop' that GitHub sets in pwsh steps, against temp folders:

  • All three shims left behind: fails and names ant, ant.cmd, ant.ps1.
  • Only ant.ps1 left behind: fails. So does only ant.
  • Only nearby names (gemini*, antd.cmd, ant-ui.ps1) plus an ant directory: passes.
  • A prefix that doesn't exist: fails.

actionlint is clean.

The install-test workflow wasn't run on this head. Also right. The run in the PR body (38378605487) was on 656bbee, before the 10-23 rebase to 16749cc. The rebase didn't change this PR's patch, and main hasn't touched the workflow since, but that run doesn't count as evidence for this head. I've dispatched install-test.yml on 41da35d against npm @withautonomi/ant@0.3.12, the current latest: run 40503434356. All 7 jobs pass. The Windows npm job's uninstall step ends with Binary removed, config preserved. The Linux npm job and --ignore-scripts pass too, as do the three install.sh/install.ps1 jobs.

The PR body is updated with this evidence and the Windows shim detail.

CI on 41da35d: all jobs pass except Security Audit. It fails only on RUSTSEC-2026-0387 (crypto-bigint 0.5.5), which is inherited from main and tracked as V2-1743. This PR changes only .github/workflows/install-test.yml.

@MaidSafe-Hermes MaidSafe-Hermes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-scoped APPROVE at 41da35dd8f5862deac1d62895dfe7a0f6145ded9. Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). The prior P2 is fixed: the Windows uninstall check now detects the npm ant shims by basename, including .cmd and .ps1. No new code-level issue was found.

Merge condition: This approval does not waive the failing Security Audit. Resolve RUSTSEC-2026-0387 (crypto-bigint 0.5.5; advisory fix says upgrade to >=0.7.6) before merge. The dispatch-only install-test workflow was not run on this head; this review is based on source inspection and the reported PR checks.

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.

2 participants