Fix boilerplate file resolution fallback to readonly data - #3309
Fix boilerplate file resolution fallback to readonly data#3309bwalderman wants to merge 1 commit into
Conversation
|
Oh jeez, I know what the issue is. It's been a while since I last bumped the Sorry, this is the sort of thing that's a little hard to catch during testing because my state is already fixed up to the latest version. Normally I use an internal bikeshed command to reset the readonly files, which tells me to bump the version number, but because this was limited to the boilerplates I hadn't run that. I'm gonna go ahead and just bring the entire readonly directory up to date with the most recent |
|
All right, 7.1.1 released with a fully updated |
Problem
Bikeshed 7.1.0 fails to build specs that rely on bundled boilerplate data, producing:
This affects any spec without local boilerplate overrides. The same specs build successfully with 7.0.14.
Root Cause
Commit d924eca updated
retrieveBoilerplateFile()inretrieve.pyto search new-style paths (org-{org}/{group}/,org-{org}/,default/). The bundled readonly data inspec-data/readonly/boilerplate/was correctly restructured to match.However,
retrieveBoilerplateFile()constructsFileInputSourceobjects usingdataFile.path(), which only resolves paths in the latest (mutable) data directory (spec-data/boilerplate/). This directory either:bikeshed updatehas been run), orwebml/,w3c/) afterbikeshed update, becausespeced/bikeshed-datastill serves the old flat structure.In both cases, the new-style paths aren't found in the latest directory. The
DataFileRequesterfallback to readonly data is designed to work throughfetch()(which catchesOSErrorand retries with the fallback requester), butretrieveBoilerplateFile()bypassesfetch()entirely and it callsdataFile.path()to build a path string, wraps it in aFileInputSource, and calls.read()directly. The readonly fallback is never invoked.How Found
CI for webmachinelearning/webmcp PR #204 started failing after the bikeshed 7.1.0 release. Traced the issue to the mismatch between the paths
retrieveBoilerplateFile()searches and the paths that actually exist on disk.Fix
Changed
boilerplatePath()(singular) toboilerplatePaths()(plural), which returns candidate paths from both the latest and readonly data directories by consultingdataFile.fallback. For each boilerplate include, the search now tries the latest path first, then falls back to the readonly path restoring the intended fallback behavior thatDataFileRequesterprovides throughfetch().This is a minimal, low-risk fix that doesn't change the search order or priority semantics. The underlying issue is that
bikeshed updatedownloads boilerplate into old-style paths while the code expects new-style paths remains, but this fix ensures the bundled readonly data is always reachable as a fallback.Testing
Verified against the webmachinelearning/webmcp spec (
Status: CG-DRAFT,Group: webml).