Skip to content

Modernize Requirement Milestones reqMilestones

github-actions[bot] edited this page Nov 29, 2026 · 2 revisions

Requirement Milestones (reqMilestones) — Modernized

Overview

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).

Architecture (2.0.1)

  • 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_metrics and 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 reqMilestones screen; this is additive.

Behavior / Features

  • 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 to login.php?note=expired.
  • i18n: rmst.* (78 keys) + footers.reqMilestones × 10 bundles; $TLS_link_requirement_milestones × 19 server locales (RO translated, others English fallback). Gate ai/verify_i18n_coverage.sh: 9 bundles compared, 14234 keys, 0 missing.

Authorization / ownership

  • The owning project is resolved from testplan_id → testplans.testproject_id before any report data is returned; a mismatched tproject_id is 404 project_mismatch, not a wrong-project read.
  • testplan_metrics is enforced on that owning project; denials are written to the Event Viewer as AUDIT via tLog().
  • The plan dropdown is re-filtered with getAccessibleTestPlans() and hasRight(..., pid, true) so a user cannot select a plan they cannot read.
  • Session gate (bffEnforceSession), same-origin guard (bffSameOriginGuard), nosniff and Cache-Control: no-store on every answer; all SQL identifiers are whitelisted and all interpolated values are integers.

Bug found and fixed

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.

Regression

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, verdict Passed, search RMST-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-3 Report unavailable card + 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.md as 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 bundles python3 -m json.tool, i18n coverage gate and mandatory code review all PASS.

Screenshots

Requirement Milestones normal state Filtered passed row Detail modal Romanian locale No-right state

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

Clone this wiki locally