feat(scans): polish scans list card — drop noise, surface commit SHA - #278
Merged
Conversation
Two small triage-friendly tweaks to the Scan to_card:
1. Header parenthetical
`(0 Open)` and `(N Open)` (when N == total) read as boilerplate.
Drop the parenthetical when:
- total == 0 — leading "0 Bugs Found" already says nothing
- open == total — "(N Open)" just restates the total
Otherwise keep the existing `"{repo} N Bugs Found (M Open)"` form.
2. Commit row
Surface `Scan.commit_sha` (truncated to 7 chars, like
format_introduced_in does for blame) so users can answer "did
this scan run on the current main?" without an extra round-trip.
Conditional: omitted when commit_sha is null or absent so older
scans stay quiet.
Existing scan tests addressed `pairs[N]` by index; rewrote them
to look up by key name (via a small `scan_pair` helper) so the
new conditional Commit row doesn't break them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sachiniyer
temporarily deployed
to
integration-tests
May 6, 2026 20:55 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small triage-friendly tweaks to
scans listcard output (audit items #10 and #11 — bundled because they both touchFormattable for Scan):1. Header parenthetical (#10)
Drop the
(N Open)parenthetical when it would be noise:total == 0— leading0 Bugs Foundalready says nothing;(0 Open)is boilerplateopen == total—(N Open)just restates the leading numberOtherwise the existing
"{repo} N Bugs Found (M Open)"form is preserved.2. Commit row (#11)
Surface
Scan.commit_sha(truncated to 7 chars, matchingformat_introduced_in's blame style) so users can answer "did this scan run on the current main?" without an extra round-trip. Conditional — omitted whencommit_shais null/absent so older scans stay quiet.Test refactor
Existing scan-card tests addressed
pairs[N]by numeric index, which would silently break once the new conditionalCommitrow shifts later positions. Rewrote them to look up by key name via a smallscan_pairhelper.Testing
Automated, run locally and passing:
cargo test— full suite green. New tests:scan_card_header_drops_parenthetical_when_total_is_zero→"usedetail/cli 0 Bugs Found"scan_card_header_drops_parenthetical_when_open_equals_total→"usedetail/cli 7 Bugs Found"(7 found, 7 open)scan_card_header_keeps_parenthetical_when_partially_resolved→ still emits(3 Open)when partialscan_card_includes_short_commit_sha→ 24-char sha truncated to"deadbee"scan_card_omits_commit_when_nullscan_card_workflow_id_presentetc. updated to look up by keycargo clippy -- -D warnings— cleancargo fmt --check— cleancargo xtask check— clean (no flag changes; HELP.md unchanged)Manual end-to-end against live API (
usedetail/detail):commitShacleanly omits theCommitrow.open == totalbranch wasn't representable inusedetail/detail's recent scans (everything is resolved), so it's covered by unit test only.🤖 Generated with Claude Code