Repository navigation
CI: parse every web-dashboard JavaScript module with node --check - #4676
Merged
Merged
Conversation
…in the next commit)
…everted in the next commit)" This reverts commit 0c400fc.
erikdarlingdata
marked this pull request as ready for review
September 28, 2026 23:31
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4672.
What's added
.github/scripts/check-web-js.sh [root]: finds every*.jsunderDarling/PerformanceMonitor.Darling.Service/wwwroot/js, copies each to a temp.mjs(so Node parses it as an ES module whatever the nearest package.json says), runsnode --check, printsOK <file>orFAIL <file>with Node's error, and exits non-zero if any file fails (or none is found). Runs locally the same way. shellcheck clean.web-js-syntaxjob ("Web dashboard JS syntax") at the end ofbuild.yml, onubuntu-latestwith its preinstalled Node (no setup-node action to pin). Only existing action pins used:actions/checkout@v7,dorny/paths-filter@v4.needs:, so it does not depend on the build job. It always reports a result, so it can be a required check. Branch protection must list "Web dashboard JS syntax" for it to gate merges.Docs fast path
The job is independent of the build job's classify step. On a PR, a
webjsfilter (wwwroot/js/**, the script,build.yml) decides whether the parse step runs. A docs-only PR leaves it false, so the parse is skipped, a notice is printed, and the job goes green after a checkout. Push, release and merge_group runs always parse (about a second).Verified
app.js(copied into a temp tree):FAIL .../js/app.js...Illegal return statement,23 file(s) checked, 1 failed, exit 1.23 file(s) checked, 0 failed, every fileOK.function f(){}givesSyntaxError: Identifier 'f' has already been declared; top-levelreturn 1;givesSyntaxError: Illegal return statement.DarlingPathFilterGateTests,LockedModeRestoreCoverageTests,CiClusterWorkerSizingTests,NightlyVersionInjectionTests(build.yml readers) pass locally. The workflow itself is only exercised by CI.Notes
Release-notes line for a "CI" note: CI now parses and links every web-dashboard JavaScript module inside the build job, and fails the build on a syntax error, a missing file or a missing export (#4672).
CI proof: the gate has gone red once, and green on both sides of it
The check is a step inside
build("Parse and link every wwwroot/js module"), so a failure failsbuilditself.0b9387351,buildsuccess): https://github.com/erikdarlingdata/PerformanceMonitor/actions/runs/36493882293. Pass 1:23 file(s) checked, 0 failed. Pass 2:linked 23 modules, 0 failure(s).0c400fc2a, a deliberateexport const ciProofDeliberateSyntaxError = ;inderive.js,buildFAILURE on this step): https://github.com/erikdarlingdata/PerformanceMonitor/actions/runs/36494925388. Pass 1:FAIL …/wwwroot/js/derive.js,23 file(s) checked, 1 failed. Pass 2:linked 22 modules, 5 failure(s)(derive.js, plus the modules that import it).7e549f435, a normalgit revert; the tree is identical to0b9387351,buildsuccess): https://github.com/erikdarlingdata/PerformanceMonitor/actions/runs/36495420375. Pass 1:23 file(s) checked, 0 failed. Pass 2:linked 23 modules, 0 failure(s).The squash merge removes the two proof commits from dev's history; the tree is unchanged by them.
CHANGELOG
None: CI-only change (a build-job step that parses and links the web-dashboard JavaScript).