Skip to content

ci: checkout on Node 24, and fail when the SPM pins get dropped - #5

Merged
tarikbc merged 1 commit into
mainfrom
ci/checkout-v7-and-pin-guard
Sep 11, 2026
Merged

ci: checkout on Node 24, and fail when the SPM pins get dropped#5
tarikbc merged 1 commit into
mainfrom
ci/checkout-v7-and-pin-guard

Conversation

@tarikbc

@tarikbc tarikbc commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Two small things, both found while working on the four PRs merged today.

checkout on Node 24

actions/checkout@v4 targets Node 20, which the runners now force onto Node 24 and warn about on every single job. Both workflows move to v7. release.yml keeps its SHA pin (3d3c42e5... is v7.0.1, resolved from the API rather than typed from memory), ci.yml keeps its floating tag. Each file keeps the style it already had.

A guard for the SPM pins

CopyCore/Package.resolved answers to two tools, and they disagree:

  • xcodebuild writes all three pins into it. CopyCore is the workspace root package and the generated .xcodeproj is gitignored, so Xcode has nowhere else to keep them.
  • swift test --package-path CopyCore resolves CopyCore on its own and rewrites the same file with GRDB only.

Measured, and it is exactly that deterministic:

start:            3 pins
after swift test: 1 pins
after xcodebuild: 3 pins

So the obvious workflow (run the tests, then git commit -am) silently drops the Sparkle and KeyboardShortcuts pins. The next release then resolves them to whatever from: allows, which means an unreviewed Sparkle version in an app that updates itself. It already happened twice in the commits merged today; I caught it and reverted both.

CI now reads the committed file before the tests touch it, and fails with the exact command that restores it.

The check parses the JSON with jq rather than grepping. My first draft grepped for "identity" : "x", which is SwiftPM's own spacing, and I proved it goes red against the same content written by any other formatter. Tested three ways before pushing: committed file passes, reformatted file with all three pins passes, dropped pins fail.

Not done here

This makes the trap loud; it does not remove it. Removing it means either pinning Sparkle and KeyboardShortcuts to exact versions in project.yml, so the resolved file stops mattering for them, or giving up on committing pins for the app-level packages. Both are policy calls, so I left them for you.

https://claude.ai/code/session_01UraqY8Ld2E3zzGVN636Lw7

actions/checkout@v4 runs on Node 20, which the runners now force onto
Node 24 with a deprecation warning on every job. v7 for both workflows.
release.yml keeps its SHA pin, ci.yml keeps its tag, as each already was.

The second half is the trap behind the Package.resolved churn.
CopyCore/Package.resolved answers to two tools: `xcodebuild` writes all
three pins into it, because CopyCore is the workspace's root package and
the generated .xcodeproj is gitignored, so Xcode has nowhere else to keep
them; `swift test --package-path CopyCore` resolves CopyCore alone and
rewrites the same file with GRDB only. Measured, it is exactly that
deterministic: three pins after a build, one after the tests.

So running the tests before committing drops the Sparkle and
KeyboardShortcuts pins with nothing to say so, and the next release would
resolve them to whatever `from:` allows. That is an unreviewed Sparkle in
an app that updates itself. CI now reads the committed file before the
tests touch it and fails with the command that puts the pins back.

It reads the JSON rather than grepping it. The first draft grepped for
`"identity" : "x"`, SwiftPM's own spacing, and went red against the same
file written by any other formatter.

Claude-Session: https://claude.ai/code/session_01UraqY8Ld2E3zzGVN636Lw7
@tarikbc
tarikbc merged commit 7deab24 into main Sep 11, 2026
1 check passed
@tarikbc
tarikbc deleted the ci/checkout-v7-and-pin-guard branch September 11, 2026 03:18
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