Skip to content

test(magecommand): pin the min-exclude append order per interception kind - #115

Merged
pingiun merged 1 commit into
mainfrom
test/static-min-exclude-order
Sep 3, 2026
Merged

test(magecommand): pin the min-exclude append order per interception kind#115
pingiun merged 1 commit into
mainfrom
test/static-min-exclude-order

Conversation

@pingiun

@pingiun pingiun commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The after/around mix-up fixed in #111 shipped without a test — my fixture commit didn't make it into the squash merge. This adds it against current main.

Why it was missed in the first place

The rest of the static suite is gated on an external corpus (MAGECOMMAND_CORPUS) and skips silently when it is absent, so CI never exercised that path and a real store found the bug instead. This fixture is self-contained so it runs everywhere.

What it pins

Modules append their JS minification excludes from a plugin on Minification::getExcludes, and those appends land in requirejs-min-resolver.js — a file every JS bundle embeds — so their order is deployed bytes.

  • two after plugins append in execution order — the regression;
  • two around plugins append innermost-first as the chain unwinds;
  • a mix puts the around append before the after one.

The around cases are the over-correction guard: "never reverse" is just the original bug pointing the other way, and it fails them.

Verified both directions

Passes against main as it stands. With the unconditional reverse restored, the after case comes out swapped — exactly as the deployed resolver did on the store that surfaced this.

Worth deciding separately

The corpus gate is still a hole: static_deploy, static_fulltree, static_jsbundle, static_less_file and static_requirejs all no-op without MAGECOMMAND_CORPUS, and nothing says so in CI. Making the skip loud, or pointing CI at a corpus, would close it properly.

🤖 Generated with Claude Code

…kind

The `after`/`around` mix-up fixed in #111 shipped without a test: the rest of the
static suite is gated on an external corpus (`MAGECOMMAND_CORPUS`) and skips
silently when it is absent, so CI never exercised that path and a real store
found it instead. This fixture is self-contained so it runs everywhere.

Modules append their JS minification excludes from a plugin on
`Minification::getExcludes`, and those appends land in
`requirejs-min-resolver.js` — a file every JS bundle then embeds — so their
order is deployed bytes.

Three cases over a synthetic root: two `after` plugins append in execution
order (the regression), two `around` plugins append innermost-first as the chain
unwinds, and a mix puts the around append before the after one. The `around`
cases are the over-correction guard — "never reverse" is just the original bug
pointing the other way, and it fails them.

Confirmed against main: passes with the fix, and with the unconditional reverse
restored the `after` case comes out swapped, exactly as the deployed resolver
did.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pingiun
pingiun merged commit b4c1685 into main Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant