<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Bastien, others,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 7, 2019 at 9:38 AM Bastien Abadie <<a href="mailto:babadie@mozilla.com">babadie@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">TL;DR: We are leveraging the try infrastructure to perform source code<br>
analysis (linters, static analyzers, etc). You can take advantage of this<br>
to trigger other try jobs on Phabricator revisions.<br></blockquote><div><br></div><div>What is the status of this work?  I want to take advantage of the new infrastructure to finally turn certain Android analysis tasks into proper lints (see Bug 1512487 [1]) but the "Plan 4 Source Code Analysis" build plan appears to both instantly fail and be opaque (see, for example [2]).  I believe that "reviewbot" was very unhappy last night; perhaps that is related?</div><div><br></div><div>Even with setbacks, I'm excited for these changes to make it easier to build analysis tasks!<br></div><div>Nick<br></div><div><br></div><div>[1] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1512487">https://bugzilla.mozilla.org/show_bug.cgi?id=1512487</a></div><div>[2] <a href="https://phabricator.services.mozilla.com/harbormaster/build/89310/">https://phabricator.services.mozilla.com/harbormaster/build/89310/</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
For more than a year, the Release Management & Quality team has been<br>
running the Code review bot<br>
<<a href="https://phabricator.services.mozilla.com/p/reviewbot/" rel="noreferrer" target="_blank">https://phabricator.services.mozilla.com/p/reviewbot/</a>> using several<br>
Mozilla in-house projects: Taskcluster <<a href="http://docs.taskcluster.net/" rel="noreferrer" target="_blank">http://docs.taskcluster.net/</a>> &<br>
release-services <<a href="https://github.com/mozilla/release-services" rel="noreferrer" target="_blank">https://github.com/mozilla/release-services</a>>.<br>
<br>
Our process was simple at first: for every new patch on Mozreview, then<br>
Phabricator, we would run a few analyzers in a Taskcluster task. It worked<br>
well for some time, but did not provide the flexibility nor the performance<br>
needed to support more analyzers (clang-format, Infer, Coverity, …)<br>
<br>
So we decided to experiment with a more scalable architecture, using<br>
Treeherder/Try to run all necessary analyzers for your patches, in parallel.<br>
<br>
This move will give us a lot of benefits:<br>
<br>
   -<br>
<br>
   The analyzers themselves are well defined and exposed in<br>
   mozilla-central, allowing us to use the exact same tools as our usual CI<br>
   and the developers on their computers.<br>
   -<br>
<br>
   Better overall performance and stability (from mercurial clones to<br>
   running analyzers safely in parallel)<br>
   -<br>
<br>
   A standard analyzer output in JSON will allow us to easily add new<br>
   analyzers. These new implementations could even come from you!<br>
<br>
<br>
Over the last few months, we have been building the different pieces needed<br>
to move the bot on the Try infrastructure, and today, I’m glad to announce<br>
it’s running in production, on your revisions!<br>
<br>
Any new Diff on Phabricator should now have a build plan named Source Code<br>
Analysis <<a href="https://phabricator.services.mozilla.com/harbormaster/plan/4/" rel="noreferrer" target="_blank">https://phabricator.services.mozilla.com/harbormaster/plan/4/</a>>.<br>
Phabricator triggers a code review as soon as the diff is published,<br>
automatically creating a new try job. You’ll get a “Treeherder Jobs” link<br>
next to the build plan when it’s created by the bot, allowing you to check<br>
on the analysis progress, and dive into the issues.<br>
<br>
<br>
You will also be able to use Treeherder to add new jobs, effectively making<br>
it possible to run try tests for Phabricator revisions in just a few<br>
clicks. On a Treeherder push, open its action menu on the right side (right<br>
after the Pin button). The "Add new jobs" options shows all the available<br>
jobs grouped by platform and test suite, and you can click to select and<br>
then submit. "Add new jobs (Search)" allows you to search in the job names<br>
like mach try fuzzy and add them.<br>
<br>
If the patch contains any issues, they will be reported as before, through<br>
inline comments. You can now restart a build if it fails (click on the<br>
Build, there is a “Restart Build” link in the right sidebar). Please note<br>
that secure revisions are not supported for now, but we are actively<br>
working on that (a build failure will be shown for secure revisions for the<br>
time being).<br>
<br>
We would like to thank the different people and teams involved in this<br>
effort: Andrew from the Automation team; Tom, Rail, Chris and Rok from<br>
Release Engineering; Dustin and Peter from the Taskcluster team; Steven,<br>
glob and David from the Engineering Workflow team.<br>
<br>
If you have any questions regarding this move or the code review bot, feel<br>
free to contact us by mail or on IRC #static-analyzers.<br>
<br>
Bastien, on the behalf of the Release Management and Quality team.<br>
_______________________________________________<br>
dev-platform mailing list<br>
<a href="mailto:dev-platform@lists.mozilla.org" target="_blank">dev-platform@lists.mozilla.org</a><br>
<a href="https://lists.mozilla.org/listinfo/dev-platform" rel="noreferrer" target="_blank">https://lists.mozilla.org/listinfo/dev-platform</a><br>
</blockquote></div></div></div></div>