Skip to content

feat: skip posting thread or review comments on PRs from forks - #557

Merged
2bndy5 merged 2 commits into
mainfrom
skip-fork-comments
Nov 9, 2026
Merged

2bndy5 merged 2 commits into
mainfrom
skip-fork-comments

Conversation

@2bndy5

@2bndy5 2bndy5 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

To avoid a confusing error about token permissions, this emits a log warning when skipping to post thread or review comments on PRs from a fork.

Related Issues

Summary by CodeRabbit

  • Bug Fixes
    • Pull request reviews and thread comments are no longer submitted for forked pull requests. The run logs a warning when review submission is skipped and reports the accumulated failed-check count when comment posting is skipped.
    • Non-fork pull requests continue to use the existing review and comment behavior.

@2bndy5 2bndy5 added the enhancement New feature or request label Nov 9, 2026
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (a2d4b10) to head (3fd5e35).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #557   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files          29       29           
  Lines        7664     7671    +7     
=======================================
+ Hits         7656     7663    +7     
  Misses          8        8           

☔ 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 marked this pull request as ready for review November 9, 2026 03:00
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The REST client skips review and thread-comment submissions for pull requests from a different remote. Tests cover fork-specific event data and verify that these submissions do not occur.

Changes: Fork pull-request gating

Layer / File(s) Summary
Gate review submission
cpp-linter/src/rest_client.rs, cpp-linter/tests/reviews.rs
Review construction and submission now run only for pull requests from the same remote. Review tests cover fork event data and assert that no review is posted.
Gate thread-comment submission
cpp-linter/src/rest_client.rs, cpp-linter/tests/comments.rs
For pull requests from a different remote, thread-comment processing returns the accumulated format and tidy check failures without creating or posting comments. Tests cover fork requests in new-comment and update modes.

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

Merge Risk: Low · up to 3fd5e

Pull requests from the same repository whose event payload lacks repository details could silently receive no review or thread comments, with a misleading warning that they come from a fork. This is a narrow edge case and does not block merging, but the owner should be aware of it.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: thread and review comments are now skipped on pull requests from forks. The raw summary confirms this change in cpp-linter/src/rest_client.rs, with matching test upda…
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.
Full details: Title check

Explanation

The title states the main change: thread and review comments are now skipped on pull requests from forks. The raw summary confirms this change in cpp-linter/src/rest_client.rs, with matching test updates in comments.rs and reviews.rs. The objectives describe the same behavior, and the title follows the conventional commit style.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • 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

coderabbitai[bot]

This comment was marked as low quality.

@2bndy5
2bndy5 merged commit ecb3fad into main Nov 9, 2026
77 checks passed
@2bndy5
2bndy5 deleted the skip-fork-comments branch November 9, 2026 03:15
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.

1 participant