Skip to content

feat: show failures as a diff under a status heading, with how to fix them - #336

Merged
shenxianpeng merged 3 commits into
mainfrom
feature/report-redesign
Nov 11, 2026
Merged

shenxianpeng merged 3 commits into
mainfrom
feature/report-redesign

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The report is what a contributor sees when a check blocks them, and today it answers "which rule" before "what do I change". This reworks the job summary, the PR comment, the step log and the annotations around that question. Checks, exit codes, inputs and the result output are unchanged.

Needs commit-check/.github#77 merged first: the status marks are static PNGs served from that repository. Until then the report shows their alt text (✔ ✖ ⚠ ⊘) in their place.

PR comment and job summary

  • The heading is the verdict: the Commit Check mark in the status colour, then "Commit Check failed", "passed", "passed with warnings" or "skipped".
  • One line per group (Pull request, Commits, Author, Branch) with its own count.
  • What failed is a diff block: red is what was found, green is the text to write (from the CLI's fix), a # line is advice when there is no literal fix. More than seven failing items: five are shown, the rest folded.
  • Commits and rules are linked on one small line under the diff.
  • A folded "How to fix" with a prompt for an AI coding agent and the git commands this run's failures need (amend or rebase, branch rename, where to edit the PR title).
  • The footer names Commit Check and links to the rules and to the pre-commit hook guide.

failure

Ten failing commits:

many failures

Passing:

pass

The two folded sections, opened

opened

Step log and annotations

  • Each folded group carries its result in the title (✖ Commits: 3 of 4 failed), and the status glyphs are coloured.
  • The first line of an annotation says what to change (change "fix login redirect" to "fix: login redirect"); the run page shows only that line. The rule's sentence follows on the second line.
  • The verdict reads ✖ Commit Check: 6 of 9 checks failed, then where to find the fix.

step log

Docs fix

The annotations carry no file, so GitHub shows them on the run page, not on the Files changed tab. The README, the fork-PR warning and docs/fork-pr-comments.md said otherwise.

Notes

  • The screenshots are local renders of the real output for three demo repositories; this PR's own Commit Check comment shows it on GitHub.
  • ScopeResult gains text (what the action piped to the CLI) and edits, used to work out which lines a fix removes or adds. Neither is part of the result output.
  • 337 tests pass, line and branch coverage of main.py stays at 100%.

Summary by CodeRabbit

  • New Features
    • Run reports now show grouped pass, warning, failure, and skipped statuses, with line-level diffs and relevant remediation guidance.
    • Reports include links to commits and rules, expandable full results, and clearer annotations identifying affected targets and recommended actions.
    • Large diff lists are folded to keep reports easier to scan.
  • Documentation
    • Updated examples and guidance to show annotations on the run page and describe the report available in the job summary.

… them

The job summary and PR comment open with the Commit Check mark in the
status colour and "Commit Check failed" or "passed", then one line per
group. What failed is a diff block: red for what was found, green for the
text to write, taken from the CLI's fix. A folded "How to fix" holds a
prompt for an AI coding agent and the git commands for this run's
failures, and the footer links to the pre-commit hook guide.

The step log folds each group under a title that carries its result, and
each annotation's first line names what to change, since the run page
shows only that line.

Annotations carry no file, so they show on the run page, not on the Files
changed tab: the README, the fork-PR warning and its guide said otherwise.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 11, 2026 11:24
@shenxianpeng shenxianpeng self-assigned this Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The report format now uses grouped scope statuses, finding diffs, remediation guidance, and a folded listing of all scopes. Step-log output and annotations use status markers and actionable target text. Scope results retain checked text and line edits. Documentation and tests reflect these changes.

Changes: Report and finding presentation

Layer / File(s) Summary
Retain checked text and line edits
main.py, main_test.py
ScopeResult stores checked text and per-rule line edits. Scope parsing and AI-rule filtering retain the text, and attribution fixes record removed and added lines. Tests cover retaining text and edits.
Group statuses, step logs, and annotations
main.py, main_test.py, README.md, docs/fork-pr-comments.md
Step logs and verdicts show status markers and group summaries. Annotations name the affected target and action. Fork PR guidance and README examples place annotations on the run page. Tests cover status output, annotations, and skipped scopes.
Render report diffs and remediation guidance
main.py, main_test.py, README.md
Reports show grouped summaries, separate failure and warning diffs, folded scope listings, and failure guidance. Diff hunks are capped and folded, and the footer links to Commit Check, its rules, and the pre-commit hook. Tests and examples cover the updated report format.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Possibly related PRs

Suggested labels: enhancement, ai-assisted

Merge Risk: Moderate · up to 423dc

The new report suggests a branch-rename command that is unsafe to paste when the name contains shell characters. Some fix instructions do not resolve the failures they are shown for, and failure headings do not show skipped counts. Quote the suggested branch name and correct the branch and author guidance before merging.

Pre-merge checks: Passed 2

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: failures now appear as diffs under status headings with fix guidance.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✔ Commit Check passed

✔ Pull request: 2 passed

✔ Commits: 3 passed

✔ Author: 2 passed

✔ Branch: passed

All 8 checks
Pull request
  ✔ title        feat: show failures as a diff under a status heading, wit...
  ✔ description
Commits
  ✔ 2a3ded1      feat: show failures as a diff under a status heading, wit...
  ✔ 7cc4bd0      docs: add before and after screenshots for the pull request
  ✔ 423dc75      docs: remove the pull request screenshots
Author
  ✔ name         Xianpeng Shen
  ✔ email        3353385+shenxianpeng@users.noreply.github.com
Branch
  ✔ branch       feature/report-redesign

Checked by Commit Check 2.20.5 · Rules · Check before you push

@github-actions github-actions Bot added the ai-assisted Written with the help of an AI tool label Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (25b7143) to head (423dc75).

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #336    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            1         1            
  Lines          849      1003   +154     
==========================================
+ Hits           849      1003   +154     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shenxianpeng shenxianpeng removed the ai-assisted Written with the help of an AI tool label Nov 11, 2026 — with Claude
@shenxianpeng
shenxianpeng merged commit d68e05b into main Nov 11, 2026
21 of 24 checks passed
@shenxianpeng
shenxianpeng deleted the feature/report-redesign branch November 11, 2026 11:31
@shenxianpeng shenxianpeng added enhancement New feature or request minor A minor version bump labels Nov 11, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor A minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant