[haiku-development] Re: Checker bot for Gerrit

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 20 Mar 2021 09:33:33 +0000

Hi,

Thanks for your interest in Haiku.

Here is what I can say about this project idea.

First of all, maybe start by looking at our Gerrit instance at 
http://review.haiku-os.org.
Look at a few changes there to see how code reviews are handled. You will 
notice in particular:

1) There is nothing in place to check if a change actually compiles
2) A lot of the review comments will be about code formatting problems
3) Since the review is done manually, there is some delay between the patch 
submission and the initial feedback

In this GSoC project, the goal is to fix some of these problems.

We plan to do this with a tool (or maybe multiple tools) that would:

- Be triggered whenever a change is submitted
- Check the code formatting
- Check that the code actually builds
- Submit a reply to the code review tool to give its results

The idea is that it will solve the following:

- People reviewing the patches will have less work to do in checking coding 
style problems, and can instead focus on reviewing the functionality of the 
patch. This will result in more interesting discussions
- People submitting patches will get "immediate" feedback a few minutes later, 
making it more likely that they will still be in the mood to work on Haiku and 
fix the problems found by the bot. And after they have submitted a few 
revisions of their code, I hope it will result in more engagement with the code 
review process, and so, it will be more likely that they also handle the 
comments by humans (right now a lot of people seem to not follow up after their 
initial patch submission).


Now with the idea description (hopefully) being more clear, here are some 
pointers on how things are currently set up and what needs to be done:

- The code review tool is at https://review.haiku-os.org/q/status:open
- We currently use concourse (at https://ci.haiku-os.org ;) for automated 
builds, but it is used only for the master branch and not for pending code 
reviews. Maybe the bot can benefit from this infrastructure, maybe not. This 
should be researched while preparing your GSoC proposal. Maybe it is worth 
looking at how Gerrit integrates with other continuous integration tools such 
as Jenkins.
- This github repository: https://github.com/haiku/infrastructure has the ;
required files to allow you to deploy a test environment with Concourse and 
Gerrit similar to the one used for Haiku, to allow experimenting
- We have work in progress for a tool that reformats the code correctly. This 
is based on clang-format but modifying it to add our own rules. You can find 
this work here: https://github.com/viveris/llvm-project ;(as a fork of the whole 
llvm tools with our patches applied) or here: 
https://github.com/owenca/haiku-format . That second repo has some bugs opened ;
about things that the tool doesn't get quite right yet, so improvements could 
be needed here.
- In Gerrit it is possible for automated tools to submit comments in a code 
review. This uses a REST API and is documented here: 
https://gerrit-review.googlesource.com/Documentation/config-robot-comments.html
- The bot should also set the "Verified" label in Gerrit according to the 
result of its checks. The usage of this label is documented here: 
https://gerrit-review.googlesource.com/Documentation/config-labels.html and the ;
REST API to submit a review with changes to the label: 
https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review

19 mars 2021 21:35 "saloni goyal" <salonig1212@xxxxxxxxx> a écrit:

Hi!
I am Saloni. Currently I am pursuing B.Tech (Computer Science and
Engineering) and I want to contribute to Haiku organisation in
GSoC,21. The simple design has impressed me and I have installed Haiku
in a virtual box by downloading it's ISO file from the website. I
would like to contribute to the Coding style checker bot for Gerrit
project.
Can you guide me about this?

Thank you.


Other related posts: