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
WIP: Implement reporter for code issues in a PR #5929
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5929 +/- ##
==========================================
- Coverage 91.68% 91.38% -0.31%
==========================================
Files 339 340 +1
Lines 36260 36404 +144
==========================================
+ Hits 33246 33268 +22
- Misses 3014 3136 +122
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this feature is really cool!
|
||
result_line = result['line'] | ||
|
||
preceding_change_i = bisect.bisect(changes_in_path, (result_line + 1, -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if bisect is very well known module of python.
I wasn't aware of it.
Also, the fact that we are comparing tuple like this looks suspicious.
I think we need a proper helper function to compare code line intervals (with unit tests)
result_line < preceding_change_start + preceding_change_length | ||
|
||
@defer.inlineCallbacks | ||
def _get_usable_results_in_changed_lines(self, master, target_changes_by_path, result_sets): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an error could be in an untouched line (removal of used import for example).
gitlab allows you to comment on untouched lines.
So for this generic code, I believe we shouldn't filterout
maybe we could split two sets of results something like:
touched_line_issues
untouched_lines_issues
4070b7f
to
4553e6c
Compare
GitHub has "annotations" which can be seen in https://github.com/actions-rs/clippy-check screenshot and described in https://github.community/t/what-are-annotations/16173 Submitting these comments as a review has a disadvantage that if you push additional commits closing these problems, review comments will not go away and have to be resolved manually. |
This is a WIP PR that demonstrates a reporter that takes a list of issues reported by e.g. pylint, determines if they are made in code that has been changed in a PR and for each such issue submits a comment on specific line on a github PR.
See an example screenshot below.
Further work: we probably need to automatically remove all comments that have not been commented on when a new test run completes. Otherwise it introduces additional effort needed by the developers to close no longer relevant issues when a PR is updated.
The current design is as follows: