Skip to content

feat: point the missing-include hint at the given compilation database - #615

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-u751ea
Nov 27, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-u751ea

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #614. When clang-tidy reports included files as not found, the comment adds a short hint under the results table. That hint always said to generate a compilation database and pass it as the database option, which doesn't fit when --database was already given.

Now the hint depends on whether --database was given:

  • Not given: unchanged (generate a database and pass its folder as database).
  • Given: the database may be out of date or not match these sources; check that it was generated for this checkout and that database points to its folder.

It is only a hint about the likely cause. Findings, counts and exit status don't change.

How: FeedbackInput::has_database is passed to make_comment and kept in CommentContext. missing_includes_get_a_hint now also covers the hint with a database, and absolute_db_path checks has_database. Most of the test diff is the extra make_comment argument.

Related Issues

Relates to #614

Summary by CodeRabbit

  • Improvements
    • Clarified guidance when required included files are missing. If a compilation database is provided, the message now suggests checking whether it matches the current checkout and whether its path is correct.
    • If no compilation database is provided, the message advises generating one and specifying its folder.

@shenxianpeng
shenxianpeng requested a review from 2bndy5 November 27, 2026 07:08
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The feedback flow now tracks whether a compilation database was supplied. Missing-include comments use that state to provide either database-specific checks or guidance to generate a database.

Changes: Compilation database-aware feedback

Layer / File(s) Summary
Track database presence
cpp-linter/src/cli/structs.rs, cpp-linter/src/rest_client/comment.rs, cpp-linter/src/rest_client/feedback.rs, cpp-linter/src/rest_client/test.rs
FeedbackInput records whether the CLI supplied a database. Feedback paths pass this flag into comment generation, and tests update calls to the comment API.
Select missing-include guidance
cpp-linter/src/rest_client/comment.rs, cpp-linter/src/rest_client/test.rs
When a database was supplied, the missing-include comment advises checking whether it is outdated, mismatched with the sources, or points to the wrong folder. Without a database, the comment advises generating one and providing its folder. A test checks the database-specific message.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Merge Risk: Minimal · up to 377cd

This change makes the missing-include hint in clang-tidy comments depend on whether a compilation database was supplied. Only the hint text changes; findings and exit status do not. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title says the missing-include hint now points at the given compilation database. The changeset matches this. FeedbackInput gains has_database, make_comment passes it into CommentContext, and the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title says the missing-include hint now points at the given compilation database. The changeset matches this. FeedbackInput gains has_database, make_comment passes it into CommentContext, and the missing-includes comment varies its guidance: with --database it says the database may be outdated or mismatched and advises checking the checkout and the database path; without it, it keeps the advice to generate a database. The title is short, specific, and names the primary change. The 'feat:' prefix is a conventional-commit type and is acceptable.

  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f77ecbe2-77f3-4d9a-85d5-a772104c9a39
Commits

Reviewing files that changed from the base of the PR and between 3204645 and 377cd10.

Files selected for processing: 4

  • cpp-linter/src/cli/structs.rs
  • cpp-linter/src/rest_client/comment.rs
  • cpp-linter/src/rest_client/feedback.rs
  • cpp-linter/src/rest_client/test.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (3204645) to head (377cd10).

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #615    +/-   ##
========================================
  Coverage   99.75%   99.75%            
========================================
  Files          37       37            
  Lines        9842     9995   +153     
========================================
+ Hits         9818     9971   +153     
  Misses         24       24            

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shenxianpeng
shenxianpeng merged commit 00cf07b into main Nov 27, 2026
42 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-u751ea branch November 27, 2026 08:16
2bndy5 pushed a commit that referenced this pull request Nov 28, 2026
## Summary

In the rc.29 release PR (#616), #614 and #615 (both `feat:`) are listed
under "Changed" instead of "Added". The old git-cliff config grouped
entries by PR labels; the release-plz config from #610 matched `field =
"group"` instead, which is not the commit type, so only the fallbacks
applied: `^[fF]ix` caught `fix:` commits and everything else ended up in
"Changed".

The parsers now match the conventional type in the commit (PR) title,
e.g. `^(add|feat)(\(.*\))?!?:`, for each group.

Checked with `release-plz update` on current main: #614 and #615 are
under "Added". With the version set to 2.0.0 (so that every commit since
`2.0.0-rc9` shows up), `feat` → Added, `fix` → Fixed, `build` →
Dependency updates, `docs` → Documentation and `refactor` → Changed,
matching the earlier hand-written grouping.

After this is merged, running the Release-plz workflow again updates
#616.

## Related Issues

Relates to #616

<!-- claude-projects-attribution: {"github_login":"shenxianpeng"} -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Changelog**
* Changelog entries are categorized using conventional commit prefixes,
including optional scopes and breaking-change markers. Supported
categories cover features, deprecations, removals, fixes, performance,
security, builds, tests, documentation, and maintenance. Other
conventional commits appear under “Changed,” while non-conventional
commits are skipped. Previous fallback handling for unprefixed “add” or
“fix” messages is no longer used.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants