Fix macOS CI: brew-installed danger-js embeds a Node <18.17, breaking undici's fetch() - #664
Merged
Merged
Conversation
…g Linux legs The brew-installed danger-js on macOS is a pkg-built standalone binary with its own embedded Node 18 (pkg --targets node18-macos-*; pkg 5.8.1 -> pkg-fetch 3.4.2, whose newest Node 18 base is v18.15.0). danger-js 13.0.10 pins undici 6.21.1, which requires node >=18.17 per its engines field. Below that floor, undici's fetchFinale hands stream.finished() a web ReadableStream it doesn't support, so every fetch() in danger-swift ci throws ERR_INVALID_ARG_TYPE and the step fails before Danger can post anything -- unrelated to the runner's own Node (22/24), which is fine. danger-js switched from node-fetch to undici in 13.0.10 (2026-06-25), which is why every macOS PR run since has failed identically, including on PRs unrelated to this change (danger#662, danger#663). The Linux jobs already avoid this by installing danger from npm via actions/setup-node + yarn instead of the brew binary. Do the same on macOS.
Both macos-13 legs sat permanently 'queued' -- that image is retired and absent from actions/runner-images/images/macos/ (only macos-14, -15, -26 remain), so those checks can never complete. Drop them, and add a macos-26 / Xcode 26.6 leg to all three macOS jobs, including test-dependencies-resolver -- the only job exercising the inline 'package:' / Script.artifactsPath path.
Required by the new macos-26 leg: under Swift 6.3 (Xcode 26.6) and 6.4 (Xcode 27), swift test fails on 1.17.5 with error: cannot use conformance of 'Never' to 'TestScoping' here; 'Testing' has been imported as implementation-only from SnapshotsTestTrait.swift. 1.17.7 fixes it. 1.17.7 is the ceiling: all 1.17.x releases are swift-tools-version:5.7, compatible with every remaining leg. 1.18.0+ raise to tools-version 6.0, which the Swift 5.9/5.10 Linux legs and macos-14/Xcode 15.4 cannot use. Verified this doesn't silently re-resolve past 1.17.x despite Package.swift's 'from: "1.17.0"': 'swift package update swift-snapshot-testing' under Xcode 26.6 lands on exactly 1.17.7, not 1.19.x, so the Package.resolved pin holds without needing a tighter manifest constraint. Full, unfiltered 'swift test' passes (165/165) under Xcode 26.6 with this pin.
DylanBettermannDD
marked this pull request as ready for review
August 2, 2026 00:15
Contributor
Author
|
@f-meloni this is ready for review — root cause and fix are described above, and CI is green (15/15, including the new |
|
@f-meloni pinging to make sure this is still on your radar |
Member
|
Thank you! |
f-meloni
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every macOS CI leg on PRs to this repo fails, unrelated to what the PR actually changes — including on #662 and my own #663. Swift itself is fine (
swift testpasses 174/174 on macos-15/Xcode 16.1); the job dies in thedanger-swift cistep, insidedanger-js:Root cause
/snapshot/…ispkg's virtual filesystem — the crash is inside the brew-installed standalonedanger-jsbinary, which embeds its own Node, not the runner's Node (which is fine — 22/24 on current images):brew install danger/tap/danger-js.github/workflows/ci.ymlpkg-built zipdanger/homebrew-tap/danger-js.rbpkg … --targets node18-macos-{x64,arm64}→ embedded Node 18danger-jspackage.jsonpkg@^5.8.1→pkg-fetch@3.4.2, whose newest Node 18 base is v18.15.0vercel/pkgpackage.json;pkg-fetchpatches treedanger-js13.0.10 pinsundici6.21.1 exactlydanger-js@13.0.10package.json+yarn.lockundici@6.xrequiresnode >=18.17enginesfield18.15 < 18.17, so
undici'sfetchFinalehandsstream.finished()a webReadableStreamit doesn't support on that Node, and everyfetch()throws. This started whendanger-jsswitched fromnode-fetchtoundici(commitc8b966ae, shipped in 13.0.10, 2026-06-25) — consistent with the last green macOS PR run being 2025-09-28.The Linux jobs never hit this: they already install
dangerfrom npm viaactions/setup-node+yarn global add dangerinstead of the brew binary, and pass.Fix (4 commits)
danger-json macOS the way the Linux jobs already do —actions/setup-node@v4(Node 20.x) +yarn global add danger, in all three macOS jobs. This is a verbatim copy of the blocktest-on-linux/test-without-spm-on-linuxhave used successfully for a while, so it inherits their track record rather than being a new install path.macos-13legs, addmacos-26. Bothmacos-13legs satqueuedfor an entire run and never complete — that runner image is gone fromactions/runner-images. Also removes the now-deadmatrix.runner == 'macos-13'conditional intest-without-spm-on-macos.swift-snapshot-testing1.17.5 → 1.17.7. Required for the newmacos-26/Xcode 26.6 leg: 1.17.5'sSnapshotsTestTrait.swiftfails to compile under Swift 6.3 (cannot use conformance of 'Never' to 'TestScoping'... imported as implementation-only); 1.17.7 fixes it. Verified this doesn't silently re-resolve past 1.17.x despitePackage.swift'sfrom: "1.17.0"—swift package update swift-snapshot-testingunder Xcode 26.6 lands on exactly 1.17.7, not 1.19.x, soPackage.resolvedalone holds without a tighter manifest bound. Full, unfilteredswift testpasses 165/165 with this pin.Notes for review
dangeris installed at latest (Linux does the same today),actions/setup-node@v4is a mutable major tag (so is every other action in this file), andyarn global add/yarn global binare Yarn Classic commands (also already relied on by the Linux jobs, which have nopackage.json/Corepack in this repo to conflict with). Happy to pin any of these repo-wide in a follow-up if you'd like, but didn't want to make that call unilaterally in a CI-unblocking PR.macos-26uses Xcode 26.6 under thenativeSwiftPM build system (Swift 6.3), the same module layout as the already-passingmacos-14/macos-15legs — notswiftbuild(Xcode 27's new default, the layout Probe for the actual Danger.swiftmodule instead of trusting the compiler that built danger-swift #663 is about), so this PR doesn't touch that code path.macos-13removes the last Intel-macOS leg (macos-14/-15/-26are all arm64) and the only remaining Swift 5.8 toolchain in CI (the stated minimum inPackage.swift/README) — Linux starts at 5.9. Flagging both in case either matters to you; happy to add back an older-toolchain leg if so.Testing
swift test: 165/165 passing, Xcode 26.6, with the 1.17.7 pin.swift build -c release --product danger-swift: succeeds, Xcode 26.6.swift package update swift-snapshot-testingunder Xcode 26.6 resolves to 1.17.7, confirming thePackage.resolvedpin holds.yaml.safe_load.