shipit_static_analysis: Enable Phabricator reviews in production #1166
Comments
|
I published an offending patch to staging at https://phabricator-dev.allizom.org/D324 Nothing happened. Further troubleshooting is needed to discover if the bot actually detected this new code review or not. Also, I've never received an email report where the subject includes "New Static Analysis Phabricator", so I suspect that either (1) Phabricator code reviews are never detected by our bot, or (2) some error happens before an email report can be sent. We could try to run the bot locally to see if there are errors during analysis, but I don't know how to troubleshoot if the hook works. |
We can look at the Heroku logs for shipit-staging-pulse-listener, it logs when it starts tasks from Phabricator or MozReview, and then we can see the logs for the task on Taskcluster. |
|
So, I ran the bot manually against the staging patch using the following commands: It successfully published a review to https://phabricator-dev.allizom.org/D324, so we can conclude that the bot is able to submit reviews. However, since it didn't do that automatically, I suspect that the Phabricator hook doesn't trigger on staging (maybe that's specific to staging, or our hook is broken; I'm not sure). Additionally, you can see in the review that only |
|
With @marco-c we spied on the Phabricator staging hook to see if it actually triggers if I send a rebased patch up for review. A task does get triggered, but somehow it says the revision is There seems to be a confusion between the latest "diff ID" This causes analysis to succeed (it only uses the PHID) but then posting the comments fail, because there is no revision 622: We can either:
|
|
So, running Successfully published new comments against the latest diff. I conclude that Let's fix |
|
The phabricator hook parameter issue should be fixed by 3b24784. Hopefully auto-reviews will now work on staging, allowing us to move on to review validation. |
|
Now automatically published reviews on staging! Latest review on https://phabricator-dev.allizom.org/D324 was automatically submitted by the bot after I pushed a new revision, and you should have received an email titled: Edit: FYI successful triggered task was https://tools.taskcluster.net/groups/Zl9BpvZYR0GbkOobShA1pg/tasks/Zl9BpvZYR0GbkOobShA1pg/runs/0/logs/public%2Flogs%2Flive.log |
|
Ok, in the latest review (which was automated), we appear to have The staging configuration looks like this: From the logs, it looks like clang-tidy did run, but it's hard to tell exactly what happened (partly because clang-format adds a lot of noise). Relevant log excerpts: I'm not sure what happened, as all analysis steps seem to be running in random order, I guess before and after the patch. Maybe the problem is related to the Maybe we could temporarily disable |
|
By using #1209, i now get the following issues: |
|
So, our bot seems to catch all the issues again (on staging), which is great. However, yesterday's push to Phabricator staging didn't get any review comments. I attempted another push today, watching the logs. I did find a bug with the email report (#1210), but his time the Phabricator comments did work. Maybe it's a race condition, but I guess we'll have to try again a few times to make sure it works consistently. |
|
Now testing on a new phabricator-dev revision: https://phabricator-dev.allizom.org/D431 Triggered analysis task: https://tools.taskcluster.net/groups/DFq61B7ISwaYdCYqUc6QCw/ Last try didn't post any EDIT: It worked! |
|
I have a few nits about the automated review that was published to D431 (using the
|
|
10 issues were found before applying the patch, as we are running with new |
|
The codespell error is not in the dictionary (depandent) |
|
I created a PR codespell-project/codespell#549 for the depandent thing |
|
Thanks! But I just made it up, because I didn't know there was a misspelling dictionary (I thought it was Levenstein distance against an actual dictionary). I don't think that "depandent" is a typo that people could actually make by mistake. |
|
I'll be working on the other issues this week, i'll update this ticket when i get some code |
|
I've force-pushed |
|
This time the task went on longer, but it failed in the first |
|
For historical purposes: the problem was that we were using a version of Rust (1.27.0) which is not supported for automation on mozilla-central. We were not pinning Rust, so we inadvertently updated from 1.26.2 to 1.27.0 (this is now fixed by #1238). |
|
Updates:
EDIT: My workaround failed, because even with the |
|
Thanks to Bastien's fix, I was finally able to run another analysis on staging (https://tools.taskcluster.net/groups/Y0GiPYNEQHeSwRZ4x0RFoA/), and the bot posted a new review to https://phabricator-dev.allizom.org/D324. From what I see, it reveals the following problems (with the
Here is a snippet from the task's debug log: |
|
Some comments regarding 'misc-suspicious-missing-comma'. |
|
Thanks a lot @abpostelnicu for figuring out the threshold! I've updated the list of undetected checks. Still, the checks that are not |
|
I've updated our various checklists in this bug. Looking good! Thanks everyone for the hard work. Now we only need to run analysis on staging one more time (I expect it to be the last), and then move on to validating production (which should take much less time hopefully). @La0 please ping me when staging is un-broken again, so I can re-trigger an analysis. |
|
There were sevaral issues why the bot only reported on mozilla checks:
|
|
@jankeromnes Staging is back up since monday afternoon. |
|
Great! Thanks. I have:
|
|
And the results are in! We even have two reviews for the price of one on https://phabricator-dev.allizom.org/D324 (I suspect that The following problems still need to be fixed:
|
|
When running Additionally, the |
|
Update: The missing |
|
Looks like @La0 was able to fix all undetected With that, the What's weird is that |
|
Aha, the analysis' report.json indicates that the Hopefully this will be fixed with |
|
The fix from #1258 was deployed to Analysis is running: https://tools.taskcluster.net/groups/E3LiY0W6Q72GNJgUdrrX_w/ |
|
10/10 clang-tidy defects, 7/7 mozlint defects, 100% success! https://irccloud.mozilla.com/pastebin/goicWMJC/defects.txt |
|
New staging analysis, just in case: https://tools.taskcluster.net/groups/Hpi4TqYKQJaGqugH6yvIgQ EDIT: Success again! Go for |
|
Update: I've now enabled automated Phabricator reviews in production, and reviews look good! https://phabricator.services.mozilla.com/D2066 However, both MozReview and Phabricator reviews are currently broken for patches that touch C/C++ files (because of #1263). Once that issue is fixed, we should also validate that Additionally, I've had to disable |
|
10/10 and 7/7 on staging again! https://tools.taskcluster.net/groups/ZnCYTYy2QIqzyDnNHPiqWw/ This confirms that #1263's fix worked, and we can deploy it to production. Additionally, we can see the analyzer raw dumps in the tasks artifacts, which is great (except |
|
While waiting for general release next week, I'm trying to deploy a hot-fix for the Rust issue. I've deployed the hot-fix to staging, and re-validated the bot: https://phabricator-dev.allizom.org/D541 Results: 4/10 expected EDIT: The missing |
|
I've deployed a hot-fix to shipit-static-analysis-production with 2 fixes from master, and: 10/10 7/7 in production! (And deploying on Friday the 13th wasn't so bad... |
|
I've tried validating MozReview the same way, but the analysis task failed with https://tools.taskcluster.net/groups/Lp8DSs3xTHKPou13q85gUA/ I'll try to reproduce this bug locally and then bisect it. |
|
Hm, locally it worked: Production validated 10/10 7/7 on MozReview as well: https://reviewboard.mozilla.org/r/257216/#review264084 That intermittent |
|
|

Our automated review bot is able to analyze Phabricator code reviews.
We should evaluate its results on staging, and once satisfied we should enable it in production (and evaluate it there as well).
TODO:
clang-tidyandeslintissues work as wellThe text was updated successfully, but these errors were encountered: