Repository navigation
Conversation
`shards outdated` calls `latest_version_for_ref` on every dependency's resolver, and `PathResolver` inherited the base implementation, which raises "Unsupported ref type for this resolver" even for the default (nil) ref. Any project with a path dependency crashed on the command. A path has exactly one version, the one in its shard.yml, so the resolver now returns that for the nil ref and keeps raising for others. Fixes crystal-lang#625 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
straight-shoota
requested changes
Nov 8, 2026
Comment on lines
+27
to
+28
| # A path has exactly one version, the one in its shard.yml, so that is the | ||
| # latest for the default (nil) ref. Path sources have no other refs. |
Member
There was a problem hiding this comment.
issue: This comment seems imprecise. The fact that there is only one version is irrelevant here (because the question of outdated is whether the installed version is the latest).
The significant detail is in the last sentence: Path resolvers have no branches, so the Ref parameter cannot be anything other than the default (which is encoded as nil).
Suggested change
| # A path has exactly one version, the one in its shard.yml, so that is the | |
| # latest for the default (nil) ref. Path sources have no other refs. | |
| # A path resolver has no branches, so we can only serve the latest version for the default ref (i.e. `nil`). |
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.
Fixes #625.
shards outdatedcallslatest_version_for_refon every dependency's resolver (src/commands/outdated.cr:70).PathResolverinherited the base implementation, which raisesUnsupported ref type for this resolvereven for the default (nil) ref, so any project with a path dependency crashed on the command. Shards 0.20.0 still does, as does master.A path has exactly one version, the one in its
shard.yml, soPathResolver#latest_version_for_refnow returns that for the nil ref and still raises throughsuperfor any other ref, which a path source cannot have.Two integration specs: a path dependency that is up to date, and one whose
shard.ymlversion was bumped aftershards install, which reportsinstalled: 0.1.0 at <path>, available: 0.2.0 at <path>. Both raise the exception above without the fix.spec/integration/outdated_spec.cr(27 examples) andspec/unit/(92, without the fossil and hg tags) pass on Windows 11 with Crystal 1.22.2.🤖 Generated with Claude Code