Skip to content

Bugfix Issue 2129 Authored Reliability Chapter

CI Agent edited this page Nov 29, 2026 · 1 revision

Bugfix — Issue #2129: authored Reliability & Recovery Testing chapter text

editor before fix

editor after fix

Symptom

Chapter 27 (Non-Functional: Reliability & Recovery Testing) was a read-only reference page. With a freshly imported 2.0.1 database and fixture project 1 (Issue 2129 Reliability Fixture, prefix R2129), opening gui/templates/strategy/nfrReliability.html?tproject_id=1 returned HTTP 200 but the live DOM had 0 textareas and 0 buttons and the network panel showed no BFF call. There was no way to author project-specific reliability/recovery prose, so the Test Strategy report had nothing to aggregate for this chapter.

Root cause

  • api/strategy/index.php:84 links chapter 27 to the static nfrReliability.html page, but gui/templates/strategy/nfrReliability.html:28-59 only rendered translated static content; its script (:61-70) called TLi18n only.
  • The persistence path introduced for chapter 28 (#2130) was gated by schapterCodes() in api/strategychapter/index.php:78-80, which allowed only maintainability; both GET init (:272-277) and POST save (:293-298) reject every other chapter code with HTTP 400 bad_chapter.
  • api/strategyreport/index.php:461-494 already aggregates every chapter_code row for the project, so no report-BFF change was needed. Only the title map in gui/templates/results/strategyReport.html:314-317 knew maintainability, so a new chapter would be shown as the raw code reliability.
  • strat.secChapterNotes and strat.chapterNotesEmpty were absent from all ten client bundles, so the report's chapter-notes panel heading rendered as a raw i18n key.

Approach chosen

  1. Extend the existing allowlist, not the schema. One line in schapterCodes() adds reliability beside maintainability. The existing testproject_strategy_chapters table is keyed by (testproject_id, chapter_code), so the atomic INSERT ... ON DUPLICATE KEY UPDATE upsert, rights checks, 20 000-char cap and STRATEGY_CHAPTER_SAVE AUDIT event work unchanged for the new chapter. This was preferred over a new table or a new API: both would duplicate #2130 infrastructure without adding isolation.
  2. Mirror the #2130 editor in the existing Dashio page. The page now has a labeled #relText textarea, #btnSave, author/update metadata and a translated status region. GET /api/strategychapter/index.php?action=init&chapter=reliability&tproject_id=N populates the text and disables controls for users without write rights; POST ?action=save persists and refreshes. Project id is taken from ?tproject_id= / ?tprojectId= and falls back to the BFF session context; 401 redirects to login and 403/400/other states get localized messages. All new labels are TLi18n keys in ten bundles (13 ts.rel* keys with real translations, plus the two report keys).
  3. Add only the missing report title mapping. chapterTitle() maps reliability to the pre-existing ts.chapterReliability key. That single map is shared by panel 11 and the Markdown export used by window.print() (PDF), so both surfaces show a translated chapter name. No report payload or #2101 authored-document behavior changed.

Alternatives rejected

  • Extending testproject_strategy_docs with a pseudo-document would have polluted the #2101 authored[] payload and hidden the chapter-code dimension.
  • A separate reliability-only BFF/table would have duplicated rights, audit and upsert logic already provided by api/strategychapter.
  • A general loop over all 28 chapter pages is an architecture-sized change; the issue is scoped to chapter 27, and the allowlist design leaves the other chapters ready for the same one-line treatment.

Files changed

  • api/strategychapter/index.php — reliability added to schapterCodes() and route docs.
  • gui/templates/strategy/nfrReliability.html — chapter editor markup + load/save wiring.
  • gui/templates/results/strategyReport.html — reliability chapter title mapping.
  • gui/templates/i18n/{de,en,es,fr,it,ja,pt,ro,ru,zh}.json — 13 ts.rel* keys plus strat.secChapterNotes / strat.chapterNotesEmpty in every locale.
  • tmp/TLU_Test_Cases.md — suite Regression — Issue #2129.
  • CHANGELOG — [KEY BUGFIX] - #2129 entry.

Verification

  • Pre-fix: 0 textareas, 0 buttons, zero BFF requests; API bad_chapter for reliability.
  • Post-fix: GET init 200, POST save 200, reload restored the verbatim two-line text with author/timestamp; DB row 1 | reliability | … | admin | 2026-11-29 11:24:24.
  • Report panel 11 showed 11. Authored chapter notes and the reliability text under Reliability & Recovery Testing; buildMarkdown() contained the text (PDF print path).
  • Read-only user (global role tester) saw the text with textarea/Save disabled; unknown project showed a localized load error; chapter=bogus still returned 400; anonymous request returned 401; the maintainability sibling still worked.
  • Gates: php -l, extracted-JS node --check, all ten JSON bundles, coverage gate 9/9 PASS (14138 keys/bundle), suite gate 34 PASS / 0 FAIL.
  • Event Viewer: 3 rows in the test window, all log_level=16 AUDIT; 0 Error/Warning.
  • Code review: no must-fix findings.

Clone this wiki locally