The AGL community appreciates feedback, ideas, suggestion, bugs and documentation just as much as code. Please join the irc conversation at the #automotive channel on irc.freenode.net and our mailing list.
We use Gerrit to track and review changes to AGL software (i.e. projects at gerrit.automotivelinux.org).
Create an account on identity.linuxfoundation.org to get started.
The initial setup for gerrit is described very well on the Gerrit Tutorial from mediawiki . Just apply the steps likewise on git.automotivelinux.org .
Use cases were created to describe the desired usage for gerrit. Those may be reviewed here.
The AGL gerrit setup is divided into three main repository groups
Developers may request a new project to be set up in the src or staging repository by submitting a Jira ticket. Ticket type should be a “Task”
An administrator will create the repo (/src/<name> or /staging/<name>) and also a gerrit group for the repo called “<name>-owners” .
Access control to gerrit is defined in this google doc spreadsheet.
The overall Gerrit workflow for a code change submitted to the project follows this diagram.
One can assume that requesting changes to be reverted will follow the same flow as those for new code and patches. Access to various functions within gerrit is granted according the roles defined here.
The most general role in the project is the AGL-committer. They may push proposed changes to gerrit, initiate a code review of those changes, and perform code reviews of proposed changes.
The ability to accept and merge changes into the AGL Repositories is reserved for role of AGL-mergers. AGL-mergers have all access granted to AGL-committers as well as the ability to +2 or -2 any proposed changes and submit those changes to the AGL Repository in gerrit. Self-review by AGL Mergers is generally frowned upon and AGL-mergers should only give a +2 or -2 after others reviewers after weighed in on the change.
Registered users in gerrit without any of the above access levels may fetch the repositories or may participate in reviews. This allows registered users to be added to reviews by committers without having to be added to the Committer list.
In addition to providing comments and suggestions for improvement, reviewers are encouraged to respond to changes with an overall +1, -1 type value. The meaning of these numbers is explained in the Gerrit documentation: Code review labels
Here is a brief summary of the values:
-2: This must not be merged. -1: I would prefer that this is not merged as is. 0: I am not making any statement about this change at the moment. +1: Looks good to me, but someone else must approve it. +2: Looks good to me, approved.
These values do not get added together by Gerrit, so two +1s do not lead to an automatic merge.
Changes can only be merged to the master branch once they have received a +2 and no -2. Only members of the AGL-Mergers group can give +2.
By default the repo tool will have clone git repo with http for fetch and ssh to push.
#cd meta-agl #git remote -v agl https://gerrit.automotivelinux.org/gerrit/AGL/meta-agl (fetch) agl ssh://gerrit.automotivelinux.org:29418/AGL/meta-agl (push)
if you want to use your ssh config, add your gerrit user accout to your ssh config file like:
#cat ~/.ssh/config Host gerrit.automotivelinux.org User XXXMyNameXXX
Then you still need to enter you ssh public key in Gerrit. You can find a HowTo here
Please sign you commit before you submit the change (otherwise it will not be accepted by gerrit):
git commit --signoff
git push agl HEAD:refs/for/master git push <remote> HEAD:refs/for/<targetbranch>
# first time only git review -s
# then to push use git review
Find more details in these guides:
meta-agl> git push gerrit testsandbox:refs/heads/sandbox/jsmoeller/test Total 0 (delta 0), reused 0 (delta 0) remote: Processing changes: closed: 114, refs: 1, done To ssh://email@example.com:29418/AGL/meta-agl * [new branch] testsandbox -> sandbox/jsmoeller/test''
Push to personal branch:
git push gerrit testsandbox:refs/for/sandbox/jsmoeller/test Counting objects: 2, Fertig. Delta compression using up to 8 threads. Compressing: 100% (2/2), Fertig. Writing objects: 100% (2/2), 327 bytes | 0 bytes/s, Fertig. Total 2 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1) remote: Processing changes: new: 1, refs: 1, done remote: remote: New Changes: remote: https://gerrit.automotivelinux.org/gerrit/5643 test1 remote: To ssh://firstname.lastname@example.org:29418/AGL/meta-agl * [new branch] testsandbox -> refs/for/sandbox/jsmoeller/test