ci(coverage): establish test-coverage baseline for Node/Vite apps in src/500-application
Nobody has claimed this yet.
- Dominant language
- HCL
- Stars
- 104
- Forks
- 48
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 24
Description
Problem Statement
PR #633 introduced the first Node/TypeScript application (Vite/esbuild + Vitest) under src/500-application/: 516-chat-with-your-factory. The app already ships Vitest with the @vitest/coverage-v8 provider and passing unit tests, but nothing in CI runs those tests, enforces them, or reports coverage to Codecov.
Rust crates in the same folder have a complete coverage + registration + enforcement contract (see .github/instructions/rust-crate-registration.instructions.md). Node/Vite apps have no equivalent, so unit tests can silently rot and coverage is invisible. This gap will repeat for every future Node/Vite app unless a shared baseline is established.
Current State (gap analysis)
| Concern | Rust (exists) | Node/Vite (missing) |
|---|---|---|
| Test + coverage runner in CI | rust-tests.yml matrix runs cargo llvm-cov → Codecov (flags: rust) |
No workflow runs npm test / vitest --coverage for 500-application apps (docusaurus-tests.yml is docs-only) |
| PR gating / change detection | rust-tests gated by changesInRust from scripts/build/Detect-Folder-Changes.ps1 |
application-matrix-builds.yml only builds Docker images; never runs unit tests/coverage |
| Codecov flag + paths | codecov.yml has flags.rust.paths + project/patch status |
No js/node flag, paths, or coverage status; 516 not registered |
| Registration enforcement | validate-rust-registration.yml + Validate-RustCrateRegistration.ps1 |
No equivalent gate for Node packages |
| Authoring docs / instructions | rust-crate-registration.instructions.md |
No instruction file for registering a Node app |
What 516 already has (local only)
test,test:watch,test:coveragescripts and@vitest/coverage-v8inpackage.json- A
vitest.config.tswith av8coverage provider (default text reporter only — no Cobertura/lcov output) - At least one real test:
src/server/factoryTool.test.ts
Proposed Solution
Build a generic baseline for all Vite/Node apps under src/500-application/, not a one-off for 516.
-
Reusable Node test/coverage workflow (e.g.
.github/workflows/node-tests.yml)- Matrix over registered Node packages under
src/500-application/ npm ci→npm run test:coverage→ upload Cobertura/lcov to Codecov under a newjs(ornode) flag- Standardize a coverage reporter (Cobertura/lcov) in each app's
vitest.config.ts(516 currently emits only the default text reporter) and a consistenttest:coveragescript convention
- Matrix over registered Node packages under
-
PR gating in
pr-validation.yml- Add a
changesInNode-style output toscripts/build/Detect-Folder-Changes.ps1so the workflow runs only when Node app files (or the workflow/codecov config) change
- Add a
-
Codecov registration in
codecov.yml- Add
flags.jswith per-apppaths, pluscoverage.status.project/patchentries, or an explicitignoreopt-out path — matching the Rust flag model
- Add
-
Registration enforcement gate
- New validator workflow + script (mirroring
Validate-RustCrateRegistration.ps1) that fails a PR when a Vite/Node app undersrc/500-application/is neither fully registered (workflow matrix + codecov flag) nor explicitly opted out
- New validator workflow + script (mirroring
-
Authoring instructions
- New
node-package-registration.instructions.mdwithapplyTo: **/src/500-application/**/package.json(+ workflow/codecov globs), documenting the registration/opt-out contract, analogous to the Rust instructions
- New
Benefits
- Node/Vite apps get the same coverage visibility and enforcement guarantees as Rust crates
- Prevents silent test rot and untracked coverage as more Node apps land under
src/500-application/ - Establishes a documented, self-service registration path for future app authors
Acceptance Criteria
- Reusable Node test/coverage workflow runs
vitestwith coverage for registered apps and uploads to Codecov under a dedicated flag -
516-chat-with-your-factoryis registered and reporting coverage as the first consumer - Node tests are PR-gated on Node-relevant changes via
Detect-Folder-Changes.ps1 -
codecov.ymlhas a Node/JS flag with paths + project/patch status (and an opt-out path) - A CI gate fails PRs that add an unregistered/opted-out Vite/Node app
- Instruction file documents the registration and opt-out process
- A standard
test:coveragescript + coverage reporter convention is documented for new apps
Notes / Open Questions
- Flag naming: reuse
jsto align with the existingfuzz-js-*scheme, or usenode? - Node version: standardize on
24(used across existing workflows) vs. per-appengines - Should coverage thresholds start
informational: true(like Rustpatch) to avoid blocking early adopters?
Related Issues
- Prerequisite implementation slice for the JS/TS stack of #175 (
ci(coverage): enforce 80% coverage thresholds across all language stacks). #175 assumes vitest coverage is already produced and uploaded for JS/TS code, which does not yet exist forsrc/500-application/Node apps. Recommend tracking this as a dependency of #175. - #140 (
add coverage thresholds to frontend vitest configuration, closed) covereddocs/docusaurus JS only — no overlap. - #155 (Rust coverage) and #455 (extract
-corecrates from WASM operators) are the Rust-side precedent this issue mirrors — no functional overlap. - #144 (
docs(testing): update testing-validation.md) is documentation-only and would consume the conventions this issue establishes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .github/instructions/rust-crate-registration.instructions.md, rust-tests.yml, application-matrix-builds.yml, pr-validation.yml, codecov.yml, and scripts/build/Detect-Folder-Changes.ps1. Inspect 516-chat-with-your-factory/package.json and vitest.config.ts, then compare its setup with the Rust registration and coverage flow. Done means registered Node coverage runs in CI, reports to Codecov, is change-gated, and has validation and authoring instructions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, nodejs, powershell, typescript, vite
- Domain
- build-system, ci-cd, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100