Repository navigation
fix(fetch): resolve registry names the mirror stores percent-encoded (#2019) - #2026
Merged
Merged
Conversation
…2019) Component ids repeat the mirror bucket key, i.e. the registry's own download path, so a package name the registry percent-encodes arrives as `ESP32%20HUB75%20LED%20MATRIX%20PANEL%20DMA%20Display`. Resolution compared those ids against the spec's display name, so an owner-qualified `lib_deps` of any name containing a space, '+' or parenthesis failed with NotIndexed, and the `@names-<h>` lookup hashed the display name while the generator buckets those shards by the encoded spelling, so owner-less specs missed too. Ids are percent-decoded before comparing (and the reported owner/name come from the decoded spelling), and the names shard is read under both spellings, unioning owners because every digit's shard exists once the index is large. The fixture now repeats the bucket's encoding and serves all sixteen names shards, so it fails on the pre-fix client; a live, ignored test resolves the two packages #2019 reports against the published index.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
downloader_mirror_manifest_tests.rs reached 1014 LOC; the 1000-LOC gate rejects a new over-limit file. The unit test lives in platformio_registry_tests.rs instead (972 LOC there).
This was referenced Nov 17, 2026
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.
Why
#2019 reports two
lib_depsentries failing with "is not in fbuild's registryindex" even though the index holds them:
mrfaptastic/ESP32 HUB75 LED MATRIX PANEL DMA [email protected]andadafruit/Adafruit Zero DMA [email protected].Component ids repeat the mirror bucket key, which is the registry's own
download path, so a name the registry percent-encodes arrives in that
spelling. Both lookups compared it with the spec's display name:
metadata_from_shardcomparedid_name(ESP32%20HUB75%20...) against thespec name and reported that encoded spelling as the package name;
owners()hashed the display name for@names-<h>, whileci/gen_mirror_manifest.pybuckets those shards by the bucket key's segment(
names_bucket(package.split("/")[1])over the encoded id), so an owner-lessspec missed as well.
Scope: any indexed owner, type or library whose name needs encoding — 5,070
%20(plus%2B,%28,%29,%7C, …) across the 18,806 published namesentries.
Fix
decode_component/encode_componentindownloader_mirror_manifest.rs,matching
urllib.parse.quote(..., safe="%")and the registry's UTF-8percent-encoding.
metadata_from_sharddecodes the id's owner and name before comparing, andreports the decoded spelling, so a resolved payload carries the display name
the spec asked for.
owners()reads the names shard under both spellings and unions theowners. Union, not first-hit: the published index carries all sixteen
@names-<h>shards, so a loaded shard is not proof the name was bucketedthere — the live run caught exactly that.
Proof
New test
spaced_names_resolve_through_the_encoded_index_spellingdrives thetwo
lib_depspaths (owners+package_metadata) against a fixture that nowrepeats the bucket's encoding. Pre-fix (client reverted, fixture and test kept):
With the fix, whole crate:
Live, against the published index (new ignored network test
published_index_resolves_percent_encoded_names_live, run locally once):It resolves
ESP32 HUB75 LED MATRIX PANEL DMA Display(owner-qualified andowner-less, 3.0.14 present) and
Adafruit Zero DMA Library/FastLEDfromhttps://fastled.github.io/fbuild/mirror/manifest.json.Gates:
cargo fmt --allclean,cargo clippy -p fbuild-packages-fetch --all-targets --no-depsclean, plus the crate's unit suite above.Not in this PR
FastLED 3.10.9 (the issue's first entry) is not a resolver defect: the
bucket has no such object and the committed index was generated from a bucket
snapshot that predates the release. That is the mirror/index pipeline, not
fbuild-packages-fetch; the README now states that the index lists only whatthe bucket holds.
#2019 stays open for that half (mirror pipeline + answering how a library gets
mirrored).