Skip to content

feat(registry): resolve packages from fbuild's own registry index (#1829) - #1831

Merged
zackees merged 1 commit into
mainfrom
feat/owned-registry-index-1829
Oct 31, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/owned-registry-index-1829

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

Closes #1829.

fbuild no longer queries api.registry.platformio.org. Package specs for platforms, tools, frameworks and lib_deps resolve from the #1815 mirror manifest, which now doubles as a registry index.

Data

  • Systems: each owner shard's components are owner/type/name/version/file, and asset.provides holds the PlatformIO system values a host-specific archive serves. These come from the bucket's own _state/manifest.db: 1,008 host-specific files across 18,807 packages. No provides means any host. The generator fails if any hashed object has no state-DB row, rather than defaulting it to "any host".
  • Names: 16 names-<h>.json shards (Index keys @names-<h>, bucketed by the first hex digit of the sha256 of the lowercased name) list every package as type/name/owner, with one of its archives as the asset. That keeps them valid against the strict v1 schema. Owner keys escape @, so these keys can't collide with an owner.
  • Validation: all touched documents pass manifest-validate.

Client

  • Platforms, tools, frameworks: RegistryClient (fbuild-packages-fetch) reads the Index and the owner shard, verified as in Publish fbuild-owned sha256 for every bucket object (sharded manifest); registry paths only, no GitHub mirror, no PlatformIO fallback or metadata calls #1815, and hands typed RegistryMetadata to fbuild_core::platformio_package::resolve_registry. Selection logic is unchanged.
  • Failures: an unindexed package fails with RegistryError::NotIndexed, and an unreachable index or a tampered shard fails with IndexUnavailable. Neither falls back to PlatformIO.
  • lib_deps: fbuild-library's resolver keeps its lenient version selection (e.g. 2.72) and gets its versions from the index.
  • Owner-less specs: PlatformIO's search ranked owners by popularity, which the index can't do. Instead the owner with the most indexed versions wins (FastLED resolves to fastled), and a tie is an error asking for owner/name.
  • Downloads: download URLs are still the dl.registry URL as the primary, so the bucket-first mirror flow and its sha checks apply unchanged.
  • Removed: REGISTRY_API, API_BASE, the /v3/search paging and the library search fallback. registry_api_url becomes registry_package_path (owner/type/name).

Tests

  • Unit tests: fbuild-packages-fetch, fbuild-library, fbuild-build-engine and fbuild-core all pass. New coverage:
    • short and qualified aliases, semver ranges and provides host matching;
    • ambiguous owners, unindexed packages and an unreachable index;
    • a tampered shard and offline cached resolution;
    • lenient library versions and the owner-less tie-break;
    • a guard that no runtime .rs file contains the registry API host.
  • Workspace clippy -D warnings is clean.
  • Real CLI, fresh FBUILD_CACHE_DIR, FBUILD_DEV_MODE=1, index served from site/, and a logging proxy that refuses api.registry.platformio.org. All cases passed with zero API requests:
    • fbuild install uno with lib_deps = bblanchon/ArduinoJson@^7, FastLED resolved bblanchon/[email protected] and the owner-less fastled/[email protected], both served from the bucket;
    • fbuild build uno with platform_packages = platformio/[email protected] picked the linux_x86_64 archive from the index's provides;
    • fbuild install esp32dev and d1_mini also succeeded.

Coverage

Only packages mirrored to fbuild's bucket resolve: 29,299 archives, averaging 1.5 versions per library. Anything else now fails with a clear NotIndexed error instead of silently reaching PlatformIO's API.

🤖 Generated with Claude Code

…t api.registry.platformio.org (#1829)

- Shards now carry each archive's PlatformIO system values in asset.provides
  (from the bucket's _state/manifest.db), and @names-<h> shards map package
  names to owners for owner-less specs.
- RegistryClient and fbuild-library's lib_deps resolver read the index; an
  unindexed package fails with RegistryError::NotIndexed, an unreachable
  index with IndexUnavailable. No PlatformIO fallback.
- fbuild-core keeps the selection logic (resolve_registry over typed
  RegistryMetadata); registry_api_url becomes registry_package_path.
- Guard test: no runtime .rs file references the registry API host.

Closes #1829
@coderabbitai

coderabbitai Bot commented Oct 31, 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

@zackees
zackees added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 830a891 Oct 31, 2026
29 checks passed
@zackees
zackees deleted the feat/owned-registry-index-1829 branch November 1, 2026 01:35
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 1, 2026
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.

Resolve packages from an fbuild-owned registry index instead of api.registry.platformio.org

1 participant