Back to Developer Guide

Quality Gates

Last updated

Every check enforced from developer workstation to production deployment, mapped to BSI C5:2020, the OWASP Top 10 (2021), the Cyber Resilience Act, the EHDS regulation and WCAG 2.2 AA where a criterion fits, and left unmapped where none does.

Pipeline Overview

Four-stage quality pipeline from commit to compliance

Stage 1 — Pre-commit Hooks

The 36 hooks configured in .pre-commit-config.yaml, in the order they run. They run before every git commit, and the PR Gate runs them again on the pull request's diff. Hooks that rewrite a file (Prettier, end-of-file) fail the commit; stage the file again and commit.

HookSourceStage
trailing-whitespacepre-commit-hookspre-commit
end-of-file-fixerpre-commit-hookspre-commit
check-yamlpre-commit-hookspre-commit
check-jsonpre-commit-hookspre-commit
check-added-large-filespre-commit-hookspre-commit
check-merge-conflictpre-commit-hookspre-commit
detect-private-keypre-commit-hookspre-commit
check-case-conflictpre-commit-hookspre-commit
check-symlinkspre-commit-hookspre-commit
check-executables-have-shebangspre-commit-hookspre-commit
check-shebang-scripts-are-executablepre-commit-hookspre-commit
shellcheckshellcheck-pypre-commit
hadolint-dockerhadolintpre-commit
prettierlocalpre-commit
TypeScript (UI)localpre-commit
ESLint (UI)localpre-commit
Vitest (UI)localpre-push
iPhone app analyte parity (swift run AnalyteParity)localpre-push
CodeQL on the iPhone app (Swift, about 15 min)localpre-push
Secret Scan (gitleaks)localpre-commit
Static analysis (Semgrep)localpre-commit
Semgrep rule tests (.semgrep/)localpre-commit
Broken links (Markdown)localpre-commit
No screenshot images in doc pageslocalpre-commit
API spec covers every routelocalpre-commit
API spec describes the shape the hub answers withlocalpre-commit
Docs facts and last-updated dateslocalpre-commit
Published documents match their sources (docs/security, docs/klarbefund, docs/developer)localpre-commit
Localized image manifest matches ui/publiclocalpre-commit
API collection covers every route, and can faillocalpre-commit
A successful request cannot pass on an empty answerlocalpre-commit
Workflows re-run when what they run changeslocalpre-commit
npm audit (UI — HIGH+)localpre-push
Lint GitHub Actions workflowslocalpre-commit
CVE scan covers every compose imagelocalpre-commit
No compose image pinned to a single-architecture taglocalpre-commit

Stage 2 — Pre-push Gates

Run before git push. These catch issues that are too slow for pre-commit.

Unit Tests

vitest run --bail 1: stops on first failure (.pre-commit-config.yaml)

Blocks

Dependency Audit

scripts/check-npm-audit.py ui --omit=dev: npm audit, HIGH and CRITICAL fail unless excepted with an expiry (.pre-commit-config.yaml)

Blocks

Stage 3 — CI Pipeline

GitHub Actions workflow .github/workflows/test.yml runs 8 jobs on every push. The other rows run in the PR Gate, CodeQL, the security scan and the nightly run (ADR-074); each row links the lines that run it. C5 criteria link to their page in the BSI C5:2020 catalogue; OWASP numbers are the 2021 edition. View latest run →

JobTestsToolStandardGate
PR Gate—pr-gate.yml: pre-commit on the diff, API spec drift, Bruno coverage, knip, gitleaks over the pull request's commitsC5 DEV-09Blocks
CodeQL—codeql.yml (JS/TS, Python, Actions) on every PR; codeql-swift.yml when clients/ios changes, or locally with Scripts/codeql-swift.shC5 PSS-02, OWASP Top 10 (2021)Reports
Security scan—Source SBOM, image and deployed-image CVEs (security-scan.yml). CVEs fail a run only when a manual run asks for it (severity gate)C5 OPS-22, CRA Annex I, Part II (1)Reports
UI Tests (Vitest)—Vitest 5.0.2 + v8 coverage (test.yml)C5 DEV-06Blocks
Neo4j Proxy Tests—Vitest (test.yml)C5 DEV-06Blocks
Lint—Next.js ESLint, a pre-commit hook the PR Gate runs (.pre-commit-config.yaml)C5 DEV-06Blocks
Secret Scan—Gitleaks v8.27.2 over the whole history each night (nightly.yml); the PR Gate scans the pull request's commitsC5 CRY-04, OWASP A07:2021Blocks
Dependency Audit—npm audit, HIGH+ (test.yml, through check-npm-audit.py)C5 PSS-02, OWASP A06:2021Blocks
Trivy Scan—Trivy v0.69.3 (test.yml)C5 OPS-22, OWASP A06:2021Reports
K8s Posture—Kubescape, NSA and CIS frameworks, critical findings (test.yml)C5 OPS-23, NSA/CISA Kubernetes Hardening Guide, CIS Kubernetes BenchmarkBlocks
E2E Tests—Playwright v1.65.1, nightly (nightly.yml)—Reports
WCAG 2.2 AA Audit—axe-core/playwright, nightly (nightly.yml, continue-on-error)WCAG 2.2 AA, EN 301 549Reports
Security Pentest—OWASP/BSI patterns, 28-security-pentest.spec.ts, nightly (nightly.yml)C5 PSS-02, OWASP Top 10 (2021)Reports
SBOM Generation2CycloneDX npm, CycloneDX 1.5 (test.yml)CRA Annex I, Part II (1), C5 AM-01Blocks
Licence Compliance—license-checker-rseidelsohn 4.4.2 with an allowlist (test.yml)No C5 criterion or CRA article requires itBlocks
Lighthouse CI12Lighthouse CI (4 pages × 3 runs), nightly (nightly.yml)Core Web VitalsReports

