Repository navigation
feat(ci): fold all asset declaration parsing into one scanner - #3990
Conversation
Three parsers for the same concept had drifted apart:
- ci/compiler/asset_scanner.py text `.lnk` (mirrors the C++ runtime)
- fbuild lnk/format.rs JSON `.lnk`
- a third draft parser JSON `.lnk` + assets.json
The formats are mutually unreadable, so a sketch using one toolchain's
format was invisible to the other. examples/AudioUrl (text) and any
sketch using `fbuild lnk add` (JSON) could not both be scanned.
asset_scanner is now the single Python entry point and accepts every form:
- `*.lnk` text — first non-comment line is the URL, then key=value
- `*.lnk` JSON — {"v":1,"url":...,"sha256":...,"size":...,"extract":...}
- `assets.json` — several assets declared in one file
Format detection sniffs the first non-blank, non-comment character. A
`.lnk` overrides an assets.json entry of the same name, so a sketch can
override one entry of a shared manifest.
AssetEntry gains `size` and `extract` (JSON-only fields). The emitted
manifest keeps its exact previous shape — url/sha256/fallback always
present including nulls, the new keys emitted only when set — so existing
WASM consumers see no change.
The redundant third parser is deleted rather than kept in sync.
Materialization stays fbuild's job (`fbuild lnk pull`); this only parses.
Verified: both committed `.lnk` files parse through the one scanner with
zero warnings, and `bash compile wasm --examples AudioUrl` succeeds.
24 tests (12 pre-existing, all still passing).
Refs #3986, FastLED/fbuild#1357
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 2 minutes Limit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
Problem
Three parsers existed for the same concept, and they had drifted into mutually unreadable formats:
ci/compiler/asset_scanner.py.lnklnk/format.rs.lnk.lnk+assets.jsonThe consequence is concrete:
examples/AudioUrl/data/track.mp3.lnkis text, so anything written byfbuild lnk add(JSON) was invisible to the scanner, and vice versa. A sketch could not be read by both toolchains.Change
asset_scannerbecomes the single Python entry point and accepts every form in use:*.lnktext — first non-comment line is the URL, thenkey=valuemetadata. Unchanged; still mirrors the C++ runtime (fl::parse_lnk_with_metadata()insrc/fl/stl/url.h).*.lnkJSON —{"v": 1, "url": ..., "sha256": ..., "size": ..., "extract": ...}, whatfbuild lnk addwrites.assets.json— several assets declared in one file.Format detection sniffs the first non-blank, non-comment character:
{means JSON, anything else is text. A.lnkoverrides anassets.jsonentry of the same name, so a sketch can override one entry of a shared manifest without editing it.The redundant third parser is deleted rather than kept in sync. Materialization stays fbuild's job (
fbuild lnk pull); this module only parses and emits the manifest.Compatibility
AssetEntrygainssizeandextract(JSON-only fields), but the emitted manifest keeps its exact previous shape:url/sha256/fallbackalways present including nulls, and the new keys emitted only when actually set. A text-format.lnkserializes byte-identically to before, so existing WASM consumers see no change.Verification
Both committed
.lnkfiles parse through the one scanner, zero warnings:bash compile wasm --examples AudioUrl— build successful (exercises the manifest path).lnkschema,assets.json, both formats coexisting in one sketch,.lnkprecedence, malformed-input warnings that don't fail the build, and a guard that the real committed.lnkkeeps parsingbash lintcleanRefs #3986, FastLED/fbuild#1357
🤖 Generated with Claude Code