ci: adopt the current node.js.yml and standards-check.yml - #49
Merged
Conversation
The standard was pinned to a commit tarball (codeload.../tar.gz/1726fe5, node-red-standards 0.3.0), so this repo stopped receiving it three releases ago while `standards-check` kept reporting a clean audit against the frozen copy. That is also why .github/workflows/node.js.yml here still has no coverage step: the workflow that added one never arrived. Now `github:windkh/node-red-standards`, which dependabot can move; 0.5.0 treats any other specifier for itself as drift. Adding the c8 block matters more than it looks. There was none, and `c8 --check-coverage` with no block falls back to c8's own defaults -- 90% lines. Measured here: 56.56% lines, 71.6% branches, 64% functions. So the moment the current node.js.yml arrives with its `npm run coverage:check` step, CI would have gone red on a threshold nobody chose. The thresholds are therefore set explicitly at the measured floor, and the reporter now emits lcov so the workflow's coverage artifact contains something readable instead of only c8's raw V8 dump. Verified: lint, format:check, 20 tests, coverage:check all pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0.5.1 adds one audit check: c8.lines must be stated explicitly. c8 defaults it to 90 rather than 0, so an omitted floor is a coverage gate nobody chose. This repo already declares one, so the check passes as-is. Refreshed with `npm update` rather than `npm install`, which does not re-resolve a git dependency whose existing entry already satisfies the specifier -- the mechanism that had kept this reference stale. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last of the pin damage. While node-red-standards was frozen at 0.3.0 these two workflows never received an update, and both mattered. standards-check.yml did `npm ci` + `npx nrstd audit`, i.e. it audited against the version in this repo's own lockfile -- 0.3.0, whose rule set had ten checks, none of which this repo failed. So it reported a clean 10/10 for three releases while .gitattributes, the workflows and the c8 block went unexamined, because those rules did not exist in the frozen copy. The template form (`npx --yes github:windkh/node-red-standards audit`) always resolves the current standard, which is the only form that can detect drift -- a drift detector pinned to an old rule set reports on the wrong question. It is also faster: 13s against 21s, since there is no install to do. node.js.yml had no coverage step at all, which is why the missing c8 block here stayed invisible. It now runs `npm run coverage:check` and uploads the readable half of the report as a build artifact. Also drops `npm run build --if-present`, a leftover from GitHub's starter workflow -- there is no build script. npm-publish.yml is deliberately left alone. It is not stale, it is a different model: triggered by a version tag and creating the GitHub release itself, where the template is triggered by a manually created release. That is a decision to make rather than a drift to correct, raised separately. Verified locally on this branch: lint, format:check, 20 tests, coverage:check exits 0, and coverage/lcov.info plus coverage/lcov-report are produced -- the paths the artifact step uploads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Re-opened as new PR because the original #48's base branch was deleted when #47 merged. Same content — see #48 for full rationale.