Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Visit https://gerrit.openecomp.org and log in, using your Linux Foundation identity. Here, you will be able to view the names of Projects to which you have access.

On top of the project listing, the web site provides you the command to clone the whole project, such as:


The project can be downloaded in either of two ways, via HTTP url or SSH url.

IntelliJ and SSH URL (Recommended)

To download the project using an SSH URL, you need to have already added your SSH key into the Gerrit website.

Visit https://gerrit.openecomp.org/r/#/admin/projects/ and select the project you are working on. The Gerrit site will show the full URL for the project:


Next, within IntelliJ, select File -> New -> Project from Version Control -> Git to open the Clone Repository window. Enter the SSH URL from above, including the project name (mso in this example), and chose your local Parent Directory. IntelliJ will fill in the Directory Name for you. Click Clone to clone the project.


For the first downloading, a window will appear to authenticate the host.Click Yes to continue.



IntelliJ and HTTP URL

Open IntelliJ and click File -> Settings -> Version Control -> Gerrit. In the resulting dialog box, enter the Gerrit URL as shown above, along with your Linux Foundation username and password. To test whether the connection is good, you can click the Test button:

Info
titlehttps: Required

The URL must use https:, not http:.

Once you have entered this information, click OK:


Then open File -> New -> Project from Version Control -> Git to open Clone Repository window. Enter the http url you have found above, but with https not with http, chose your local Parent Directory and Directory Name and click Clone to clone the project.


A window will pop up to input the user name and password. The user name is the username of your Linux Foundation account, and the password is the Gerrit HTTPS password generated during setup.

Pushing

changes

Changes for

review using a command line

Review Using a Command Line (optional)

Here are the Git commands to Now let's add some files and add our first make a commit with an associated message:

git

...

add

...

somefiles

git

...

commit

...

-m

...

"My

...

first

...

Awesome

...

commit"

...

Note that this is just an example and the commit message should be much more explicit than that.

Now that everything is ready, you can sign off your commit, make sure that your git user matches your Linux Foundation identity, as this will be verified by the Gerrit server.:

git

...

review

...

-s

You may be prompted for your Linux Foundation account password.

Now let's To verify that the commit hook workworked, this command will show you the commit message and the sign off entry:

git

...

commit

...

-as

...

--amend

...

You can automatically add the signature for all your commits by setting the git configuration : git config --global format.signoff true

Eventually, we can push the change to the gerrit server

git review

The code should now appear in the gerrit web interface, it needs a committer to approve it with a +2 and also move the verifed flag to +1, to do so, the committer can open the gerrit UI and click on the open review list

Image Removed

Then click on the Reply button, you can also add reviewers for their inputs, add a review comment, and move the flags to +2 and +1

Image Removed

Once a committer approves it, the code can be merged to the master branch

If issues are found, both contributors and committers can amend the review (use the top-left download link on the review screen to get the direct clone commands that would download the reviewed code in a local repository)Similarly to the above steps, do the needed modifications, and push the changes (again after signing them) using

git review

Note that you can also work on local branch, gerrit will automatically use your local branch name as a Topic for the review, allowing you to share branches between team members

More details on how to use gerrit : https://gerrit.openecomp.org/r/Documentation/index.html

...

Commit Changes Locally

Once you have made changed changes in the code, before you push the changes, you should commit the code locally first.

To do that, go to the Version Control window, under Local Changes, right click the changed files and click Commit Changes....

...

In the Commit Changes window, enter the Commit Message, select Sign-off commit option and click Commit button.


Committer Actions

The code should now appear in the gerrit web interface. It needs a committer to approve it with a +2 rating, and to also move the verifed flag to +1. The committer does this by visiting the gerrit.openecomp.org site and logging in.

Image Added


The committer may take any of several actions, such as clicking on the "Reply" button, adding reviewers, adding a review comment, and moving the flags to +2 and +1

Image Added


Once a committer approves it, the code can be merged to the master branch.

Then go to the Terminal window, use command apt-get install git-review to install git-review plugin in the machine, if not already installed.

...

If your address is not present or not the same as the one defined in Linux Foundation account, enter command git config --global user.email "jondoe@somewhere.com".

Then enter command git commit -as --amend to show the commit message and the sign off entry, as shown below. Make sure the email address is the exactly the same as the email you used in the Linux Foundation account. If not, update the address.

...

If you have been selected as the reviewer of the changes. You can right click the corresponding commit and click ReviewCode-Review to give your score and comments for the change.


 — Should we put the above section in a sub section

Failed Commit / Resubmit

If issues are found, both contributors and committers can amend the review (use the top-left download link on the review screen to get the direct clone commands that would download the reviewed code in a local repository)

Similarly to the above steps, do the needed modifications, and push the changes (again after signing them) using git review

Note that you can also work on local branch, gerrit will automatically use your local branch name as a Topic for the review, allowing you to share branches between team members

More details on how to use gerrit : https://gerrit.openecomp.org/r/Documentation/index.html