Versions Compared

Key

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

...

  • Login to Gerrit (https://gerrit.onap.org/)
  • Click your name at the top right.
  • Go to Settings → SSH Public Keys
  • Click Add Key.
  • Go back to Eclipse and go to "Window→ Preferences→ General→ Network Connection→ Window"→ "Preferences"→ "General"→ "Network Connection"→ "SSH2" → LOAD EXISTING KEY
  • Paste the text of your public key into the text box.
  • Click Add.

...

  • To see these settings in Gerrit (https://gerrit.onap.org/), click on the drop down next to your name and choose "settings". You will see your user name and email.
  • To check the committer information being filled in by used by EGit (a.k.a. Git in Eclipse), go to in Eclipse and go to: "Window" "Preferences ", then "Team" "Git-Configuration → User Settings
    Image Removed"→ "Configuration", and select the "User Settings" tab:
    Image Added

  • The table should contain a "user" category with an "email" and a "name" entry.
  • The value for the "email" key should be your email from Gerrit.
  • The value for the "name" key should be your user name from Gerrit.
  • If "User Settings" is empty or the If User Settings is empty or the information doesn't match your settings in Gerrit, you will add or update entries in the key-value table.
  • need to update your User Settings. Sometimes on an initial setup, your settings may not be writable.
    • First check that the Location field points at a valid Git config file. If you're unsure, click on "Open". This should open the .gitconfig file in the background in Eclipse.
      • Note: if you want to switch to the opened file and see its contents, you'll need to close the settings window and reopen it.
    • If the specified .gitconfig file isn't valid and writable, you may be able to fix this by exiting Eclipse, specifying your home directory in Windows, and reopening Eclipse. Follow the instructions here: http://wiki.eclipse.org/EGit/User_Guide#Setting_up_the_Home_Directory_on_Windows
  • Once your User Settings are editable:
    • If the "email" key exists but has the wrong value, select the value field in the table and provide your email from Gerrit.
    • If the table is empty or missing the "email" key, select "Add Entry...", type in the key "user.email", and provide your email from Gerrit as the value.
    • If the "name" key exists but has the wrong value, select the value field in the table Select "add entry". Type in as a key "user.name" and provide your user name from Gerrit.Then select
    • "add entry" againIf the table is empty or missing the "name" key, select "Add Entry...", type in the key "user.email" as a key and provide your email from Gerritname", and provide your user name from Gerrit as the value.

Cloning the Model

The ONAP model currently resides in Gerrit in the modeling/modelspec repository. In order to download the model to your machine, to either visualize it or make updates, you will need to clone it in Eclipse/Git.

...

  • Make sure to fill in User and Password with your LF Userid and password. Once the screen is filled in, select "Next".
  • It will then prompt you for the branches to select. Choose: "master" (DESELECT everything else) and click "Next". The popup should looks like this:
    Image Modified
  • You will then be prompted to select a local directory on your machine into which the model should be loaded by Git. It can be any location you want, and not necessarily the workspace you are using for Eclipse/Papyrus projects.   As an "initial branch", select "master". Check the box "Import all existing Eclipse projects...".  Your screen at this point should look like this:
    Image RemovedIf you forget to check the box to import all existing Eclipse projects, you will not see the project in the Papyrus perspective.To fix this, go to the Git perspective, select the repository name or the Working Tree, then right-click and select "Import projects...".this:
    Image Added
  • Note: If some step in this process doesn't work, you may have to exit your corporate VPN or, alternatively, set up a proxy access gerrit:
    • Go to "Window"→"Preferences"→"General"→"Network Connections"
    • Edit the entries for HTTP and HTTPS that have "Provider" preset to Manual. For both, set the URL for your proxy under "Host" and its port under "Port".
  • Select "Finish".
    • For a first-time setup, you may get the following message. Select "Yes".
  • The cloning process should complete, and the repository should be created on your local machine. If you encounter errors, contact the ONAP model administrator to get help.
  • The view below shows an example of the newly created repository which has been opened up down to the level of the "Local" folder. Only the "master" branch should show up as your "Local".

...

  • Go to the Papyrus perspective by selecting  "Window"→"Perspective"→"Open Perspective"→ "Other..." on the top of your screen and then select "Papyrus".
  • This perspective should show a "Project Explorer" on the left side of the screen that looks like this:


  • You should see your newly created Eclipse/Papyrus project in the "Project Explorer" on the left side of the screen. (ignore the question mark, it shouldn't be there)


  • The text in light brown is telling you that your project is in the modelspec repository you just created, in the branch "master". Note that all model work is being performed in the "master" branch.
    • If you do not see the project in the "Project Explorer", probably you forget to check the box to import all existing Eclipse projects when cloning the model.
    • To fix this, switch to the Git perspective, select the repository name or the Working Tree, then right-click and select "
    . Note that all model work is being performed in the "master" branch
    • Import projects...".
  • If you open up the ONAP Information Model folder (click on the ">" to open/explore the Model), you will see:

...

  • Only approved model editors can update the working branch in Gerrit. To be a model editor you must undergo Papyrus training.
    • Current model editors for each submodel are specified here.
  • Once you have finished making your model changes, make sure you "save" them in Papyrus, by selecting "File→ Save", or select the Save icon.
  • If this is a first-time that you're updating the model, make sure that you first have set up the user information for Gerrit properly. See these instructions: ONAP Gerrit user setup in Eclipse
  • Next, go to the " Git " perspective to select the files you have changed and prepare them for uploading to Gerrit.Go to the Git perspective by selecting  "Window->Perspective→Open Perspective→Otherby selecting "Window"→"Perspective"→"Open Perspective"→"Other..." on the top of your screen and then select "Git".
  • Once in the Git Perspective, select the repository where you have changed the files.:
    Image Modified
  • Select the "Git Staging" tab in the lower right hand portion of your screen (it might also be on the right-hand side of your screen based on your layout)
    It looks like this: Image Modified with a little green down-arrow
  • You will see the files that you have changed in the "Unstaged changes". Note: If there is a file there that you did not intend to change, right-click on that file and select "Replace with HEAD revision". That will revert any unwanted changes you may have made.
  • STAGE CHANGES: Select the files that you did change, right-click and select "Add to index", Or, as a shortcut, you can select the little green "plus" sign that will add the files for you:

                     

  • The Git Staging window looks like this:
    Image Modified
  • after you hit the green "++" it looks like this:
    Image Modified
  • Once they have been added, they will show up in the "Staged Changes
  • COMMIT MESSAGE: Next you will need to prepare to "Commit and Push" your changes. Position your cursor in the "Commit Message" window
  • Add a commit message indicating the change you have done, i.e. "Added new diagram to service model" then carriage return twice so that you will have a blank line after your message.
  • You can then optionally add a more detailed message about the change.
  • JIRA TICKET: Next, you will have to associate the change to a JIRA ticket. Add on the line after the blank line:  Issue-ID: MODELING-104
  • Note that there is a blank between ":" and "M".  The JIRA ticket MODELING-104 is a general ticket for changes to the working branch.
  • Note that Git will generate a "Change id" for you, so you don't need to manually add one.
  • SIGNOFF (PENCIL) ICON: Then you will need to "Sign-off" on the change by selecting the "Sign-off" button. This is the "Pen" icon next to the "Commit Message". Select that icon

                   

  • Now you are ready to select "Commit and Push". This commits your local changes and pushes them to the remote Gerrit repository (which should be the working branch)
    Image Modified
  • Note that the "committer" above must correspond to the user name and email you have associated to your Gerrit account. If they don't, follow the instructions here: ONAP Gerrit user setup in Eclipse
  • After you hit the commit and push you will see this popup:
    Image Modified
  • Once your changes have been successfully committed and pushed to Gerrit, you will see the results:

                

  • This window display the Gerrit identifier (in this case 59893) associated to the change.
  • Next you will have to go to Gerrit at: gerrit.onap.org and login to Gerrit
  • You can then see the change you have made. Select that change. You will then need to "add" the name of the person to approve that change.
  • Approvers are Deng Hui together with the model owner, if you are updating a model for which you are not the owner.
    Image Modified


  • Once the change has been committed, you will receive an email confirmation of the commit.
  • Note: If your commit and push fails for any reason, once you have fixed the problem, you can resend the request by selecting the "Amend (Edit previous commit)" icon in the Commit Message bar.
    Image Modified

Recovering from a Failed Push to Gerrit

...