Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix screenshots

Table of Contents
maxLevel3

...

To create your linux foundation account, go to Linux Foundation Identity page, and select I need to create a Linux Foundation ID, the following page will be shown:

Image RemovedImage Added

Filling the information and click on Create new account to proceed account creation.

...

Project NameProject Descriptionhas code
ccsdk/dashboardOpeations Manager Dashboard(tick)
ccsdk/distributionCCSDK distribution packaging (e.g. docker containers)(minus)
ccsdk/parentParent POMs to be used by CCSDK clients(minus)
ccsdk/platform/blueprintsBlueprints. not in Amesterdam release(minus)
 ccsdk/platform/nbapiNorthbound API(tick)
 ccsdk/platform/pluginsPlatform plugins(tick)
 ccsdk/sli/adaptorsCommon adaptors for use by directed graphs(tick)
ccsdk/sli/coreCore Service Logic Interpreter classes(tick)
 ccsdk/sli/northboundCommon northbound APIS related to service logic interpreter(tick)
 ccsdk/sli/pluginsCommon plugins used by direcged graphs (tick) python
ccsdk/storage/esaasElastic Storage as a Service.  not in Amesterdam release(minus)
ccsdk/storage/pgaasPGAAS (PostgreSQL as a Service)(tick) java, python, bash
ccsdk/utilsUtilities(tick) bash, yaml

...

Info
titleCheck this only once

This should have been done as part of IDE setting up following Setting Up Your Development Environment. Just in case you have missed it.

If behind proxy, ensure git config has set http.proxy and https.proxy NVPs,

check with the following command:

git config -l

if not exist add the with the following commands:

git config --add http.proxy <your-proxy-http-url>

git config --add https.proxy <your-proxy-https-url>

here's an example:

git config --add http.proxy http://<user-id>:<password>@11234.proxy.com:8080

git config --add https.proxy https://<user-id>:<password>@11234.proxy.com:8080

...

Get Project list by entering the project key name in the Filter, for example sdnc, this list of projects under sdnc will be shown as below:

Image RemovedImage Added

Click on the wanted project from the list, the General page of the selected project will be shown. the following is the General page of sdnc/adaptors:

Image RemovedImage Added

Now click on Clone with commit-msg hook, then click on http, then click on the notepad icon.

Image RemovedImage Added

The git clone command for the selected project is now copied into your clipboard. You do paste to use it at where-ever you want to.

...

ONAP code can also be viewed from gerrit web site as below (sdnc/adaptors project is used as the example here):

Image RemovedImage Added


To view the coce through gerrit client, first follow steps in Get git command from ONAP gerrit to get the Projects list page.

...

In the project list page, click on the gitweb under the Repository Browser column of your project row.

Image RemovedImage Added

The master branch's summary page will be shown up. Click on the tree option.

Image RemovedImage Added

Now, the repo details page will be shown and you can view the code in master branch from there.

...

In the project list page, click the project under the Project Name column. (using sdnc/adaptors project as example here)

Image RemovedImage Added

It takes you to the project General page, click on the Branches option.

Image RemovedImage Added

The project page will be switched to Branches page. Check out the Branch Name column, click the gitweb on the same row of the desired branch.

Image RemovedImage Added

The project Summary page of the selected branch will be shown up.  Click on the tree option.

Image RemovedImage Added

Now, the repo details page will be shown and you can view the code in master branch from there.

...

Info
titleJust to emphasis

If behind proxy,
Add proxy definition under proxies block, if under proxy Collapse source

1
2
3
4
5
6
7
8

<proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <host>11234.proxy.com</host>
  <port>8080</port>
  <nonProxyHosts>local.net|localhost|127.0.0.1</nonProxyHosts>
</proxy>

...

In your interlliJ, Select View -> Tool Windows -> Maven Project

Image RemovedImage Added

The maven project will shown on the right side of your intelliJ window.

Image RemovedImage Added

 Click the Maven Settings wrench to bring up the Settings window:

Image RemovedImage Added

Select the Override of the User settings file, add the settings.xml file full path, the Apply button will be enabled. click on Apply to apply the change.

...

From interlliJ Maven Projects window, find the module marked with (root), expand it by clicking on the triange on the left side or double clicking the text. It will then show two folders : Lifecycle and Plugins. Use the same way to expand the Lifecycle folder, the build options are now shown:

Image RemovedImage Added

To run the build, double click the Install or select install and then click on the Run Maven Build triange icon.

...

In anywhere of this class editor, do Ctrl+Shift+T or right click to bring up right click menu, then select Go To, then Test in the cascaded menu:

Image RemovedImage Added

This will bring up the Choose Test for... window as below.

Choose Create New Test... for creating brand new JUnit Test, or just choose the test class to go to the existing tests.

Image RemovedImage Added

When Create New Test... is selected, the Create Test window will be brough up:

Image RemovedImage Added

The test Class name is automatically generated and shown in the window. Ensure the Testing library is selected with JUnit4.

...

Info
iconfalse
titleJUnit dependencies in POM file
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

Mock Class Level Attributes

...

  • download the Git for Windows installer
  • start installer and follow Git Setup wizard screen Next until Finish prompts to complete the installation.

must have python installed

...

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
Creating 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 Fix no change-id 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 .

...

Click the Add button in the Reviewers section, to add reviewers (who is going to review your code) and committers (who is going to review your code as well as approve and commit your code).

Image RemovedImage Added

Note:

    • The ONAP Jobbuilder will be added automatically within one or two minutes after the review created, and a verfiy build will also be automatically triggered for your review in ONAP jenkins server.
    • The committer can be found from Software Defined Newtork Controller secion in Resources and Repositories page.

...

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 RemovedImage Added


How to Update the Code in a Review

...

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 RemovedImage Added

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 RemovedImage Added


Anchor
Fix no change-id
Fix no change-id
How to Fix a Commit which Does Not have a Change-Id

...

To find all of your changes, you can type in "is:closed(owner:self)" in the Search field at Gerrit self dashboard, then click on the Search button.

Image RemovedImage Added


Deployment

Deploying a Minimal ONAP SDN-C Environment

...

Port forwarding can also be configured in the Virtual Box Gui.   Here is an example

Image RemovedImage Added

ssh to the Guess OS

...

Code Block
...
rpc haok-sdnc-test {
    output {
      leaf hello-world {
         type string;
         mandatory true;
      }
    }
}
...


Image RemovedImage Added

Use Maven to Build Project

...

It takes a miniute to restart the karaf platform which really depends on the performance of your host machine.

Image RemovedImage Added

Remote Debugging

...

After the docker instances fully started, you should see the karaf log information below with 5005 port open.

Image RemovedImage Added

Use Remote debug in IDE

Image RemovedImage Added