Skip to content

fix(fetch): resolve registry names the mirror stores percent-encoded (#2019) - #2026

Merged
zackees merged 3 commits into
mainfrom
agent/registry-names-encoded
Nov 16, 2026
Merged

zackees merged 3 commits into
mainfrom
agent/registry-names-encoded

Conversation

@zackees

@zackees zackees commented Nov 16, 2026

Copy link
Copy Markdown
Member

Why

#2019 reports two lib_deps entries failing with "is not in fbuild's registry
index"
even though the index holds them: mrfaptastic/ESP32 HUB75 LED MATRIX PANEL DMA [email protected] and adafruit/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_shard compared id_name (ESP32%20HUB75%20...) against the
    spec name and reported that encoded spelling as the package name;
  • owners() hashed the display name for @names-<h>, while
    ci/gen_mirror_manifest.py buckets those shards by the bucket key's segment
    (names_bucket(package.split("/")[1]) over the encoded id), so an owner-less
    spec 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 names
entries.

Fix

  • decode_component / encode_component in downloader_mirror_manifest.rs,
    matching urllib.parse.quote(..., safe="%") and the registry's UTF-8
    percent-encoding.
  • metadata_from_shard decodes the id's owner and name before comparing, and
    reports 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 the
    owners. Union, not first-hit: the published index carries all sixteen
    @names-<h> shards, so a loaded shard is not proof the name was bucketed
    there — the live run caught exactly that.

Proof

New test spaced_names_resolve_through_the_encoded_index_spelling drives the
two lib_deps paths (owners + package_metadata) against a fixture that now
repeats the bucket's encoding. Pre-fix (client reverted, fixture and test kept):

assertion `left == right` failed
  left: []
 right: ["mrfaptastic"]
test result: FAILED. 270 passed; 1 failed; 1 ignored

With the fix, whole crate:

test result: ok. 271 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 8.88s

Live, against the published index (new ignored network test
published_index_resolves_percent_encoded_names_live, run locally once):

test platformio_registry::tests::published_index_resolves_percent_encoded_names_live ... ok
test result: ok. 1 passed; 0 failed; 0 ignored

It resolves ESP32 HUB75 LED MATRIX PANEL DMA Display (owner-qualified and
owner-less, 3.0.14 present) and Adafruit Zero DMA Library / FastLED from
https://fastled.github.io/fbuild/mirror/manifest.json.

Gates: cargo fmt --all clean, cargo clippy -p fbuild-packages-fetch --all-targets --no-deps clean, 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 what
the bucket holds.

#2019 stays open for that half (mirror pipeline + answering how a library gets
mirrored).

…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.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

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).
@zackees
zackees added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit 7df790c Nov 16, 2026
30 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 17, 2026
@zackees
zackees deleted the agent/registry-names-encoded branch November 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant