You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
doc-drift-scanner.sh has no behavioural test: carry-forward, rollup open/close and ledger are untested #128
scripts/doc-drift-scanner.sh is the only doc-drift component with no behavioural test. CI runs bash -n on it (tests/test-doc-drift-precheck.sh:128) and shellcheck (.github/workflows/tests.yml:43-45), and that is all. The checker and the precheck are covered (tests/test-doc-drift-check.sh, tests/test-doc-drift-precheck.sh) and the fixer's dry-run fail-closed path is covered. The scanner's state machine is not.
Why it matters
The scanner is where a wrong answer is expensive and silent:
Carry-forward (doc-drift-scanner.sh:131-140): a repo whose checker fails must keep its previous findings and must not have its rollup issue closed. That is the exact class of bug that bit dep-bump before it was caught (tests/test-dep-bump-subset-carryforward.sh, PR feat: Add repoman run orchestrator (v0.1.0 run path) #117).
Rollup open/close (gh_issue_exists at :215, close_issue_if_valid at :226, --issue-limit): the only code path that writes to other repos.
Ledger: the shape of latest.json / history.json and the new / fixed / recurring delta.
--dry-run must not write latest.json (:318 guards the write at :321), otherwise the next live run reports every finding as new.
Proposal
Add tests/test-doc-drift-scanner.sh, driving the real scanner with gh stubbed on PATH — the harness in tests/test-dep-bump-subset-carryforward.sh is the template: stub gh writing to a call log, REPOMAN_CONFIG_FILE / REPOMAN_REPOS_FILE into a temp dir, temp REPORTS_DIR, one real git init clone per enrolled repo, bash 3.2-safe (no mapfile, no associative arrays).
Cases
Findings in a repo with no prior issue → creates [doc-drift] owner/name, body lists the corrections, doc-drift label created best-effort.
Checker fails for a repo that had findings → previous rows carried into latest.json, issue not closed, run exits 0 and reports failed: 1.
All findings gone → the existing issue is closed with the scan id in the close comment.
--dry-run → no create/edit/close call and latest.json untouched.
--issue-limit 1 → stops after one repo.
latest.json carries repos_scanned / corrections / additions / delta, and history.json gains exactly one row.
Touchpoints
New: tests/test-doc-drift-scanner.sh.
.github/workflows/tests.yml — both lists are explicit, so an unlisted file never runs in CI: the shellcheck list (:42) and the run list (:62-79).
Notes
Review follow-up from #124 (#pullrequestreview-5742023444).
Activity