Skip to content

refactor: migrate to git-bot-feedback lib#304

Merged
2bndy5 merged 18 commits into
mainfrom
switch-to-git-bot-feedback
Jun 4, 2026
Merged

refactor: migrate to git-bot-feedback lib#304
2bndy5 merged 18 commits into
mainfrom
switch-to-git-bot-feedback

Conversation

@2bndy5
Copy link
Copy Markdown
Collaborator

@2bndy5 2bndy5 commented Apr 18, 2026

resolves #97

This has 2 main benefits:

  1. Improved PR review support. The git-bot-feedback lib automatically hides outdated suggestions and reviews.
  2. Any further CI platform support can get implemented in the git-bot-feedback lib. This way, cpp-linter gets the newly supported CI platforms for "free."

During review, I found a way to remove dependence on OpenSSL in both libgit2 and reqwest libraries. We are now using rustls as our TLS backend for HTTP requests.

Summary by CodeRabbit

  • New Features

    • Improved error and reporting behavior for clearer CI feedback.
  • Bug Fixes

    • Progress indicators now show trimmed, contextual filenames.
    • Coverage command simplified to generate HTML output.
  • Refactor

    • Reworked REST/client and feedback plumbing for more consistent PR reporting.
  • Chores

    • Dependency bumps and CI/build matrix adjustments; updated packaging and test fixtures.

@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch 2 times, most recently from 9945499 to 0d59e1c Compare April 28, 2026 03:12
2bndy5 added 2 commits June 2, 2026 23:00
resolves #97

This has 2 main benefits:

1. Improved PR review support. The [git-bot-feedback] lib automatically hides outdated suggestions and reviews.
2. Any further CI platform support can get implemented in the [git-bot-feedback] lib. This way, cpp-linter gets the newly supported CI platforms for "free."

[git-bot-feedback]: https://github.com/2bndy5/git-bot-feedback
@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 0d59e1c to 89d1c26 Compare June 3, 2026 06:00
2bndy5 added 4 commits June 2, 2026 23:41
We don't need to see all logs for passing tests
remove unused functions

transition to git CLI in tests
This is a small step toward removing our dependence on libgit2
@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 460d9b4 to 30e0efe Compare June 3, 2026 11:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

❌ Patch coverage is 95.03205% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.94%. Comparing base (b59085b) to head (8cb6254).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cpp-linter/src/clang_tools/mod.rs 58.62% 24 Missing ⚠️
cpp-linter/src/git.rs 94.36% 4 Missing ⚠️
clang-installer/src/tool.rs 66.66% 2 Missing ⚠️
cpp-linter/src/rest_client/mod.rs 99.74% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #304      +/-   ##
==========================================
- Coverage   92.60%   90.94%   -1.66%     
==========================================
  Files          26       22       -4     
  Lines        4339     3368     -971     
==========================================
- Hits         4018     3063     -955     
+ Misses        321      305      -16     

☔ 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.

@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 329c03f to 5767d37 Compare June 3, 2026 13:38
for windows canonical path to git test patch asset
@2bndy5 2bndy5 added the enhancement New feature or request label Jun 3, 2026
2bndy5 added 2 commits June 3, 2026 07:03
This project's production code never does `git clone`, so we really shouldn't need the `https` feature of the `git2` crate enabled.
@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 5767d37 to e4f7145 Compare June 3, 2026 14:15
@2bndy5 2bndy5 marked this pull request as ready for review June 3, 2026 14:26
@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 7854340 to b8539a7 Compare June 3, 2026 14:35
Installing clang tools is now part of the tested production code.
We don't need a dedicated GH action to do that anymore.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Warning

Review limit reached

@2bndy5, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 29 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 61972d34-5e9a-465f-869d-030a6127853b

📥 Commits

Reviewing files that changed from the base of the PR and between 458c876 and 8cb6254.

📒 Files selected for processing (2)
  • cpp-linter/src/git.rs
  • cpp-linter/src/rest_client/mod.rs

Walkthrough

Migrate internal REST/filtering to a new RestClient backed by git-bot-feedback, add typed error enums, adapt clang-tools and FileObj flows to structured errors, rewire run_main and tests to use RestClient and updated file filters, and update CI/tooling/manifests and fixtures.

Changes

Rest client and pipeline migration

Layer / File(s) Summary
CI, packaging, and tooling configuration
.github/workflows/*, CONTRIBUTING.md, nurfile, cspell.config.yml, bindings/*
Update GitHub Actions matrices/commands, remove/adjust openssl-vendored flags, change coverage command alias to nur test html, add nur pre alias, and tweak packaging/freebsd/linux build steps.
Dependency and Cargo manifest updates
Cargo.toml, cpp-linter/Cargo.toml, bindings/*, clang-installer/Cargo.toml
Bump workspace and crate dependencies, add/remove features (git-bot-feedback), move TLS reqwest config, and update bindings manifests.
Typed errors and public API wiring
cpp-linter/src/error.rs, cpp-linter/src/lib.rs, cpp-linter/src/cli/structs.rs
Add SuggestionError/FileObjError/ClientError, expose error module, and add conversions/adaptations for external LinesChangedOnly and FileFilter usage.
RestClient implementation and markdown builders
cpp-linter/src/rest_client/mod.rs
New RestClient wrapper: changed-file retrieval, annotations, step-summary/comment builders, post_feedback orchestration, output variable writing, and tests.
Clang-tools: filters, suggestions, and error flow
cpp-linter/src/clang_tools/*
Switch filter predicates to is_qualified, change capture signature to take &RestClient, convert suggestion/patch error handling to SuggestionError, and adjust summarize/patch APIs.
Common FS and FileObj changes
cpp-linter/src/common_fs/*, removal of file_filter.rs
FileObj patch application now returns FileObjError; old FileFilter module removed in favor of external filter; imports consolidated.
Run integration and test migration
cpp-linter/src/run.rs, cpp-linter/tests/*, test fixtures under cpp-linter/tests/*
Rewire run_main to use RestClient, named log groups, directory-walk fallback, temp GITHUB_OUTPUT helper; update many tests and fixtures to match new REST client and payload shapes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: migrate to git-bot-feedback lib' clearly and concisely summarizes the main change—migrating the rest_api module functionality to an external library.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #97: trait-based abstractions, thread comments, step summaries, file annotations, PR reviews, and changed file retrieval using the external git-bot-feedback library.
Out of Scope Changes check ✅ Passed All changes are directly related to the migration objective. Updates to dependencies, CI workflows, test assets, and documentation are necessary components of integrating the external library and removing the internalized rest_api module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch switch-to-git-bot-feedback

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 7ad0037 to fdf8705 Compare June 3, 2026 17:21
only clang-related tests run on other clang versions.

should short-circuit the 20 minute wait just to see if all tests pass in CI.
coderabbitai[bot]

This comment was marked as resolved.

Looks like the all production code in the git module is no longer actually used, not in tests nor production.
So what remains is just the regressions tests.

refactored the new rest_client logic a bit, mainly just removing lines that are never triggered by tests.
@2bndy5 2bndy5 force-pushed the switch-to-git-bot-feedback branch from 458c876 to 8cb6254 Compare June 4, 2026 00:44
@2bndy5 2bndy5 merged commit d1e2136 into main Jun 4, 2026
80 checks passed
@2bndy5 2bndy5 deleted the switch-to-git-bot-feedback branch June 4, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

abstract rest_api module into a seperate library

1 participant