Repository navigation
Modernize Requirement Milestones reqMilestones
reqMilestones is a net-new 2.0.1 read-only report answering a parity gap left by
1.9.20: neither the Milestones screen nor the Reports chapter showed which
requirements are supposed to be proven by a milestone, or whether the linked
test cases have execution evidence inside the milestone window. The screen joins
milestones with req_coverage, the latest execution of each assigned
test-case version and the milestone target date, then classifies every
requirement/milestone pair into passed, failed, blocked, executed,
overdue, at_risk or uncovered.
Refs: #2133. Bug found and fixed while testing: #2134 (invalid
tcversions.parent_id SQL join caused HTTP 500 with an empty body).
-
Modern UI:
gui/templates/requirements/reqMilestones.html— standalone Dashio page (teal header, dark toolbar, context card, 9 KPI cards, verdict banner, 10-column DataTable, detail modal, footer locale switcher). -
BFF API:
api/reqmilestones/index.php—GET|HEAD ?action=projects|plans|init|report. -
Entry point: ASIDE Test Case Execution → Requirement Milestones, gated by
testplan_metricsand at least one accessible plan; also deep-linkable with?tproject_id=P&tplan_id=T[&locale=ro]. -
No Smarty: the 1.9.20 Smarty tree has no
reqMilestonesscreen; this is additive.
- Scopes: project → test plan → milestone (optional) → verdict (optional) → free-text search. Apply re-queries the BFF; Refresh repeats the last query; Export CSV writes a BOM-prefixed, semicolon-separated, formula-guarded local file with the report context as header lines.
- KPIs: milestones, requirements in scope, covered, uncovered, coverage %, pass rate %, failed, overdue, at risk; the banner calls out the number of requirements past target without execution evidence.
- Table columns: milestone, target date, requirement (doc id + name), specification, linked cases, executed count, P/F/B split, days left, verdict, detail button. The DateTable sorts/searches locally and reflects the server-side filters.
- Detail modal: milestone/requirement/verdict header plus one row per linked case with result, run date and build/platform.
- Explicit localized state card for
400 invalid_request,401,403 no_right,404 tplan_not_found,404 project_mismatch,405 method_not_allowed; a 401 bounces tologin.php?note=expired. - i18n:
rmst.*(78 keys) +footers.reqMilestones× 10 bundles;$TLS_link_requirement_milestones× 19 server locales (RO translated, others English fallback). Gateai/verify_i18n_coverage.sh: 9 bundles compared, 14234 keys, 0 missing.
- The owning project is resolved from
testplan_id → testplans.testproject_idbefore any report data is returned; a mismatchedtproject_idis404 project_mismatch, not a wrong-project read. -
testplan_metricsis enforced on that owning project; denials are written to the Event Viewer asAUDITviatLog(). - The plan dropdown is re-filtered with
getAccessibleTestPlans()andhasRight(..., pid, true)so a user cannot select a plan they cannot read. - Session gate (
bffEnforceSession), same-origin guard (bffSameOriginGuard),nosniffandCache-Control: no-storeon every answer; all SQL identifiers are whitelisted and all interpolated values are integers.
| Issue | Symptom | Fix |
|---|---|---|
| #2134 | After creating fixtures, action=report returned HTTP 500 with an empty body: the SQL joined nodes_hierarchy on tv.parent_id, a column absent from tcversions. |
Join nodes_hierarchy as the version row and again as its parent test case; add a global JSON 500 exception handler so a DB error never returns an empty body. Verified HTTP 200 with the expected payload; issue closed. |
Re-runnable fixture tmp/fixtures_2133.php creates project RMST2133 (requirements enabled), plan RMST Plan, four milestones (past -30d / past -10d / near +3d / future +45d), four requirements, four linked cases with active req_coverage, and four executions. Browser and API pass:
- Normal render: 4 milestones, 16 requirement×milestone rows, KPIs 4 / 16 / 3 / 13 / 18.8% / 6.3% / 2 / 7 / 3; banner and all verdict badges localized.
- Filters: milestone
Milestone R1, verdictPassed, searchRMST-R1→ 1 row. - Detail modal, Refresh (HTTP 200), Export CSV (
requirement-milestones-2.csv, quoted UTF-8 header), RO locale with zero raw keys, role-3Report unavailablecard + BFF 403, anonymous bounce to login, 400/404/405 JSON contracts, ASIDE link presence, clean Event Viewer. - Suite recorded append-only in
tmp/TLU_Test_Cases.mdas Modernize — Issue #2133;TLU_REQUIRE_SUITE="Issue #2133" bash ai/verify_test_suites.sh→ all checks PASS (34 PASS / 0 FAIL on the clobber baselines). -
php -l, all 10 bundlespython3 -m json.tool, i18n coverage gate and mandatory code review all PASS.

— see also https://github.com/sebiboga/testlink-upgraded/issues/2133