fix(registry): a failed version discovery must not abandon the run - #128
Merged
Conversation
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
|
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.
Summary
publish-allcalleddiscoverVersionsoutside thetrythat 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:283aborts immediately on any status below 500, so there's no retry either.Reproduced with a bogus definition followed by a valid one:
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/cobrasorts 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:
records a discovery failure and still reaches the summarydoes not abandon definitions sorted after a failing oneTest plan
pnpm lint— clean (ranpnpm fixfor formatting)pnpm build— cleanpnpm test— 221/221 context, 43/43 registry (up from 41 with the two new tests)No changeset:
@neuledge/registryisprivate: trueand this doesn't touch the published package.Generated by Claude Code