Supply-Chain Hardening

  • Trivy (test.yml) and the nightly gitleaks (nightly.yml) are pinned to exact versions and checked against their SHA-256 checksums; the PR Gate pins its gitleaks version without a checksum check (pr-gate.yml)
  • Trivy v0.69.3 used explicitly: versions 0.69.4 to 0.69.6 were compromised (CVE-2026-33634, GHSA-69fq-xp46-6x23)
  • Ten fingerprints allowlisted in .gitleaksignore, each with the reason: local dev-stack credentials, false positives, and one dead session token kept in history

Security Headers (Runtime)

Set in next.config.js; the Content-Security-Policy is built per request, with a nonce, in middleware.ts. Not set in the static GitHub Pages build, which has no server (C5 OPS-23 system hardening, OWASP A05:2021 Security Misconfiguration):

X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: camera=(), microphone=(), geolocation=(), interest-cohort=()
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
Content-Security-Policy: default-src 'self'; script-src 'self' with a per-request nonce

Stage 4 — Protocol Compliance

Once a night, when main has changed (nightly.yml, ADR-074), and on manual dispatch. Each suite must stay at or above the floor recorded in scripts/compliance-baseline.json; a floor is raised when a suite improves and never lowered without a reason. The DSP and DCP suites are the hub's own checks of its reading of the specifications, not the Eclipse TCKs; neither TCK has run against the hub yet (#338). Workflow: .github/workflows/compliance.yml View latest run →

DSP 2025-1 checks

Dataspace Protocol: the hub's own checks (run-ehds-dataspace-checks.sh), not the Eclipse DSP TCK

≥ 25passed, at most 0 failed

DCP v1.0 checks

Decentralised Claims: the hub's own checks (run-ehds-identity-checks.sh), not the Eclipse DCP TCK

≥ 27passed, at most 0 failed

EHDS Domain

EHDS Art. 53 purposes, EHDS Art. 71 opt-out, HealthDCAT-AP, EEHRxF, OMOP (run-ehds-tests.sh)

≥ 25passed, at most 0 failed

API collection (CI)

Bruno, persona folders

≥ 205passed, at most 0 failed

API collection (Azure)

Bruno, ehds.mabu.red

≥ 166passed, at most 0 failed

DSP 2025-1 checks (Azure)

Dataspace Protocol: the hub's own checks (run-ehds-dataspace-checks.sh), not the Eclipse DSP TCK

≥ 26passed, at most 0 failed

DCP v1.0 checks (Azure)

Decentralised Claims: the hub's own checks (run-ehds-identity-checks.sh), not the Eclipse DCP TCK

≥ 18passed, at most 0 failed

EHDS Domain (Azure)

EHDS Art. 53 purposes, EHDS Art. 71 opt-out, HealthDCAT-AP, EEHRxF, OMOP (run-ehds-tests.sh)

≥ 28passed, at most 0 failed

Infrastructure Requirements

Protocol compliance tests require the full JAD stack (15 services, 8 GB RAM), on EDC 1.0 (ADR-078). In CI, the workflow starts JAD infrastructure with graceful fallback: tests produce results only when the controlplane is healthy.

Local execution: ./scripts/run-ehds-dataspace-checks.sh, ./scripts/run-ehds-identity-checks.sh, ./scripts/run-ehds-tests.sh. The old names run-dsp-tck.sh and run-dcp-tests.sh are shims for the first two; despite the name, neither is a TCK.

Coverage Floors

Enforced by ui/vitest.config.ts: the UI suite fails when coverage drops below these. The measured numbers are in the published test report.

≥ 78%
Statements
≥ 69%
Branches
≥ 79%
Functions
≥ 80%
Lines

Test Inventory

Vitest
Unit tests, UI and Neo4j proxy
Playwright
E2E journeys, incl. WCAG 2.2 AA
8
Compliance suites with a floor

Future Quality Gates

Recommended improvements prioritised by impact and regulatory alignment.

1

Enforce Coverage Thresholds

Done: vitest.config.ts

Minimum coverage thresholds in vitest.config.ts: 78% statements, 69% branches, 79% functions, 80% lines. Vitest fails if coverage drops below.

Enforcement prevents silent regression; raise a floor whenever coverage rises.

C5 DEV-06
2

Mutation Testing

Medium: new tool + CI job

