Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove sonarlint installation section, as ONAP SonarQube server (version 5.4) is not compatible with sonarlint base version 5.6

...

You can set up the SDNC IDE by following instructions from Setting Up Your Development Environment with the additions described below.

Install sonarlint plugin

<coming soon>

Download the Source Code

Create Your Linux Foundation Account

...

Ensure that you have the following configuraiton set properly:

GIT Config KeyExpected ValueSetting Command
core.eollfgit config --global core.eol lf

core.autocrlf

truegit config --global core.autocrlf true
user.nameyour namegit config --global user.name <your name>
user.emailyour email addressgit config --global user.email <your email address>


Anchor
Create A Review
Create A Review
Create A Review

...

2. Run the following commands in the listed order to create a review

StepsCommandNotes
1git commit -sam <comment summary>Commit summary should not exceed 50 char. See ONAP Commit Messages for more details.
2git log --shortstat

To ensure change lines are properly done and your commit has the following:

    • Change-Id
    • Signed-off-by

Here's an example:

Info
iconfalse
titlegit log --shortstat

C:\workspace\onap_sdnc\northbound>git log --shortstat
commit 4728eada855f9162030f5b46a2513e3dbffa757c
Author: beili.zhou <beili.zhou@amdocs.com>
Date: Fri Oct 13 19:19:11 2017 -0400

Sonar coverage vnfapi -VNFSDNSvcLogicServiceClient

Add Junit test case for VNFSDNSvcLogicServiceClient
In VNFSDNSvcLogicServiceClient:
- Fix sonarlint issues (remove un-used import and etc)
- Changed tab to 4 spaces as per ONAP Java code style

Issue-Id: SDNC-123
Change-Id: Id176e915f17ef5fabc6805415f92d60b4c8e95b2
Signed-off-by: beili.zhou <beili.zhou@amdocs.com>

2 files changed, 580 insertions(+), 240 deletions(-)


If the Change-Id does not exist, do not proceed. You need to following SDNC - Development Environment Setup to fix it before proceeding further.

3git commit --amend

Use this command to do the following:

    • add more desciption about this commit (refer to Commit Messages for how to organize commit description)
    • insert Issue-Id: <your ONAP issue id> before the Change-Id
4git review

This command will create the review at Gerrit.

Once this command is completed, your newly created review can be found from Outgoing reviews in Gerrit self dashboard .

3. Update the Gerrit Review to get ready

...

Go back to your workspace, and do the following to change the comments of your existing review.

StepsCommandNotes
1git commit --amendupdate the comment as desired
2git log --shortstatvalidate your commit now has the updated comments, as well as the Change-Id as the one in the gerrit review
3git review

push the changed comment to the review again.

Once the command is completed, go to your review, you will see

  • the comments content adjust to your new ones
  • the Patch Sets is now increased by one, such as from (1/1) to (2/2). here's an example:

Image Modified


How to Update the Code in A Review

...

Follow the steps to push your new code changes to the your existing reiew.

Stepscommandnotes
1git commit -sam "my updated code"To create a new commit with your updated code
2git log --shortstat

you will see the most 2 recent commits are from

  • your commit from step 1
  • your original commit of the existing review
3git rebase -i HEAD~2

To run rebase interactively for the most recent 2 commits

In the interactive mode, it will bring up the text which contains pick for your last 2 commits along with the following content:

Image Modified

Do the following:

  • replace the pick in the start line of your commit from step 1 (marked with "my updated code") with s or squash,
  • remove any other text line related to this commit in the line below.
  • save the change by entering :wq


Once this command is completed, 2 commits will be merged into 1 commit.

4git log --shortstat

you will see there's only 1 commit which replaces the 2 commit you have seen in step 2.

validate your commit has the Change-Id as the one in the gerrit review 

5git review

push the changed comment to the review again.

Once the command is completed, go to your review, you will see

  • the comments content adjust to your new ones
  • the Patch Sets is now increased by one, such as from (1/1) to (2/2). here's an example:

Image Modified


Anchor
Fix no change-id
Fix no change-id
How to Fix A Commit Does Not Have Change-Id

...

Follow the steps below to do the correction.

StepsCommandNotes
1git reset HEAD~1to undo the commit
2

from github helper page, download commit-msg,

and place it under your <repo>/.git/hook directory

set the proper commit-msg hook

this will set the Change-Id properly in your commit

3Use your previous command to create the commit again
4git log --shortstatto check the existence of Change-Id


How to Find All of My Merged Changes

...