Skip to content

MOSIP-45746: Add coverage-matrix tooling (CoverageCli) and reusable CI check - #2016

Merged
mohanachandran-s merged 5 commits into
mosip:developfrom
mohanachandran-s:MOSIP-45746-coverage-matrix-tooling
Nov 13, 2026
Merged

mohanachandran-s merged 5 commits into
mosip:developfrom
mohanachandran-s:MOSIP-45746-coverage-matrix-tooling

Conversation

@mohanachandran-s

@mohanachandran-s mohanachandran-s commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Jira: MOSIP-45746

What this adds

  • apitest-commons io.mosip.testrig.apirig.coverage: CoverageCli with init, scaffold, sync, rollup, check and refresh-docs. It keeps a per-module coverage matrix, one markdown file per wired YAML plus planned files for untested controller endpoints. It also generates Summary.md, coverage.csv and coverage.html, and checks for:
    • orphan or duplicate test cases
    • unmapped or unreachable endpoints
    • lost legacy IDs
    • malformed rows or stories
    • stale reports
  • Templates (apitest-commons/src/main/resources/io/mosip/testrig/apirig/coverage/templates): the module README.md, AGENTS.md, check-baseline.txt, legacy-ids.txt, .gitattributes and the CI caller workflow that init writes into a module.
  • Docs: docs/coverage-matrix/overview.md (module-neutral).
  • No CI in this repo. The reusable coverage-matrix-check.yml workflow is not part of this PR. It belongs in mosip/kattu, with the other shared MOSIP workflows, and will be raised there when the check is enabled. The caller template that init writes into modules already targets kattu and ships disabled (manual dispatch only).
  • All examples are module-neutral; there are no references to a specific module.

About 18 files of additions. No existing class changes behaviour.

Why now

mosip/keymanager#609 adopts the matrix and depends on this PR. Its docs are rendered from these templates. Merge this PR first.

Commits

  • Rebuild coverage-matrix tooling and add CI gate
  • Coverage matrix: module bootstrap, legacy-ID and duplicate checks, docs
  • Coverage matrix: put planned files beside the module's other matrix files
  • Coverage matrix: require full details on every row, add HTML/CSV reports
  • MOSIP-45746: make coverage-matrix tooling module-neutral; move CI workflow out of commons

All signed off.

Verification

Used locally on keymanager. init is idempotent, a second sync writes nothing, and check --fail-on-warnings reports 0 gaps on 56 matrix files and 55 controller endpoints. Deliberately broken matrices are each detected: orphan uid, duplicate ID, stale report, baseline line without a reason, malformed Story and empty Steps.

Note

Modules pick this up through apitest-commons. The currently published 1.8.0-SNAPSHOT doesn't contain the coverage package, so a snapshot publish after merge is needed for modules that run CoverageCli from the jar.

🤖 Generated with Claude Code

mohanachandran-s and others added 4 commits November 10, 2026 14:28
Recreate io.mosip.testrig.apirig.coverage (CoverageCli: scaffold/sync/rollup/check), which was never committed and had been lost. Output is byte-identical to the existing pre-registration matrix files.

New gates: endpoint checks on by default (service source auto-discovered, gateway prefix inferred per service), planned subjects for endpoints with no YAML, check-baseline.txt with mandatory reasons, and gap types for duplicate uniqueIdentifiers, missing uniqueIdentifiers, restMethod/verb mismatch, empty YAML, malformed rows, unsynced files and stale matrix files.

Add reusable workflow coverage-matrix-check.yml so module repos can run check on every PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
Add CoverageCli init (one-command bootstrap of a module's matrix, docs, baseline, legacy-ids, .gitattributes and CI caller workflow from templates) and refresh-docs (re-render a module README's shared tooling section).

New checks: legacy-id-missing (every ID in legacy-ids.txt must appear in the matrix or carry an out-of-scope reason), unknown-category, and a possible-duplicate-row warning (same error code on the same field, a second authn/authz row, or near-identical wording; --fail-on-warnings makes it fail). Planned files now get the category and sync checks; baseline staleness is only judged for checks that ran; the controller scan no longer drops a checkout that sits under a directory named target.

Add docs/coverage-matrix/overview.md (team guide) and design-record.md (design decisions, moved here from an untracked workspace file).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
…iles

scaffold now writes a planned (no-YAML-yet) endpoint's file into the folder most of the module's wired subjects live in (e.g. preReg/) instead of a separate planned/ folder, so one folder shows every endpoint of a module. A planned file is still recognized by its planned: true front-matter; planned/ remains only as a fallback for a module with no wired subjects. Templates and the design record updated to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
- Add Reports: sync now writes coverage.html (filterable table of every
  row) and coverage.csv; check fails with reports-stale when out of date.
- missing-steps now applies to not_automatable rows too.
- unfilled-placeholder also fires on a TODO / "To be defined" /
  bare "Not applicable" Scenario or Expected result.
- Templates and docs: not_automatable is the last resort, plain-language
  Notes style, design-record entry 31.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 35ae54a0-7754-4a09-9515-3ae54efe8b78
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…kflow out of commons

- Remove .github/workflows/coverage-matrix-check.yml: a library repo should not host CI. The reusable workflow will live in mosip/kattu (separate PR when the check is enabled).
- Caller template (written into modules by CoverageCli init) now targets mosip/kattu and runs only on manual dispatch until that workflow exists; README/AGENTS templates say so.
- Replace pre-registration-specific examples in CoverageCli comments and the module templates with neutral placeholders; remove docs/coverage-matrix/design-record.md (the pre-registration pilot record) and the module status section of overview.md.
No behaviour change in CoverageCli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
mohanachandran-s added a commit to mohanachandran-s/keymanager that referenced this pull request Nov 13, 2026
…efresh module docs

The reusable coverage workflow is moving out of mosip-functional-tests (a library repo) into mosip/kattu. The caller now targets mosip/kattu and runs only on manual dispatch until that workflow exists. AGENTS.md and the README tooling section are re-rendered from the module-neutral commons templates; Summary.md is regenerated. Depends on mosip/mosip-functional-tests#2016.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>
@ckm007

ckm007 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked PR

@mohanachandran-s
mohanachandran-s merged commit ab1e7bd into mosip:develop Nov 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants