Skip to content

Resolve vendored crates from a registry scoped to their own package - #19

Open
Blast545 wants to merge 1 commit into
mainfrom
blast545/scoped-vendored-registry
Open

Resolve vendored crates from a registry scoped to their own package#19
Blast545 wants to merge 1 commit into
mainfrom
blast545/scoped-vendored-registry

Conversation

@Blast545

@Blast545 Blast545 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

We need to make pallet-patcher a bit smarter in order to find vendored crates in a succesful manner. Before this PR, pallet-patcher takes the different registries with just order priority and gets the first dependency matching what its searching for.

Vendoring is not completely aligned with this mechanism since we don't want the option to find packages in the "vendored" subtree for a specific crate, but we don't want to make it available for other crates it's not a part of.

This PR introduces:

  1. get_vendored_registry to create "vendored_crate" indexes that will be specific to the dependencies beloging to the crate being iterated on.
  2. The iteration logic is modified, such that when we add new dependencies to search, we also add if their subtree contains a vendor index, or if they are part of a vendored index. In the first case, location/vendor is added as a place to search for crates. In the second, if we are iterating for a dependency that's part of a vendored tree, we look for them in the vendored tree.

Vendored crates still have the latest priority, so crates found in the search_paths will take priority when searching for dependencies.

The two added tests specify the type of resolution we want to achieve with this PR.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.09%. Comparing base (d604db2) to head (58dbfdd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   80.97%   83.09%   +2.12%     
==========================================
  Files           6        6              
  Lines         268      278      +10     
  Branches       68       73       +5     
==========================================
+ Hits          217      231      +14     
+ Misses         32       30       -2     
+ Partials       19       17       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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