Add Stryker Mutator to measure test effectiveness. Target mutation score > 60%.

Line coverage does not guarantee tests catch bugs. Mutation testing verifies tests detect real defects.

C5 DEV-06
3

Licence Compliance Scanning

Done: implemented in test.yml

license-checker-rseidelsohn in CI with an allowlist (test.yml): MIT, Apache-2.0, ISC, BSD-2/3-Clause, 0BSD, CC0-1.0, CC-BY-4.0, Unlicense, Python-2.0, BlueOak-1.0.0, LGPL-3.0-or-later. The job fails on any production dependency under another licence.

Neither the CRA nor BSI C5 asks for a licence check. It keeps the dependencies compatible with the hub's Apache-2.0 licence.

No C5 criterion or CRA article requires it
4

API Contract Testing

Partly done: spec drift ratchet in the PR Gate

scripts/check-api-spec-drift.py already blocks any new route missing from openapi.yaml (129 operations documented). Next: validate response shapes against the spec with swagger-parser or Prism.

No formal schema enforces response shapes. Contract tests prevent frontend/backend drift.

OpenAPI 3.1.0
5

SBOM Generation

Done: implemented in test.yml

CycloneDX 1.5 SBOM generated on every CI run for UI and Neo4j Proxy, uploaded as a 90-day artifact (test.yml). The bills committed in docs/sbom are CycloneDX 1.7, made by syft (generate-sbom.sh); the iPhone app's is 1.5. The CRA asks for a software bill of materials in a commonly used, machine-readable format (Annex I, Part II (1)); the Commission may fix its format by implementing act (Art. 13(24)).

Supply chain attacks (XZ Utils, CVE-2024-3094; the Trivy compromise, GHSA-69fq-xp46-6x23) make SBOMs non-negotiable. The CRA's Annex I applies from 11 December 2027 (Art. 71(2)).

CRA Annex I, Part II (1), NTIA SBOM minimum elements, C5 AM-01
6

Performance Regression Testing

Done: Lighthouse CI in nightly.yml

Lighthouse CI with Core Web Vitals budgets: LCP < 4s (error), CLS < 0.1 (error), TBT < 300ms (warn), script size < 500 KB (warn) (nightly.yml). Runs on 4 key pages.

Healthcare professionals use the platform under time pressure. A budget error turns the nightly run red, which opens an issue; it does not block a merge (ADR-074).

Core Web Vitals
7

Runtime ODRL Policy Enforcement

High: new engine + tests

Implement ODRL engine: validate API responses respect the caller's permitted datasets and temporal limits.

Currently ODRL policies are decorative. Any authenticated user can query any dataset. This is the largest EHDS compliance gap.

EHDS Art. 66, ODRL 2.2 §2
8

WCAG Blocking Gate

Partly done: runs nightly, does not block

WCAG 2.2 AA audit with a zero-violation budget. Since it moved to the nightly run (ADR-074) it runs with continue-on-error (nightly.yml), so a violation shows in the report but fails nothing.

The audit found zero violations when it last blocked. To block again it needs a step that fails the nightly job.

EN 301 549, Directive (EU) 2016/2102
9

IaC Policy Enforcement

Done: blocking in test.yml

Kubescape blocks on critical findings (--severity-threshold critical) under the NSA and CIS frameworks (test.yml).

K8s manifests define production topology. Critical security findings now block the build.

C5 OPS-23, NSA/CISA Kubernetes Hardening Guide
10

Dependency Freshness

Done: renovate.json

Renovate Bot configured (renovate.json): auto-merge patches, weekly PRs for minor, manual review for major. Security updates bypass schedule.

Automated dependency updates prevent CVE accumulation. The CRA asks manufacturers to remediate vulnerabilities without delay, including by security updates (Annex I, Part II (2)).

OWASP A06:2021, C5 OPS-22, CRA Annex I, Part II (2)

Compliance Mapping

Quality GateBSI C5:2020OWASP 2021CRAEHDSWCAG
TypeScript strictC5 DEV-01————
ESLintC5 DEV-06————
Unit tests + coverage thresholdsC5 DEV-06————
Secret scan (Gitleaks)C5 CRY-04OWASP A07:2021———
Dependency auditC5 PSS-02OWASP A06:2021Annex I, Part II (1)——
Trivy vuln scanC5 OPS-22OWASP A06:2021Annex I, Part II (1)——
Security headersC5 OPS-23OWASP A05:2021———
WCAG 2.2 AA (nightly, reports)————2.2 AA
DSP 2025-1 checks (own, not the TCK)—————
DCP v1.0 checks (own, not the TCK)—————
EHDS domain tests———EHDS Art. 53, EHDS Art. 71—
SBOM (CycloneDX 1.5 in CI)C5 AM-01OWASP A06:2021Annex I, Part II (1)——
Licence complianceNo C5 criterion—No CRA article——
Lighthouse perf budget—————
Kubescape (blocking)C5 OPS-23————
Renovate freshnessC5 OPS-22OWASP A06:2021Annex I, Part II (2)——
ODRL enforcement (planned)—OWASP A01:2021—EHDS Art. 66—

Related Documentation