Add an API to upload custom warnings
Categories
(Conduit :: Lando, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: marco, Assigned: zeid)
References
(Blocks 1 open bug)
Details
(Keywords: conduit-triaged)
Attachments
(1 file)
The reviewbot posts lint issues and build errors to Phabricator via harbormaster (see https://github.com/mozilla/code-review/blob/94e69637eb78fb7d0baa422775cfb29d2048cfa0/bot/code_review_bot/report/phabricator.py#L87 and https://github.com/mozilla/libmozdata/blob/2adac31e500a38669344e946ac8009b99738ca0c/libmozdata/phabricator.py#L479).
Some of them, e.g. clang-format or clang-tidy, can safely be ignored by developers as we know there are pre-existing issues in the codebase and their tasks are allowed to fail on mozilla-central.
Some other, e.g. flake8, can't be ignored by developers. If they land a patch with flake8 errors, the flake8 mozilla-central task will fail and the patch will be backed-out (or the developer will have to land a bustage fix).
Currently, Lando doesn't use the issues published by the reviewbot in any way. It'be nice if, in case of issues from unignorable linters, Lando prevented the landing of the stack or, at least, showed a warning that the developer must aknowledge before landing.
The only caveat is that there are (few) cases where the developer will try to land the patch before the reviewbot is finished analyzing, and so Lando is not always able to know if there are issues linked to the patch. I think this is acceptable though, as it should be relatively rare.
| Assignee | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
+1
In the case of unfinished tasks, I think that is something the submitter should also have to acknowledge. Maybe they could be batched together:
[ ] Reviewbot has detected failures or there are unfinished tasks
I think failures shouldn't block landing outright as the revision may be based on top of pre-existing issues, or there may be infrastructure problems outside of version control.
| Reporter | ||
Comment 2•5 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #1)
I think failures shouldn't block landing outright as the revision may be based on top of pre-existing issues, or there may be infrastructure problems outside of version control.
We have a way to detect issues that would cause backouts vs those that wouldn't (we report them with different severity levels on Phabricator), but yeah I agree it's preferable not to block landing altogether.
Comment 3•4 years ago
|
||
(In reply to Andrew Halberstadt [:ahal] from comment #1)
[ ] Reviewbot has detected failures or there are unfinished tasks
Bonus points if this message also includes a link to the push :)
| Assignee | ||
Comment 4•4 years ago
•
|
||
Three endpoints have been created to support this functionality. Here's one possible implementation on the client-side:
- create a new custom warning when a build/task is kicked off
- save the ID of the warning above, so it can be deleted later, or query all custom warnings in a particular group to fetch their IDs, then delete them (there should really only be one in this initial case.)
- if there are additional warnings based on the results, then delete all warnings and create a new one with a useful message
- if there are no more warnings, then delete all warnings and take no further action.
Notes:
- this PR is a work in progress, but the schema of the endpoints should not change much
- see this test for an example POST request
- there will be a form of authentication required before this is deployed to production
| Reporter | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Nice work Zeid! It would be great if the warnings could also be markdown formatted (if they aren't already) so we could link to the try push containing failures / unfinished tasks. Though this is a separate and lower priority request.
| Assignee | ||
Comment 6•4 years ago
|
||
With the current implementation, only links to Phabricator revisions and bugs will automatically linkify, since this is the current setup on the frontend. In the future, we can certainly allow for more customization. If you want, please file a a bug with an example warning message with links. Adding markdown support is probably much more complex than just allowing for specific links to be included in a warning (from a Lando UI perspective).
| Assignee | ||
Comment 8•4 years ago
|
||
yes
Description
•