chore(ci): verify the assets entrypoints.json actually points at - #173
Draft
Björn Meyer (BrocksiNet) wants to merge 1 commit into
Draft
chore(ci): verify the assets entrypoints.json actually points at#173Björn Meyer (BrocksiNet) wants to merge 1 commit into
Björn Meyer (BrocksiNet) wants to merge 1 commit into
Conversation
The zip guard checked the unhashed js/<name>.js path and, separately, that entrypoints.json listed at least one js entry. It never checked that the file the entry names is in the archive. Those are not always the same file. The release build emits content-hashed assets (js/<name>-PMJ7ZT4L.js) with an unhashed alias beside them: 6.5 and 6.6 construct the unhashed path by convention and never read entrypoints.json, while 6.7 follows entrypoints.json to the hashed one. So an archive whose hashed target is missing or misnamed passed the guard and then 404'd on 6.7 — silently, in the same way the bug this guard exists to catch was silent. Resolve every asset entrypoints.json references and assert each one ships, and assert the js entry 6.7 executes is the compiled bundle rather than only checking the alias. Deliberately not asserting the hashed and unhashed copies are byte-identical. They are today, but shopware-cli is free to emit the alias differently, and the "is this the real bundle" checks already catch the failures that matter. Verified against four archives: the current release artifact and a local build pass, the shipped-broken 1.2.0 zip and a vite-only zip still fail, and a synthesised archive with an intact alias but a deleted hashed target now fails where the previous guard reported OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes a hole in
bin/ci-assert-zip-admin-bundle.sh: it never checked that the assetsentrypoints.jsonpoints at are actually in the archive.Not urgent — the current release artifact is fine, verified by hand. This just makes the
guard cover the last way the original bug's failure mode could recur.
Why
The guard was written against a build that emitted only unhashed filenames. The release
build emits content-hashed assets with an unhashed alias beside them:
Those feed two different consumers:
administration/js/{technicalName}.jsby conventionentryPoints[...].jsnamesThe guard checked the unhashed path is a real bundle, and separately that the js list is
non-empty — but never that the named file exists. An archive whose hashed target was
missing or misnamed passed the guard and then 404'd on 6.7, silently, in exactly the way
the bug this guard exists to catch was silent.
How
entrypoints.jsonand assert each ships.Output now names both paths so a CI log says which lane loads what:
Deliberately not asserting the hashed and unhashed copies are byte-identical. They are
today (
1346ca66…for both js and css), but shopware-cli is free to emit the aliasdifferently and the "is this the real bundle" checks already catch the failures that matter.
Testing
Run against four real archives plus one synthesised:
OKThat last row is the point of the change.
shellcheck -x bin/*.sh bin/lib/*.shis clean,matching the
shell-lintjob.