ci: stop contacting live registries in publish dry-runs - #211
Merged
Conversation
The node and haskell dry-runs are the only two that reach a real registry, and both fail on every pull request as a result. `npm publish --dry-run` still asks npm whether the version already exists, so it passes only in the window between a version bump landing on main and the release that publishes it. Outside that window it reports "You cannot publish over the previously published versions". npm 10 never made that request, which is why this was invisible until #204 moved the job from node 20.11.0 to 24.5.0 and with it from npm 10 to npm 11. `npm pack` does the same packing and manifest validation locally. `stack upload --candidate` is not a simulation at all: it pushes a real candidate release to Hackage from unreviewed pull request code. It fails once the cabal version has been published, because stack ignores the rejected tarball upload and then 404s uploading haddocks to a candidate that does not exist. The preceding steps already run `stack test`, `stack sdist` and `stack haddock --haddock-for-hackage`, so nothing is lost by dropping it. Releases are unaffected: both real uploads live in the `release` branches of these actions and are untouched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`pr-check.yml` has failed at startup on every pull request since #204 merged on 2026-05-19. The last run that actually executed was 2026-05-13. #204 added `permissions: id-token: write` to publish-all's `publish-node` job for npm trusted publishing. A reusable workflow cannot request more permission than its caller grants, and `pr-check.yml` caps the whole workflow at `contents: read`, so the call is rejected before any job starts. `release.yml` and `dry-run.yml` declare no top-level `permissions` block, so they inherit the repository default and were unaffected — which is why releases kept publishing while PR validation was silently dead. Granted on the calling job rather than workflow-wide, so the `codegen` job keeps the narrower `contents: read`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 8fbbfa5)
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.
publish-nodeandpublish-haskellfail on every pull request. They are the only two publish jobs whose dry-run mode contacts a live package registry; rust, python, go and dotnet validate locally and pass.This is independent of #209 and #210 — it reproduces on #210, which contains nothing but a one-line workflow permissions change.
node
npm publish --dry-runstill asks the registry whether the version exists:The version in
gen/node/package.jsononly changes at release time, so it matches what is already on npm for all but a brief window after each bump.npm 10 never made that request. Verified directly:
#204 moved this job from
node-version: 20.11.0to24.5.0for trusted publishing — npm 10.2.4 to npm 11.5.1. The command was never touched; its behaviour changed underneath it. Because that same PR also brokepr-check.ymlat startup (#210), the job never ran on a pull request again and the regression stayed invisible.npm pack --dry-rundoes the same packing and manifest validation without the registry round-trip.haskell
stack upload --candidateis not a simulation — it pushes a real candidate release to Hackage from unreviewed pull request code. Beyond being wrong on its own terms, it fails:Note stack ignores the rejected tarball upload. The fatal error is the second command,
stack upload --candidate -d ., which posts haddocks to the candidate URL. Hackage currently has candidates only up to0.0.18.1; there is none for any0.0.19.x:So the docs upload has no candidate to attach to and 404s. This job last passed on 2026-05-01 at 12:35 UTC; the cabal version moved to
0.0.19.0at 16:17 UTC that day and Hackage published it at 16:30 UTC. The next pull request, 2026-05-05, failed onpublish-haskellalone — and every one since.The preceding steps already run
stack test,stack sdistandstack haddock --haddock-for-hackage, which is every check a pull request needs, so the candidate upload is dropped rather than replaced.Scope
Releases are untouched. Both real uploads live in the
releasebranches of these actions:npm publish --access publicunderinputs.mode == 'release'stack upload --test-tarball .underinputs.mode == 'release' && startsWith(github.ref, 'refs/tags/v')The only behaviour lost is the candidate upload that ran during
release.yml's pre-flight dry-run stage, which the real upload immediately superseded.Verifying
This PR is its own test —
publish-nodeandpublish-haskellshould both go green, which no pull request has managed since 2026-05-01. Requires #210 to be on the branch or merged first, otherwisepr-check.ymlnever starts.🤖 Generated with Claude Code