Skip to content

fix: don't mark a subject red when only its author is wrong - #339

Merged
shenxianpeng merged 4 commits into
mainfrom
fix/ai-author-diff-line
Nov 11, 2026
Merged

shenxianpeng merged 4 commits into
mainfrom
fix/ai-author-diff-line

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Two small mistakes in the new report, both from treating any rule's value as if it were the commit's subject.

  • A commit that fails only CC017 (an AI tool is its author, the message is fine) showed its subject as a red - line in the diff, which reads as "this subject has to go". The subject is now red only when the advice is about it (a type, a length, a missing body, a branch name). Otherwise it stays as a grey context line above the advice, as it already does for a fix on another line.
  • A commit with an empty message showed its author (Jane Dev <jane@example.com>) where the subject goes in the "All checks" listing, because CC017's value is the author. An AI rule's value now never stands in for the subject, so the row shows only the hash.

Before and after

ai_attribution = "forbid", one commit made as Claude with a clean message, one with an empty message:

AI author before and after

Tests

  • A CC017-only commit keeps its subject as context.
  • An empty message's row no longer shows the author.
  • 339 tests pass, main.py coverage stays at 100%.

When a commit failed only CC017 (an AI tool as its author), the diff
showed its subject as a red line, as if the subject had to change. The
subject is now red only when the advice is about it. An empty message
also no longer shows the commit's author where its subject would be.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 11, 2026 15:45
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac53137c-6b4a-45b8-8246-55a4b073fc21
Commits

Reviewing files that changed from the base of the PR and between 21674f1 and 35cdfbd.

Files selected for processing: 2

  • main.py
  • main_test.py
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • 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

@shenxianpeng shenxianpeng added the bug Something isn't working label Nov 11, 2026 — with Claude
@shenxianpeng shenxianpeng self-assigned this Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✔ Commit Check passed

✔ Pull request: 2 passed

✔ Commits: 4 passed

✔ Author: 4 passed

✔ Branch: passed

All 11 checks
Pull request
  ✔ title        fix: don't mark a subject red when only its author is wrong
  ✔ description
Commits
  ✔ 5155d89      fix: don't mark a subject red when only its author is wrong
  ✔ 583060c      docs: add a before and after screenshot for the pull request
  ✔ efb5c24      docs: remove the pull request screenshot
  ✔ 35cdfbd      Merge branch 'main' into fix/ai-author-diff-line
Author
  ✔ name         Xianpeng Shen
  ✔ name         Xianpeng Shen
  ✔ email        3353385+shenxianpeng@users.noreply.github.com
  ✔ email        xianpeng.shen@gmail.com
Branch
  ✔ branch       fix/ai-author-diff-line

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 (21674f1) to head (35cdfbd).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #339   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines         1034      1038    +4     
=========================================
+ Hits          1034      1038    +4     
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 merged commit c5dada8 into main Nov 11, 2026
17 checks passed
@shenxianpeng
shenxianpeng deleted the fix/ai-author-diff-line branch November 11, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an AI tool bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant