Skip to content

fix(report): use exit_code over passed for verify ✓/✗ in HTML#292

Merged
decko merged 2 commits into
mainfrom
soda/288
May 19, 2026
Merged

fix(report): use exit_code over passed for verify ✓/✗ in HTML#292
decko merged 2 commits into
mainfrom
soda/288

Conversation

@decko
Copy link
Copy Markdown
Owner

@decko decko commented May 19, 2026

Summary

Fixes a bug in the HTML report template where verify-phase commands that returned a non-zero exit code (e.g. FAIL ./... [setup failed]
FAIL failing) but had set by the adapter were incorrectly displayed with a ✓ checkmark instead of ✗.

Root cause: Line 1300 in report.html.j2 used cmd.passed to determine ✓/✗. Some adapters set passed: true for commands that ran (didn't crash) even when they returned non-zero exit codes.

Fix: The Jinja2 condition now checks exit_code first:

  • If exit_code is present → exit_code == 0 determines ✓/✗
  • If exit_code is absent → falls back to cmd.passed

Changes

  • report.html.j2 (line 1300): Updated condition to prioritise exit_code over passed
  • Tests (3 new TDD tests in TestStructuredDetailSections):
    • test_verify_command_fail_shows_crossexit_code=1 + passed=True → must show ✗ (the actual bug case)
    • test_verify_command_pass_shows_checkexit_code=0 → must show ✓
    • test_verify_command_no_exit_code_uses_passed — no exit_code, falls back to cmd.passed
  • changes/288.fix: Towncrier changelog fragment

Acceptance Criteria

  • Commands with exit_code != 0 show ✗ even when passed: true
  • Commands with exit_code == 0 show ✓
  • Commands without exit_code fall back to cmd.passed for ✓/✗
  • All existing tests continue to pass (1592 non-slow tests pass)
  • Towncrier fragment present at changes/288.fix

Review Results

Specialist Verdict Findings
Verifier ✅ PASS Template fix and all 3 test scenarios verified correct
Reviewer ✅ pass 0 findings

Refs #288


Assisted-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
Assigned-by: decko

decko added 2 commits May 19, 2026 10:12
…port

Add three tests to TestStructuredDetailSections:
- test_verify_command_fail_shows_cross: exit_code=1 + passed=True → ✗
- test_verify_command_pass_shows_check: exit_code=0 → ✓
- test_verify_command_no_exit_code_uses_passed: no exit_code, falls back to passed

Fix report.html.j2 line 1300: check exit_code first (exit_code == 0 → ✓,
exit_code != 0 → ✗), fall back to cmd.passed when exit_code is absent.
@decko decko added the ai-assisted Implemented with AI assistance label May 19, 2026
@decko decko merged commit 4738795 into main May 19, 2026
4 checks passed
@decko decko deleted the soda/288 branch May 19, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Implemented with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant