Skip to content

test(backfill-images): kill slug-filter CI forks-pool flake - #2812

Merged
jung-thomas merged 6 commits into
DEVfrom
worktree-flake-backfill-images-2808
Oct 16, 2026
Merged

jung-thomas merged 6 commits into
DEVfrom
worktree-flake-backfill-images-2808

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

What

The lone CI unit-test failure (backfill-images-slug-filter.test.ts > restricts enumeration to the target slug, expected [] to deeply equal ['beta']) was a pre-existing non-hermetic flake, not a regression from #2808/#2809 — both the test and scripts/backfill-images.ts are 5 weeks old (last touched in #2288) and untouched by the recent merges.

Root cause

  • Passes 5/5 locally and in isolation; only fails in the full 1490-file, 4-worker CI forks-pool run, and only after retry:1 already fired.
  • collectImageUrls reaches extractImgCdnUrls via the workspace-first async-import shim in srv/lib/image-warm-utils.js (try await import('@tutorials/content/...') catch await import(bundle)). A per-file beforeAll fixture + that lazily-resolved binding left shared state exposed to cross-attempt/worker timing.
  • The extraction logic itself is provably correct: the workspace module and the CF-deploy bundle (content.bundle.mjs, built by scripts/bundle-shared.cjs in CI) return identical output on the test input.
  • The 116-file import-shim convention is load-bearing (CF deploy fallback) and is not touched.

Fix (test-only)

  • Move fixtures to beforeEach/afterEach so every attempt — including the retry — is fully self-contained; removes the shared-closure flake surface.
  • Add a beforeEach sanity guard asserting the fixture contains /img-cdn?u= and collectImageUrls resolved to a function. Any future silent empty-map now fails loudly and diagnosably instead of flaking — directly addressing the 'why do we tolerate flaky red?' concern.

Verification

  • 5/5 pass locally ×3 and under CI=1 forks pool.
  • Deliberately broke the fixture → all 5 fail at the guard with a clear message (expected '…/BROKEN…' to contain '/img-cdn?u='), confirming the guard is not a no-op.

🤖 Generated with Claude Code

jung-thomas and others added 6 commits October 15, 2026 16:34
Bump deploy version 1.38.0 -> 1.39.0 (.deploy/mta.yaml) for the DEV->main
promotion and refresh the user-facing What's New digest
(hugo/data/whats_new.json) with 24 summarized PRs merged since 1.38.0.

Headline: URL Health subsystem for tutorials/missions/groups (#2787) —
nightly + on-demand broken/slow link detection and membership-integrity
reporting in a new Admin UI screen.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…pendent

The new URL Health admin tile (app/admin/health) failed to render with a
runtime ModuleError: "failed to load sap/ui/model/odata/v4/library.js ...
script load error". Three defects compounded:

1. manifest + (intended) ui5.yaml listed `sap.ui.model.odata.v4` under
   dependency libs. That is NOT a SAPUI5 framework library — the OData V4
   model ships inside `sap.ui.core`. `ui5 build` can't resolve it
   ("Could not find library"), so copy-components.js silently fell back from
   the preload build to a raw copy that ships NO Component-preload.js.
   UI5 then lazy-loaded each declared lib from the CDN at runtime, and the
   bogus odata/v4 path 404'd → the ModuleError.

2. app/admin/health had no ui5.yaml AND no package.json. `ui5 build` needs
   both; without them it walked up to app/admin (tutorials-admin-fiori,
   ui5:null) and failed project resolution — another path to the same raw-copy
   fallback.

Fix: add app/admin/health/{ui5.yaml,package.json} matching the sibling apps,
and drop the non-existent sap.ui.model.odata.v4 lib from both the manifest and
ui5.yaml (sap.m + sap.ui.core only). Result: 52/52 admin components now
preload-build (was 51/52, health raw-copied); health ships a real
Component-preload.js and no longer hits the CDN.

Guard so this class can't ship silently again: discoverComponents() now throws
at build time when a non-excluded admin component lacks its ui5.yaml, with a
message pointing at the raw-copy/CDN failure mode and the PRELOAD_EXCLUDE
opt-out. preload-components.cjs threads PRELOAD_EXCLUDE through so excluded
tiles stay exempt. Unit tests cover the real tree, a throwing fixture, and the
exempt path.
Bump deploy version 1.39.0 -> 1.39.1 (.deploy/mta.yaml) for the DEV->main
promotion and refresh the What's New digest (hugo/data/whats_new.json).

Patch release: carries #2796 — make the URL Health admin tile
preload-buildable (bundled into the admin UI, not CDN-dependent), a
follow-up to the URL Health subsystem shipped in 1.39.0 (not yet deployed
to PROD; this is the version that will deploy).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…s-pool flake

The 'restricts enumeration to the target slug' test intermittently failed in
CI (expected [] to deeply equal ['beta']) even with retry:1, while passing
every time locally and in isolation. Root cause: a per-file beforeAll fixture
plus the workspace-first async-import shim in srv/lib/image-warm-utils.js left
the fixture and the lazily-resolved extractImgCdnUrls binding exposed to
cross-attempt/worker timing under the Vitest-4 forks pool. The code path is
correct (both the workspace module and the deploy bundle extract identically).

- Move fixtures to beforeEach/afterEach so every attempt (incl. retry) is fully
  self-contained; drop the shared closure state that was the flake surface.
- Add a beforeEach sanity guard: assert the fixture contains /img-cdn?u= and
  that collectImageUrls resolved to a function, so any future silent empty-map
  (broken shim resolution) fails loudly and diagnosably instead of flaking.

No production code touched; the 116-file import-shim convention is unchanged.
@jung-thomas
jung-thomas merged commit fdceca1 into DEV Oct 16, 2026
5 of 6 checks passed
@jung-thomas
jung-thomas deleted the worktree-flake-backfill-images-2808 branch October 16, 2026 21:10
jung-thomas added a commit that referenced this pull request Oct 17, 2026
test(backfill-images): fix the real signature regression #2812 misdiagnosed as a flake (#2813)
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