-
-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor creating PR review comments #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
===========================================
- Coverage 100.00% 99.88% -0.12%
===========================================
Files 23 24 +1
Lines 1732 1798 +66
===========================================
+ Hits 1732 1796 +64
- Misses 0 2 +2 ☔ View full report in Codecov by Sentry. |
Everything seems correct in the test PR. |
I've got a new idea to merge the suggestions from both tools... Instead of each tool posting a separate review comment, I might be able to merge the comments from both tools if their line numbers match up. This idea is different from merging the patches from each tool. |
ece5ac5
to
b7146b6
Compare
Good idea! Just to confirm, if the user only uses clang-format or clang-tidy, they can still work. |
Yes |
Just to illustrate these changes: data structures (inheritence)graph TD
FileObj -- contains --> TidyAdvice -- inherits from --> PatchMixin
FileObj -- contains --> FormatAdvice -- inherits from --> PatchMixin
review comment dataflowChanges are capturedNote The flowchart TD
cachePatch["save suggested changes
to PatchMixin.patched"]
capTidy["`run_clang_tidy()`"] --> cachePatch
capFormat["`run_clang_format()`"] --> cachePatch
Review comments are createdStarting from Note The %%{init: {"flowchart": {"htmlLabels": false}} }%%
flowchart TD
postReviews["post_reviews()"] --> getComments["create_review_comments()"]
subgraph for each file in files
getFmtSuggestion["FormatAdvice
.get_suggestions_
from_patch()."]
getTidySuggestion["TidyAdvice
.get_suggestions_
from_patch()."]
getFmtSuggestion o-- Here we merge suggestions with existing comments --o getTidySuggestion
end
serialize["serialize comments
into JSON payload
(review summary created here)"] --> post["post new review"]
getComments -- if format-review is true --> getFmtSuggestion --> serialize
getComments -- if tidy-review is true --> getTidySuggestion --> serialize
|
550114e
to
e807f6e
Compare
The diagram and the final picture look amazing! |
I realized I keep using dense/complex sentences (with double negatives), and the code is not super simple. That's why I created the graphs and picture. |
84c23f1
to
978b45f
Compare
include hidden files in artifact upload
- show slowest tests - force use colored pytest output (for CI logs)
add test
and update config
per @shenxianpeng advice
978b45f
to
3bb8f33
Compare
I feel v1.10.1 might be a minor release insead of patch. It's amazing, no matter what. 👍 |
This abstracts the creation of PR review comments into its own module.
These changes are refactored from initial proposal in #115 but without the new dependency and changes from #116.