Repository navigation
fix(ci): the reusable lanes land a module's static web assets, not only its DLLs - #3535
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The functional change is well-guarded by an executing harness and fail-closed checks; remaining feedback is limited to minor log/comment accuracy.
Pull request overview
Fixes a CI gap in the reusable node-repo gate/publish-bake workflows so externally composed module bundles land their static web assets (CSS/JS) alongside their DLL closure, preventing _content/<Module>/… 404s in browser-driven test environments.
Changes:
- Update
node-repo-gate.ymlandnode-repo-publish-bake.ymlto also copymeshweaver/moduleassets/.into/ext/<Module>/and fail closed per missing asset file. - Add a workflow-shell harness (
test-module-asset-landing.py) executed bydotnet-test.ymlto extract the real workflow step (byid:) and verify asset landing byte-for-byte with falsification arms. - Add documentation: a new architecture page plus a What’s New entry, and link the page from the Architecture index.
File summaries
| File | Description |
|---|---|
src/MeshWeaver.Documentation/Data/WhatsNew/2026-09-07-a-module-brings-its-styling-with-it.md |
Announces the fix and explains user-visible symptoms/why it stayed hidden. |
src/MeshWeaver.Documentation/Data/Architecture/ModuleStaticAssets.md |
Documents the bundle/landing/serving contract and where asset-loss can recur. |
src/MeshWeaver.Documentation/Data/Architecture.md |
Adds the new architecture page to the catalog index. |
.github/workflows/node-repo-publish-bake.yml |
Lands moduleassets into /ext/<Module>/ and validates shipped-vs-landed assets per file. |
.github/workflows/node-repo-gate.yml |
Mirrors the same external-module asset landing + fail-closed verification in the gate lane. |
.github/workflows/dotnet-test.yml |
Executes the new harness so the workflow shell is actually tested in-core CI. |
.github/scripts/test-module-asset-landing.py |
New harness to extract and execute the real workflow step and assert correct asset landing (with negative controls). |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # (workflow, job id, step id) — both lanes carry the same landing block and both are executed. | ||
| LANES = [ | ||
| (".github/workflows/node-repo-gate.yml", "ext-modules"), | ||
| (".github/workflows/node-repo-publish-bake.yml", "ext-modules"), | ||
| ] |
| echo "external module composed: $name ($(basename "$b")) — $assets static asset file(s)" | ||
| done | ||
| [ -n "$MODULE_ARGS" ] || { echo "::error::external modules were requested but none were assembled — the artifact pattern matched nothing and no registry bundle was fetched."; exit 1; } | ||
| echo "external modules: $MODULE_COUNT composed, $ASSET_MODULES of them carrying static web assets, $ASSET_FILES asset file(s) landed under /ext/<module>/wwwroot" |
| echo "sealing $name as module package '$pkg'" | ||
| done | ||
| [ -n "$MODULE_ARGS" ] || { echo "::error::external modules were requested but none were assembled — the artifact pattern matched nothing and no registry bundle was fetched."; exit 1; } | ||
| echo "external modules: $MODULE_COUNT composed, $ASSET_MODULES of them carrying static web assets, $ASSET_FILES asset file(s) landed under /ext/<module>/wwwroot" |
0489a66 to
6a45d59
Compare
…ly its DLLs `node-repo-gate.yml` and `node-repo-publish-bake.yml` composed every external module into `/ext/<Name>/` with `cp -R meshweaver/modules/.` and nothing else. A module bundle carries its static web assets separately, under `meshweaver/moduleassets/` (`NuGetPackageWriter.ModuleAssetFolder`), keeping their MODULE-RELATIVE path — which is exactly the shape `ModuleLandingService` writes beside the entry assembly and `MeshModuleStaticAssetExtensions` serves at `_content/<Name>/…`. So a module landed this way LOADED PERFECTLY and then 404'd every asset it ships, announced in one LogDebug line. Both lanes now copy `meshweaver/moduleassets/.` into the same module directory — module-relative, not `wwwroot`-specific, so a second asset root would ride too — and assert PER FILE that what the bundle ships is what the directory holds, failing closed with both numbers. Each run prints its denominator (`N composed, M carrying static web assets, K asset file(s) landed`), because an uncounted zero was what let this ride: 24 of 30 real modules legitimately ship none. `.github/scripts/test-module-asset-landing.py` EXECUTES the fix rather than asserting about it. It extracts BOTH lanes' step by `id:` (a copy would pass while the real thing rots), reads the verdict off the landed bytes' sha256, reads the bundle layout out of `NuGetPackageWriter` in src/ so a rename reds the harness, and carries two falsification arms per lane that MUTATE the real step: the pre-fix body must fail the positive case, and removing only the `cp` must trip the lane's own fail-closed check. Measured against the 30 real module bundles of MeshWeaver.Plugins run 34086016940: 6 carry assets, 294 asset files shipped, 294 landed byte-identical with the fix — and 0 of 294 landed pre-fix, at exit code 0. Closes #3514. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
6a45d59 to
2fe5484
Compare
|
Copilot's three findings are all correct and all message/comment drift, no behaviour: the They landed a minute too late: auto-merge had already enqueued this PR ( |
Closes #3514.
Which half was wrong
The lane, not the packer. A module legitimately carries static web assets and the platform has
a complete lane for them:
ModulePackCommandpackswwwroot/**→meshweaver/moduleassets/,ModuleLandingServicewrites each asset at its verbatim module-relative path beside the entryassembly, and
MeshModuleStaticAssetExtensions.ModuleWwwrootPathlooks forwwwrootbeside theloaded assembly and serves it at
_content/<Name>/…. Production is unaffected becauseServedModuleBytesreads themoduleassets/prefix correctly.The recorded constraint "modules cannot carry native or static assets" is a different claim
wearing the same words: native payloads genuinely cannot ride (
Assembly.LoadFromnever readsa module's
deps.json, #1728); static web assets can, and that half was corrected twicealready — most recently when #2221 fixed a registry shelf that discarded them.
So the two lanes'
cp -R "$u"/meshweaver/modules/. "$EXT/$name/"was simply landing half thebundle. Nothing was producing assets a module should not have.
What changed
Both
node-repo-gate.ymlandnode-repo-publish-bake.ymlnow also copymeshweaver/moduleassets/.into the same module directory, and assert per file that what thebundle ships is what the directory holds — failing closed with both numbers and the missing path.
Two deliberate refinements over the pattern in the issue:
wwwroot-specific. The packer's contract (andValidateAssetPath's) isa relative path;
wwwroot/is merely the only root it emits today.cp -R moduleassets/.survives a second root,
cp -R moduleassets/wwwroot/.does not.external modules: 30 composed, 6 of them carrying static web assets, 294 asset file(s) landed. An uncounted zero is what let this ride —24 of 30 real modules legitimately ship none, so "0 landed" looked exactly like the healthy case.
node-repo-compile-check.yml(cp modules/*.dll refs/) andnode-repo-module-pack.ymlaredeliberately unchanged: a Roslyn reference set and a bundle inspection have no request path.
Verification
.github/scripts/test-module-asset-landing.pyexecutes the lanes rather than asserting aboutthem, and runs in
dotnet-test.ymlbeside the other workflow-shell gates.id:— a copy would pass while the real thing rots. Losingthe id is RED, not a skip (watched: it dies with "no step with id 'ext-modules'").
NuGetPackageWriter.ModuleAssetFolderinsrc/, so renamingthe constant reds the harness instead of orphaning the lane.
still lands) so the harness can tell "it lands assets" from "it always passes".
Both falsification arms, watched:
node-repo-gate.yml0/12 landedcpremoved, the lane's own check keptid: ext-modulesremovedDocumentationLinkIntegrityTestfails naming itThe loop closed on the URL, not the directory. Real bundle → the lane step extracted from
node-repo-gate.yml→ a realWebApplicationwithAddMeshModuleStaticAssets()/UseMeshModuleStaticAssets()over the landed tree → an actual fetch. AgainstMeshWeaver.Blazor.Chat1.0.23 (23 assemblies, 283 assets, 5 mounts):_content/MeshWeaver.Markdown.Collaboration/Components/collaborativeMarkdownView.js— the literal URL in #3514's stack tracetext/javascript, 12,391 B, byte-identical_content/MeshWeaver.Blazor.Chat/chatResizer.js(own asset, re-based)_content/MeshWeaver.Blazor.Chat/ChatMessageList.razor.js(collocated JS)_content/MeshWeaver.Blazor.Chat/background.png(binary)Accept-Encoding: brContent-Encoding: br, byte-identical to the landed.brsibling_content/MeshWeaver.Blazor.Chat/does-not-exist.js— negative controlThe negative control is what makes the first five mean something. The pre-fix host's entire
complaint, at Debug:
Module MeshWeaver.Blazor.Chat contributes no static assets — no wwwroot at …/MeshWeaver.Blazor.Chat/wwwroot.Real-bundle measurement — the extracted lane step run against all 30 module bundles of
MeshWeaver.Plugins run 34086016940 (2026-09-07):
The 6:
Blazor.Chat283,Blazor.OpenStreetMap7,Blazor.Analysis/.EntityViews/.Graph/.Radzen1 each (their scoped-CSS aggregates).Local:
actionlint(all workflows) ·check-workflow-shell.py·check-workflow-timeouts.py(71 jobs, 0 violations) ·
check-pr-secret-preflight.py·MeshWeaver.Documentation.Test304/304 Release
-warnaserror.Work product
Doc/Architecture/ModuleStaticAssets— the four hops, the landing invariant, every site that landsa module and what each owes, why the failure is invisible to review/CI/production, and the measured
denominators. Indexed from
Doc/Architecture; What's New entry added.Two things the issue's premise gets slightly wrong
carry the
moduleassetscopy, but the PR is a different change (ci: fetch the upstream once, gate the bake in parallel…), ismergeable_state: blocked, and Education'smainstill has thebroken block — so Education's mesh e2e is still 404ing. That half is theirs to land; this change
does not touch it.
MeshWeaver.Plugins/scripts/mesh-test.pyunpacks bundles wholeand hands the mesh
--module …/meshweaver/modules/<Name>.dll, soModuleWwwrootPathresolves to…/meshweaver/modules/wwwrootwhile the assets sit at…/meshweaver/moduleassets/wwwroot. Sameshape, latent only because nothing points a browser at it — filed as
Systemorph/MeshWeaver.Plugins#1440.