-
Notifications
You must be signed in to change notification settings - Fork 379
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
Review status of issues. #768
Conversation
381fdf3
to
5472af1
Compare
api/report_server.thrift
Outdated
// execution step list. | ||
8: shared.Severity severity // checker severity | ||
9: shared.ReviewStatus reviewStatus // bug review status. | ||
10: string reviewComment // review commment if review status is changed. |
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.
Do we need this comment in the Report data? Shouldn't the comment only be the part of the bug history that is queried with a separate API?
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.
This is not the same as the comments table, after the latest discussion review comments will be handled separately.
But I agree a separate api might be better to get these values. Will we show these comments on the main report lists?
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.
@@ -61,8 +61,7 @@ struct ReportFilter{ | |||
3: optional shared.Severity severity, | |||
4: optional string checkerId, // should filter in the fully qualified checker id name such as alpha.core. | |||
// the analyzed system. Projects can optionally use this concept. | |||
5: optional bool suppressed = false, // if the bug state is suppressed | |||
6: optional string bugHash | |||
5: optional string bugHash |
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.
Shouldn't we be able to filter on review status?
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.
Filtering is an upcoming feature in a different patch, #687.
api/report_server.thrift
Outdated
shared.SuppressBugList getSuppressedBugs(1: i64 run_id) | ||
throws(1: shared.RequestFailed requestError), | ||
// change review status of a bug. | ||
bool changeReviewStatusByHash(1: string bugHash, |
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.
Do we want to expose bug hash in an API call like this?
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.
Agreed, same as with "hiding" the bugHash behind the comment ID for the commenting feature, let's explain this better.
And the document string is not a full sentence either. 😉
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.
reportId
should be used instead of the hash
.
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 removed this function from the API. I use the changeReviewStatus
function instead of this.
api/report_server.thrift
Outdated
throws (1: shared.RequestFailed requestError), | ||
// change review status of a bug. | ||
bool changeReviewStatus(1: i64 reportId, | ||
2: i64 status, |
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.
Why not shared.ReviewStatus?
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.
There will be no other report server now to share the types with. Everything should be here.
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.
Thanks, I changed the type to shared.ReviewStatus.
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.
If I put the ReviewStatus
type to this file, there will be a conflict in the client_db_access_handler.py
because it imports the orm_model module which indicates a conflict, because the table name is the same as the type.
api/shared.thrift
Outdated
@@ -68,3 +68,11 @@ exception RequestFailed { | |||
2: string message | |||
} | |||
|
|||
//----------------------------------------------------------------------------- |
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 am not fond of these comments, I'd rather remove them all than adding new ones.
@@ -701,18 +672,7 @@ void test() { | |||
--export-source-suppress |
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.
Do we want to keep this? Shouldn't we have something like export user data, or export issue data instead?
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.
export-source-suppress
works at the analysis phase (collects suppress comments) and does not get the values from the database. I think we should not remove this yet. At least not as part of this pull request.
report_filter = [ | ||
codeCheckerDBAccess.ttypes.ReportFilter(suppressed=suppr)] | ||
codeCheckerDBAccess.ttypes.ReportFilter(r)] |
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.
What is r
here?
@@ -287,6 +266,16 @@ def __init__(self, bug_hash, author, message, created_at): | |||
self.created_at = created_at | |||
|
|||
|
|||
class ReviewStatus(Base): |
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.
How do we display these? Shouldn't status changes be shown like regular comments?
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.
If we want to support displaying the whole history of bug status changes, can the bug_hash be a primary key? Multiple status changes can happen to the same bug.
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.
bug_hash
perhaps won't be sufficient later on, when PathHash
is introduced, if it is.,
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.
Only one review status will be available for a bug_hash. Later, we will insert system events in the Comment table, see #746 issue.
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 can't seem to change the review status with an empty comment. Is this intended?
docs/user_guide.md
Outdated
[-p PORT] | ||
[--verbose {info,debug,debug_analyzer}] | ||
|
||
Exports or imports suppressions from a CodeChecker server from/to a suppress | ||
file, and is also used (if '--bugid' is specified) to (un)suppress reports. | ||
Imports suppressions from a CodeChecker server from a suppress file. |
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.
Import [...] from [...] from [...] ? Also the text here does not match the description of the subcommand --help
.
@@ -300,14 +300,6 @@ def __register_suppress(parser): | |||
|
|||
group = parser.add_mutually_exclusive_group(required=True) | |||
|
|||
group.add_argument('-e', '--export', |
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.
If we are changing it and updating the usage of cmd suppress
, let's update the oneline and the multiline description later on where the subcommand is defined, and keep the user_guide.md
in line with these changes.
from libcodechecker import generic_package_context | ||
from libcodechecker import host_check | ||
from libcodechecker import suppress_file_handler |
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.
We removed the import of this lib. I take it it's still used elsewhere in the cmd
so we can't fully get rid of it? (Yet?)
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.
We use it in two places:
- https://github.com/csordasmarton/codechecker/blob/review_status/libcodechecker/cmd/cmd_line_client.py#L476 (Use it to import data from suppression file).
- https://github.com/csordasmarton/codechecker/blob/review_status/libcodechecker/generic_package_suppress_handler.py#L13 (Use it to process suppression in codes).
@@ -195,7 +204,8 @@ function (declare, Deferred, ObjectStore, Store, QueryResults, topic, | |||
{ name : 'Message', field : 'checkerMsg', width : '100%' }, | |||
{ name : 'Checker name', field : 'checkerId', cellClasses : 'link', width : '50%' }, | |||
{ name : 'Severity', field : 'severity' }, | |||
{ name : 'Suppress', field : 'suppressComment' } | |||
{ name : 'Review status', field : 'reviewStatusHtml', cellClasses : 'review-status', width : '25%' }, | |||
{ name : 'Review comment', field : 'reviewComment' } |
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.
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.
|
||
//--- Review status comment message. ---// | ||
|
||
var reviewComment = dom.create('span', { |
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 like this idea very much! 💛
However, I don't really like the fact that this icon is there even if no custom comment is given -- and by default it shows the same text as the review status drop-down next to it. Perhaps we could hide it, if the isn't a comment.
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.
Great idea, thanks 👍
www/style/codecheckerviewer.css
Outdated
} | ||
|
||
.review-comment::before { |
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.
If there is a chance, perhaps this icon should have a cursor: help;
style added to it. I think it requires a new style element, not in the ::before
.
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.
As discussed:
Let's allow changing the review status with an empty comment.
Also add an appropriate placeholder text for the comment window: (Optionally) explain the status change...
, or something akin to this.
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 forgot another thing: suppressions in the source code should set the bug's state to... either false positive or won't fix (@dkrupp please clarify.)
Please import the suppression comment as the review status' comment from the source code into the database.
f4f60cb
to
2f271f1
Compare
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.
2f271f1
to
8b5821a
Compare
Thanks, I added a CSS |
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.
Okay. Truly thelast issue.
When I change a bug using the BugPath tree view on the left, it is still the review status of the bug that I opened the current tab with.
(The title of the tab does not change either, when I navigate bugs in the same file.)
dd114b8
to
09014f3
Compare
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.
Feature-wise we are good. Let's make the tests a bit more resillient and we'll be good to go.
shared.ttypes.ReviewStatus.CONFIRMED, | ||
review_comment) | ||
|
||
self.assertTrue(success) |
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.
Shouldn't we also check that the state actually did change on the server? This only checks that the API returns True
, it does not check the proper database write.
bug = run_results[0] | ||
|
||
# Change review status to confirmed bug. | ||
review_comment = r'This is really a bug' |
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 would simply use "This is really a bug"
here.
logging.debug("Bug review status didn't changed") | ||
|
||
# Change review status to false positive. | ||
review_comment = r'This is not a bug' |
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.
No need to introduce raw strings, if not neccessary. A simple "string"
should work.
09014f3
to
08f9716
Compare
Closes #684 issue.