-
Notifications
You must be signed in to change notification settings - Fork 42
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
New smart API to list issues #2534
base: master
Are you sure you want to change the base?
Conversation
276e8a2
to
6a2042c
Compare
I noticed the same combination of (analyzer, level, check, message) may be reported multiple times per file, which would lead to inconsistent returned values. For example, a new issues could be reported as known (if a similar issue is known on this file) or an issue could be returned as both unresolved and closed (in case there are multiple similar issues on a file, and only one has been closed). I think we should keep this endpoint KISS, and handle such edge cases in the bot. |
6a2042c
to
80c1006
Compare
45d027f
to
e068704
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.
A few comments to address as discussed together.
Then we'll run it on a local prod dump, and can probably ship to testing as it adds new endpoints.
self.diff.issue_links.annotate( | ||
known=Exists( | ||
IssueLink.objects.filter( | ||
revision__base_repository__slug="mozilla-central", |
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.
You can use the curent diff base repository id to make the query generic & faster (one less join)
revision__base_repository__slug="mozilla-central", | |
revision__base_repository_id=self.diff.revision.base_repository_id, |
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.
revision__base_repository_id=self.diff.revision.base_repository_id
do includes all issues from all diffs with the base repository. I suppose it should match revision__head_repository_id
instead ?
You will also need to serialize the This does not invalidate the fact that a 400 should be raised when it's not present in these cases |
f77168b
to
700f709
Compare
Based on #2530(merged)Closes #2533
All issues that are not returned as known/closed/unresolved can be considered as new.