Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
438 changes: 438 additions & 0 deletions .github/scripts/test-module-asset-landing.py

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions .github/workflows/dotnet-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,17 @@ jobs:
- name: "Execute publish-bake-bundles.sh with two publishers on one prefix"
run: python3 .github/scripts/test-publish-bake-overlap.py

# The gate and publish-bake lanes compose every external module into /ext/<Name>/ for the
# tester container, and until #3514 they copied `meshweaver/modules/` alone — leaving a module
# that LOADS and then 404s every static asset it ships (`meshweaver/moduleassets/`), announced
# in one LogDebug line. Latent here (the bake is mesh-free, the gate runs no browser) and fine
# in production, so nothing could catch it: MeshWeaver.Education, which copied the block into a
# browser-driven mesh e2e, rendered a bare Code card where the workbench belongs for three days.
# This EXTRACTS both lanes' step by `id:` and executes it against real bundle shapes, reading
# the verdict off the landed bytes — with two arms that mutate the real step and must go RED.
- name: "Execute the lanes' external-module landing against real bundle shapes"
run: python3 .github/scripts/test-module-asset-landing.py

# carry-forward-bundles.sh is the other half of that publication and had NO CI execution at
# all: it runs only inside a node repo's publish lane, so the first execution of an edit was a
# production publish. Its self-test covers the shrink refusals it has always owed and the
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/node-repo-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,11 @@ jobs:
# once, while bumping their pins past #2276: 17 packages failed to install in one run.
# Every failure below is RED and NAMED, because a gate that quietly ran without a module it
# needed is worse than one that did not run at all.
# `id:` is load-bearing: test-module-asset-landing.py EXTRACTS this step's shell by id and
# executes it against synthetic bundles. A copy of the block in the harness would pass while
# the real thing rots, so the harness fails RED if this id disappears.
- name: "External modules: assemble what the gate must compose"
id: ext-modules
if: inputs.module-artifacts != '' || inputs.registry-modules != ''
env:
REGISTRY_MODULES: ${{ inputs.registry-modules }}
Expand Down Expand Up @@ -894,6 +898,9 @@ jobs:
fi
shopt -s nullglob
MODULE_ARGS=""
MODULE_COUNT=0
ASSET_MODULES=0
ASSET_FILES=0
for b in "$BUNDLES"/*.nupkg "$BUNDLES"/*.zip; do
u="${RUNNER_TEMP:-/tmp}/unpack-$(basename "$b")"; rm -rf "$u"; mkdir -p "$u"
unzip -o -q "$b" -d "$u"
Expand All @@ -907,10 +914,39 @@ jobs:
test -f "$u/meshweaver/modules/$name.dll" || { echo "::error::$(basename "$b"): meshweaver/modules/$name.dll is missing from the bundle"; exit 1; }
mkdir -p "$EXT/$name"
cp -R "$u"/meshweaver/modules/. "$EXT/$name/"
# 🚨 A module bundle carries its STATIC WEB ASSETS separately from the flat closure,
# under `meshweaver/moduleassets/` (NuGetPackageWriter.ModuleAssetFolder), and they keep
# their MODULE-RELATIVE path — `wwwroot/x.js`, `wwwroot/_content/<Dep>/y.css`. That is
# the shape ModuleLandingService writes verbatim beside the entry assembly, and it is
# the shape MeshModuleStaticAssetExtensions then serves at `_content/<Name>/…` off
# `<module folder>/wwwroot`. Copying only `meshweaver/modules/` therefore lands a module
# that LOADS PERFECTLY and 404s every asset it ships, saying so in ONE Debug line —
# which is why it survived: MeshWeaver.Education's mesh e2e rendered a bare Code node
# card where the workbench belongs for three days after MeshWeaver.Plugins#1268 moved
# the collaboration views into MeshWeaver.Markdown.Collaboration (MeshWeaver#3514).
assets=0
if [ -d "$u/meshweaver/moduleassets" ]; then
cp -R "$u"/meshweaver/moduleassets/. "$EXT/$name/"
# Fail CLOSED, per file, against a DENOMINATOR: what the bundle ships is the
# expectation, what the module folder holds is the measurement. A landing that copied
# nothing must go RED here rather than report a green zero — an uncounted zero is
# exactly what let the gap above ride for three days.
( cd "$u/meshweaver/moduleassets" && find . -type f ) | sed 's|^\./||' > "${u}.shipped-assets"
assets=$(wc -l < "${u}.shipped-assets" | tr -d ' ')
missing=0
while IFS= read -r rel; do
[ -f "$EXT/$name/$rel" ] || { echo "::error::$name: shipped static asset '$rel' did not land at /ext/$name/$rel"; missing=$((missing + 1)); }
done < "${u}.shipped-assets"
[ "$missing" -eq 0 ] || { echo "::error::$(basename "$b"): $missing of $assets shipped static asset(s) are missing from /ext/$name — a browser rendering against this mesh would 404 them"; exit 1; }
[ "$assets" -eq 0 ] || ASSET_MODULES=$((ASSET_MODULES + 1))
fi
ASSET_FILES=$((ASSET_FILES + assets))
MODULE_COUNT=$((MODULE_COUNT + 1))
MODULE_ARGS="$MODULE_ARGS --module /ext/$name/$name.dll"
echo "external module composed: $name ($(basename "$b"))"
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 "EXT_MODULES_DIR=$EXT" >> "$GITHUB_ENV"
echo "EXT_MODULE_ARGS=$MODULE_ARGS" >> "$GITHUB_ENV"
- name: Import + compile + render + run tests for each node repo
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/node-repo-publish-bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,11 @@ jobs:
# NodeType binds must be handed in explicitly. Every failure here is RED and NAMED — a bake
# that quietly ran without a module it needed blames the CONTENT (CS0246), which is exactly
# the misdiagnosis that froze the fleet on 2026-08-28.
# `id:` is load-bearing: test-module-asset-landing.py EXTRACTS this step's shell by id and
# executes it against synthetic bundles. A copy of the block in the harness would pass while
# the real thing rots, so the harness fails RED if this id disappears.
- name: "External modules: assemble what the compile surface must compose"
id: ext-modules
if: inputs.module-artifacts != '' || inputs.registry-modules != ''
env:
REGISTRY_MODULES: ${{ inputs.registry-modules }}
Expand Down Expand Up @@ -934,6 +938,9 @@ jobs:
fi
shopt -s nullglob
MODULE_ARGS=""
MODULE_COUNT=0
ASSET_MODULES=0
ASSET_FILES=0
for b in "$BUNDLES"/*.nupkg "$BUNDLES"/*.zip; do
u="${RUNNER_TEMP:-/tmp}/unpack-$(basename "$b")"; rm -rf "$u"; mkdir -p "$u"
unzip -o -q "$b" -d "$u"
Expand All @@ -947,8 +954,36 @@ jobs:
test -f "$u/meshweaver/modules/$name.dll" || { echo "::error::$(basename "$b"): meshweaver/modules/$name.dll is missing from the bundle"; exit 1; }
mkdir -p "$EXT/$name"
cp -R "$u"/meshweaver/modules/. "$EXT/$name/"
# 🚨 A module bundle carries its STATIC WEB ASSETS separately from the flat closure,
# under `meshweaver/moduleassets/` (NuGetPackageWriter.ModuleAssetFolder), and they keep
# their MODULE-RELATIVE path — `wwwroot/x.js`, `wwwroot/_content/<Dep>/y.css`. That is
# the shape ModuleLandingService writes verbatim beside the entry assembly, and it is
# the shape MeshModuleStaticAssetExtensions then serves at `_content/<Name>/…` off
# `<module folder>/wwwroot`. Copying only `meshweaver/modules/` therefore lands a module
# that LOADS PERFECTLY and 404s every asset it ships, saying so in ONE Debug line —
# which is why it survived: MeshWeaver.Education's mesh e2e rendered a bare Code node
# card where the workbench belongs for three days after MeshWeaver.Plugins#1268 moved
# the collaboration views into MeshWeaver.Markdown.Collaboration (MeshWeaver#3514).
assets=0
if [ -d "$u/meshweaver/moduleassets" ]; then
cp -R "$u"/meshweaver/moduleassets/. "$EXT/$name/"
# Fail CLOSED, per file, against a DENOMINATOR: what the bundle ships is the
# expectation, what the module folder holds is the measurement. A landing that copied
# nothing must go RED here rather than report a green zero — an uncounted zero is
# exactly what let the gap above ride for three days.
( cd "$u/meshweaver/moduleassets" && find . -type f ) | sed 's|^\./||' > "${u}.shipped-assets"
assets=$(wc -l < "${u}.shipped-assets" | tr -d ' ')
missing=0
while IFS= read -r rel; do
[ -f "$EXT/$name/$rel" ] || { echo "::error::$name: shipped static asset '$rel' did not land at /ext/$name/$rel"; missing=$((missing + 1)); }
done < "${u}.shipped-assets"
[ "$missing" -eq 0 ] || { echo "::error::$(basename "$b"): $missing of $assets shipped static asset(s) are missing from /ext/$name — a browser rendering against this mesh would 404 them"; exit 1; }
[ "$assets" -eq 0 ] || ASSET_MODULES=$((ASSET_MODULES + 1))
fi
ASSET_FILES=$((ASSET_FILES + assets))
MODULE_COUNT=$((MODULE_COUNT + 1))
MODULE_ARGS="$MODULE_ARGS --module /ext/$name/$name.dll"
echo "external module composed: $name ($(basename "$b"))"
echo "external module composed: $name ($(basename "$b")) — $assets static asset file(s)"
# 🚨 The bytes this bake composes are the bytes its publication SEALS (modules/<pkg>.module.nupkg,
# MeshWeaver#2698): a consumer pinned to this identity composes exactly these, never the
# registry's. Keyed by PACKAGE id, which is what a consumer asks for (registry-modules).
Expand All @@ -967,6 +1002,7 @@ jobs:
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"
echo "EXT_MODULES_DIR=$EXT" >> "$GITHUB_ENV"
echo "EXT_MODULE_ARGS=$MODULE_ARGS" >> "$GITHUB_ENV"
echo "SEAL_MODULES_DIR=${RUNNER_TEMP:-/tmp}/seal-modules" >> "$GITHUB_ENV"
Expand Down
Loading
Loading