Files
superset2/superset-frontend
Joe Li cfaeb11468 fix(subdirectory): reinstate invariants scan, harden scanner
The shard-6 hang reproduced on master independently of this PR — earlier
diagnostic edits (skipping the invariants scan) are no longer needed.

Reinstates the static-invariant scan in
`navigationUtils.invariants.test.ts` and keeps the previously seeded
PATH_UTILS_IMPORT_ALLOWLIST so the suite is GREEN today and shrinks as
each migration commit lands.

Also hoists the regex compile out of the per-line loop in
`scanSource`. With no `g` flag, `RegExp.exec()` ignores `lastIndex`, so
recompiling per line was wasted allocation across ~1.5M lines workspace-
wide. If the source pattern includes `g`, the helper now strips it once
at the top of the file rather than relying on per-line construction.

Adds `jest.setTimeout(20000)` to `navigationUtils.test.ts` as a
defence-in-depth safety net — any future hang surfaces a Jest timeout
error with the test name rather than running for the workflow's
six-hour wallclock limit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 14:51:16 -07:00
..