R3 CI/CD: coverage gate + lint/format (dotnet format + Prettier) - #88
Merged
Conversation
Akash29g
approved these changes
Jul 15, 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.
Summary
This PR implements my Round 3 (CI/CD) slice: it makes our pipeline prove and enforce quality by adding (1) a per-layer backend code-coverage gate, (2) frontend coverage thresholds, and (3) lint/format checks for both backend and frontend. It pairs with Akash's R3 Security work (cross-tenant 404 test +
[Authorize]/non-scoped-entity audit).No product/runtime behavior changes — this is all CI + test tooling + formatting.
What & Why
1) Backend coverage gate (per layer)
scripts/coverage-gate.shwhich:--collect:"XPlat Code Coverage"using our existingcoverage.runsettings,.config/dotnet-tools.json) to produce a JSON summary per layer,2)
[ExcludeFromCodeCoverage]on infra/wiringDocAnalytics.Api/Program.cs(assembly-level attribute)Middleware/*,BackgroundServices/*,Swagger/SiteHeaderOperationFilter.cs,Realtime/SignalRPipelineNotifier.cs,Configuration/*,Extensions/*DocAnalytics.Data/DependencyInjection.cs,DataProtectionExtensions.cs,Seeding/DbSeeder.csDocAnalytics.Service/DependencyInjection.cs,Storage/S3FileStorage.cs,Alerts/SmtpEmailSender.cscoverage.runsettingsalready excludes members marked with this attribute.3) Frontend coverage thresholds
docanalytics-web/angular.jsonunder the@angular/build:unit-testbuilder:"coverageThresholds": { "lines": 73, "branches": 68 }npx ng test --watch=falsein CI now doubles as the frontend coverage gate (no extra CI script needed).coverageReporterstotext-summary+coberturafor readable CI output.4) Lint / format checks
dotnet format DocAnalytics.slnx --verify-no-changesto CI (uses root.editorconfig). Randotnet formatonce and committed the result so the verify step is green.package.json:"format": "prettier --write \"src/**/*.{ts,html,css,json}\"""format:check": "prettier --check \"src/**/*.{ts,html,css,json}\""npm run format:check. Rannpm run formatonce and committed the result.5) Workflow cleanup
ci.ymlYAML/indentation and addedshell: bash+set -euo pipefailon multi-line steps for reliable fail-fast..gitignore(coverage-out/,coverage-report/,TestResults/).New CI structure (
.github/workflows/ci.yml)dotnet format --verify-no-changes→bash scripts/coverage-gate.shnpm ci→npm run format:check→npm run build→npx ng test --watch=false(coverage thresholds enforced)dotnet list package --vulnerable+npm audit+ Trivy image scansFiles changed (high level)
scripts/coverage-gate.sh,.config/dotnet-tools.json.github/workflows/ci.yml,docanalytics-web/angular.json,docanalytics-web/package.json,.gitignoredotnet formatpass (backend) + one-time Prettier pass (frontend) — large file count but no logic changes[ExcludeFromCodeCoverage]added to infra classesHow to verify locally
Backend (CI does this on Linux; on Windows run via Git Bash/WSL):