Skip to content

fix(registry): a failed version discovery must not abandon the run - #128

Merged
moshest merged 1 commit into
mainfrom
claude/guard-version-discovery
Aug 31, 2026
Merged

fix(registry): a failed version discovery must not abandon the run#128
moshest merged 1 commit into
mainfrom
claude/guard-version-discovery

Conversation

@moshest

@moshest moshest commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

publish-all called discoverVersions outside the try that guards the rest of the loop (cli.ts:228, guard starts at 235). Anything it threw escaped and killed the process.

Definitions are walked in sorted order, so one third-party registry API returning 404, 410 or 429 silently abandoned every package after it — and printed no summary at all. version-check.ts:283 aborts immediately on any status below 500, so there's no retry either.

Reproduced with a bogus definition followed by a valid one:

Error: Go module proxy returned 404 for github.com/nonexistent-org-xyz/nope
Node.js v22.22.2 — Exit status 1

The second definition was never reached; no --- Summary --- line.

Fix

Discovery talks to an external API and fails for reasons unrelated to the package — a renamed module, a rate limit, an upstream blip. It now records a failure for that definition and continues, exactly like a failed build already does.

Why now

Found while reviewing #126 (Go registry support). That PR makes it easy to hit: go/github.com/spf13/cobra sorts second of 141, so a single proxy hiccup would take down the other 139. The fragility is ours and predates that PR — this is worth landing regardless of whether #126 merges.

Tests

Two tests run the real CLI against a scratch registry whose definitions use a registry with no version fetcher, so discovery throws before any network call.

Verified load-bearing by reverting the guard and re-running:

with fix without fix
records a discovery failure and still reaches the summary pass fail
does not abandon definitions sorted after a failing one pass fail

Test plan

  • pnpm lint — clean (ran pnpm fix for formatting)
  • pnpm build — clean
  • pnpm test — 221/221 context, 43/43 registry (up from 41 with the two new tests)
  • Mutation-checked: both new tests fail without the guard

No changeset: @neuledge/registry is private: true and this doesn't touch the published package.


Generated by Claude Code

publish-all called discoverVersions outside the try that guards the rest of
the loop, so anything it threw escaped and ended the process. Definitions are
walked in sorted order, so one third-party registry API returning 404, 410 or
429 silently abandoned every package after it and printed no summary at all —
the run just died.

Discovery talks to an external API, which fails for reasons unrelated to the
package: a renamed module, a rate limit, an upstream blip. Those now record a
failure for that definition and continue, exactly like a failed build.

Found while reviewing #126, which adds a Go registry. That PR made it easy to
hit — go/github.com/spf13/cobra sorts second of 141, so a single proxy hiccup
would have taken down the other 139. The fragility is ours and predates it.

The new tests run the real CLI against a scratch registry whose definitions
use a registry with no version fetcher, so discovery throws before any network
call. Both fail without the guard and pass with it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NBQQpA86yYzwJUiVz8ph2R
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6fa1d85

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@moshest
moshest marked this pull request as ready for review August 31, 2026 23:27
@moshest
moshest merged commit 2e3c23c into main Aug 31, 2026
3 checks passed
@moshest
moshest deleted the claude/guard-version-discovery branch August 31, 2026 23:28
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