Skip to content

test: guard requirement list bulk enrichment - #215

Merged
mariusmm merged 3 commits into
mainfrom
fix/issue-202-requirement-list-bulk-regression
Aug 3, 2026
Merged

test: guard requirement list bulk enrichment#215
mariusmm merged 3 commits into
mainfrom
fix/issue-202-requirement-list-bulk-regression

Conversation

@VPRamon

@VPRamon VPRamon commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #202.

Adds regression coverage for the project requirement listing enrichment path so future changes do not reintroduce per-requirement N+1 lookups for verification methods, custom fields, or parent links.

Problem

Issue #202 calls out that project requirement listings are a central API/UI path and must use bounded bulk queries instead of querying related data once per requirement. The current production implementation already batches these enrichments, but there was no lightweight regression guard documenting and protecting that query shape.

Solution

  • Added a database-free integration test under marreq-core/tests/.
  • The test isolates the production build_requirement_list_rows implementation and asserts that it:
    • bulk-loads verification method IDs;
    • bulk-loads custom field display values;
    • bulk-loads parent links by current version;
    • keeps Diesel .load(...) calls bounded;
    • does not delegate production enrichment to per-requirement RequirementService calls.

Validation

  • Not run locally: the execution environment did not allow cloning/running the repository checkout (git clone failed with an environment authorization error), so I could only validate through repository inspection and the GitHub compare view.
  • GitHub compare confirms this PR is one commit ahead of main and only adds marreq-core/tests/requirement_list_bulk_query_regression.rs.

Known risks / limitations

  • This is a source-shape regression test rather than a database query counter. It is intentionally DB-free and low overhead, but if the implementation is substantially refactored while preserving bounded queries, the test may need to be updated alongside the refactor.

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
marreq-cloud.src.fairings 100% 0
marreq-core.src.auth 91% 0
marreq-core.src.auth.guards 46% 0
marreq-core.src.auth.rate_limiter 94% 0
marreq-core.src.helper_functions 93% 0
marreq-core.src.importers 5% 0
marreq-core.src.services 90% 0
marreq-core.src.routes 48% 0
marreq-core.src.repository.cache 100% 0
marreq-cloud.src 72% 0
marreq-core.src.reqif 83% 0
marreq-cloud.src.services 91% 0
marreq-core.src.deployment 83% 0
marreq-core.src.validation 96% 0
marreq-core.src.diff 100% 0
marreq-core.src.services.semantic_search 75% 0
marreq-core.src.repository 43% 0
marreq-core.src.fairings 89% 0
marreq-cloud.src.api 78% 0
marreq-core.src 67% 0
marreq-server.src 62% 0
marreq-core.src.api 77% 0
marreq-core.src.generators 0% 0
marreq-core.src.models 81% 0
Summary 75% (22695 / 30307) 0

@mariusmm
mariusmm force-pushed the fix/issue-202-requirement-list-bulk-regression branch from 65571e3 to 57bd558 Compare August 3, 2026 21:48
@mariusmm

mariusmm commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Fixed CI lint (cargo fmt) and rebased onto current main.

  • Applied rustfmt to requirement_list_bulk_query_regression.rs
  • Confirmed the regression test still passes against current build_requirement_list_rows

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Frontend Code Coverage

Frontend SPA coverage (by module)

Module Line Rate Branch Rate Function Rate Health
api 7.2% (65 / 903) 80.0% 4.2%
components 10.3% (274 / 2668) 84.9% 53.8%
components/graph 48.1% (50 / 104) 100.0% 33.3%
components/reports 0.0% (0 / 20) 100.0% 100.0%
components/table 79.2% (38 / 48) 100.0% 100.0%
context 39.7% (48 / 121) 55.0% 50.0%
hooks 49.2% (98 / 199) 78.1% 81.8%
lib 100.0% (57 / 57) 100.0% 100.0%
pages 7.5% (510 / 6792) 77.4% 55.6%
pages/catalog 0.0% (0 / 1473) 12.5% 12.5%
pages/groups 0.0% (0 / 870) 0.0% 0.0%
src (root) 9.4% (12 / 128) 92.9% 66.7%
types 100.0% (0 / 0) 100.0% 100.0%
utils 100.0% (106 / 106) 98.2% 100.0%
Summary 9.3% (1258 / 13489) 81.7% 34.9%

Generated from Vitest @vitest/coverage-v8 (frontend/src).

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
marreq-core.src.auth 91% 0
marreq-cloud.src.services 91% 0
marreq-core.src 67% 0
marreq-core.src.importers 5% 0
marreq-cloud.src 72% 0
marreq-core.src.reqif 83% 0
marreq-cloud.src.fairings 100% 0
marreq-core.src.auth.rate_limiter 94% 0
marreq-core.src.routes 48% 0
marreq-core.src.auth.guards 46% 0
marreq-core.src.helper_functions 93% 0
marreq-core.src.validation 96% 0
marreq-core.src.services 90% 0
marreq-core.src.deployment 83% 0
marreq-core.src.services.semantic_search 75% 0
marreq-cloud.src.api 78% 0
marreq-server.src 62% 0
marreq-core.src.repository 43% 0
marreq-core.src.api 77% 0
marreq-core.src.models 81% 0
marreq-core.src.repository.cache 100% 0
marreq-core.src.fairings 89% 0
marreq-core.src.diff 100% 0
marreq-core.src.generators 0% 0
Summary 75% (22695 / 30307) 0

@mariusmm
mariusmm merged commit 0d8ae8c into main Aug 3, 2026
5 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.

Remove N+1 queries from project requirement listings

2 participants