Submit your first OpenStack patch in 3 steps.

admin Open Source, OpenStack

If you are new to OpenStack Community and want to start the contribution, this document can help you in a quick way. OpenStack does not use github pull request instead it uses Gerrit for code collaboration tool. Also, there is some accounts setup required for using the Gerrit system. This guide will quickly help you to set up those accounts and the minimal steps

  Step1: Set up accounts

To get started, first set up the required accounts.

  • Setup OpenStack Foundation Account.

    • Go to the OpenStack Foundation sign up page.
    • Under individual members, click the Foundation Member button.
    • Few tips for filling the form:
      • Use the same e-mail address at every step of the registration procedure.
      • Add your affiliation information if you want otherwise you are contributing on behalf of your  ‘Individual Contributors’.
  • After you submit the application, you will get the email once it is approved.
  • Setup Your Task Tracker Account

    • Go to the https://login.launchpad.net/.
    • If you don’t have a ubuntu One Account, click the I don’t have an Ubuntu One account.
      • Use the same email address that was used during the OpenStack Foundation account setup.
    • Fill all information and ‘Create Account’.

  • Install git:

    • Mac OS
      • Go to the Git download page and click Mac OS X.
      • The downloaded file should be a dmg in your downloads folder. Open that dmg file and follow the instructions on screen.
      • If you use the package manager Homebrew, open a terminal and type:
        brew install git
    • Linux
      • For distributions like Debian, Ubuntu, or Mint open a terminal and type:
            sudo apt install git
      • For distributions like RedHat, Fedora 21 or earlier, or CentOS open a terminal and type:
            sudo yum install git
      • For Fedora 22 or later open a terminal and type:
            sudo dnf install git
      • For SUSE distributions open a terminal and type:
            sudo zypper in git
    • Configure Git
            git config --global user.name "Firstname Lastname"
            git config --global user.email "your_email@youremail.com"
      • Use the same email address that was used during the OpenStack Foundation account setup.
  • Setup Your Gerrit Account

    • Visit OpenStack’s Gerrit page and click the sign in link.
    • You will be prompted to select a username. Choose and type your username carefully. Once it is set, you cannot change the username.
    • From here on out when you sign in to Gerrit, you’ll be prompted to enter your Launchpad login info. This is because Gerrit uses it as an OpenID single sign on.
    • Sign Individual Contributor License Agreement. If you want to contribute from company then ask your company to sign the Company CLA.
      • In Gerrit’s settings click the “New Contributor Agreement” link and sign the agreement.

  • Setup SSH Keys

    • In order to push patches to Gerrit we need to have a way to identify ourselves and ssh key is the one way to authenticate. You can submit patches from any machine but you need to update the ssh key of that machine.
    • Generate SSH Key Pairs
         ssh-keygen -t rsa
    • Copy Public Key
        cat ~/.ssh/id_rsa.pub
    • Add Public Key Into Gerrit

  • Install git-review tool

    • pip install gitreview
    • git config global gitreview.username <username>

  Step2: Push your change

  • Clone the repository.

    • Clone the repo which you want to push the changes:
        git clone https://opendev.org/openstack/<PROJECT_NAME>

                    Here you can find all the OpenStack projects and repo under those projects.

  • Create your local branch to do the changes

    git checkout -b <branch_name>
  • Do the changes in code and perform all required unit or functional tests.

    • To check the files that have been updated in your branch:
        git status
  • Add your changes to the branch

    git add -A

  • Write commit changes

    git commit
    or 
    git commit --amend (if you are ammending the previously written commit msg)
  • Submit your changes

    git review
  • Tracking your Changes

    • You can track the submitted changes at Code Review. After logging in, click on ‘My’ then ‘Changes’ and there you can see all your changes.

  Step3: Practice the above steps using Sandbox Project

To make sure everything is set up correctly or to understand the workflow without trying it on actual projects, you can practice in a Sandbox using the How to Use the Sandbox Projects Guide. Sandbox project is just for practice so do not hesitate or worry about anything.

For more details on OpenStack community contributor, please refer to The OpenStack Contributor Guide or ping me on IRC (#openstack-dev or openstack-upstream-institute channels), I am available with ‘gmann’ nickname.

You May Also Like..

OpenStack Ussuri is Python3-Only: Upgrade Impact

    A brief history of Python2 -> Python3: Python version 2.0 was officially released in 2000, OpenStack was founded […]

OpenInfra Day Veitnam: Technical Committee highlights and different missions teams in Upstream

Open Infra day Vietnam was held in Hanoi in Aug 2019. I and Rico lin talked about the current activities […]

Recap of Open Infrastructure Summit & PTG, Shanghai 2019

Open Infrastructure Summit, Shanghai 2019 Open Infrastructure Summit followed by OpenStack PTG was held in Shanghai, China: 4th Nov 2019 […]

Leave a Reply

Your email address will not be published. Required fields are marked *