Repository navigation
refactor(xpkg): fold Resolver into a resolving xpkg Client - #483
Merged
Merged
Conversation
Add an internal/xpkg Client interface that extends the upstream xpkg.Client with Resolve. NewClient and project.NewXpkgClient now return it, so callers carry one value instead of a client plus a Resolver. The dependency manager drops WithResolver and resolves through its client; ResolveConfigurationFunctions takes the Client. Resolution rules and error messages are unchanged. Suggested by adamwg in review of crossplane#478. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
adamwg
approved these changes
Oct 30, 2026
adamwg
left a comment
Member
There was a problem hiding this comment.
One further simplification suggestion inline, but I'll leave it up to you. Thanks for the refactor 🙏
…Client NewClient always uses the remote fetcher, so callers no longer pass one. Callers of project.NewXpkgClient now call xpkg.NewClient directly with the same cache dir default and image configs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
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.
Description of your changes
Follow-up to #478, implementing @adamwg's review suggestion there: rather than passing both an xpkg client and a
Resolvereverywhere,internal/xpkgnow has aClientinterface that extends the upstreamxpkg.ClientwithResolve.internal/xpkg.Client= upstreamxpkg.Client+Resolve(ctx, ref) (name.Reference, string, error).WrapClient(xpkg.Client) Clientadds resolution to any upstream client;NewClientandproject.NewXpkgClientreturn the wrapped client.Resolver/NewResolverare removed;dependency.WithResolveris removed and the manager resolves through the client passed viaWithXpkgClient.ResolveConfigurationFunctionstakes theClient.Testing:
go build ./...,go vet ./internal/... ./cmd/...,go test ./internal/... ./cmd/..., andgolangci-lint runon the touched packages (0 issues);./nix.sh run .#testand./nix.sh run .#lint(0 issues).Related: #436, #477, #480, #482.
I have:
./nix.sh flake checkto ensure this PR is ready for review. (./nix.sh run .#testand./nix.sh run .#lintpass.)Linked a PR or a docs tracking issue to document this change.Internal refactor, no user-facing change.AddedRefactor only, no backport needed.backport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.
🤖 Generated with Claude Code