Skip to content

feat(fetch): server-side download fallback settings via manifest.json (#1810) - #1811

Merged
zackees merged 2 commits into
mainfrom
feat/mirror-manifest-1810
Oct 31, 2026
Merged

zackees merged 2 commits into
mainfrom
feat/mirror-manifest-1810

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

Closes #1810.

What

  • Server side: site/mirror/manifest.json is a zackees/manifest.json v1 Release. Each asset lists urls: [bucket, vendor] with size_bytes and sha256. It is generated by ci/gen_mirror_manifest.py, which HEAD-checks the bucket and hashes the bucket copy, and it passes manifest-validate. The Pages publish step in benchmark-build-comparison.yml copies it to https://fastled.github.io/fbuild/mirror/manifest.json, and the raw file on main is the second source.
  • Client (fbuild-packages-fetch):
    • Fetch and cache: the manifest is fetched once per process with a 10 s budget per source. It is cached for 24 h; if the server fails, fbuild uses the stale cache, then the built-in bucket rule from feat(fetch): download from fbuild's mirror bucket by default (#1806) #1807.
    • Order: the manifest's URL order decides the attempt order.
    • Checksums: mirror bytes are checked against sha256, and a mismatch makes fbuild skip that mirror. Vendor bytes are never rejected for a manifest mismatch.
    • Yanked: a yanked asset means vendor only.
    • Validation: one invalid entry rejects the whole document. That covers non-HTTPS URLs, userinfo, duplicate URLs, a bad sha, a wrong kind or schema_version, and bodies over 8 MiB.
    • Overrides: FBUILD_DOWNLOAD_MIRRORS still wins. FBUILD_MIRROR_MANIFEST_URL overrides the source, and an empty value disables the manifest.

Adversarial verification

  • Unit tests: soldr cargo test -p fbuild-packages-fetch passes 238 tests, 26 of them new manifest tests: hostile documents, a down server with a stale cache, no cache, a corrupt cache, a second source, oversized streaming, a tampered mirror (buffered and streaming, part file removed), a wrong manifest sha, and yanked entries. Clippy is clean.
  • Mutation check: disabling the digest check or the duplicate check makes 4 tests fail.
  • Bucket integrity: the bucket copy's sha256 matches the vendor's for all 14 entries under 60 MB.
  • End to end with the real CLI: fbuild install tests/platform/uno -e uno, each run with a fresh cache and a locally served manifest:
    • Tampered mirror: rejected with "manifest expects …", the vendor served it, and the install succeeded.
    • Good mirror: "served from mirror".
    • Hostile manifest: rejected as a whole, and fbuild fell back to the built-in bucket.
    • Garbage manifest: ignored.
    • Empty FBUILD_MIRROR_MANIFEST_URL: the manifest was never fetched.
  • Still to run: the live #[ignore] test published_manifest_resolves_live, after Pages deploys.

🤖 Generated with Claude Code

…on document (#1810)

fbuild now reads a zackees/manifest.json v1 Release published on GitHub
Pages (site/mirror/manifest.json, generated by ci/gen_mirror_manifest.py)
whose assets list, in order, the URLs each artifact can be fetched from
plus its sha256. Mirror bytes that do not match the sha are rejected and
the next URL is tried; vendor bytes are never rejected for a manifest
mismatch. The document is cached for 24 h with a stale-cache fallback;
one invalid entry rejects the whole document. FBUILD_DOWNLOAD_MIRRORS
still wins; FBUILD_MIRROR_MANIFEST_URL overrides or (empty) disables.

Closes #1810
@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 7b6bbc0 Oct 31, 2026
41 of 43 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 1, 2026
@zackees
zackees deleted the feat/mirror-manifest-1810 branch November 5, 2026 05:51
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.

Server-side download fallback settings via a manifest.json document on GitHub Pages

1 participant