{"id":8976,"date":"2020-06-22T13:31:23","date_gmt":"2020-06-22T18:31:23","guid":{"rendered":"https:\/\/www.openstack.org\/blog\/?p=8976"},"modified":"2020-06-25T16:28:08","modified_gmt":"2020-06-25T21:28:08","slug":"submit-your-first-openstack-patch-in-three-steps","status":"publish","type":"post","link":"https:\/\/www.openstack.org\/blog\/submit-your-first-openstack-patch-in-three-steps\/","title":{"rendered":"Submit your first OpenStack patch in three steps"},"content":{"rendered":"\n<p class=\"lead\">If you are new to the 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&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Gerrit_(software)\">Gerrit<\/a>&nbsp;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.<\/p>\n\n\n<p><!--more--><\/p>\n\n\n<h2><strong>Step1: Set up accounts<\/strong><\/h2>\n\n\n\n<p>To get started, first set up the required accounts.<\/p>\n\n\n\n<h4><strong>Set up your OpenStack Foundation account<\/strong><\/h4>\n\n\n\n<ul><li>Go to the&nbsp;<a href=\"https:\/\/www.openstack.org\/join\">OpenStack Foundation sign up page<\/a>.<\/li><li>Under individual members, click the&nbsp;<strong>Foundation Member<\/strong>&nbsp;button.<\/li><li>Few tips for filling the form:Use the same e-mail address at every step of the registration procedure.<\/li><li>Add your affiliation information if you want otherwise you are contributing on behalf of your&nbsp; \u2018Individual Contributors\u2019.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"325\" src=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member-1024x325.png\" alt=\"\" class=\"wp-image-8977\" srcset=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member-1024x325.png 1024w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member-300x95.png 300w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member-768x243.png 768w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member-1536x487.png 1536w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/individual-member.png 1666w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After you submit the application, you will get an email once it is approved.<\/p>\n\n\n\n<h4><strong>Set up your Task Tracker account<\/strong><\/h4>\n\n\n\n<ul><li>Go to the&nbsp;https:\/\/login.launchpad.net\/.<\/li><li>If you don\u2019t have a ubuntu One Account, click the&nbsp;<strong>\u201c<\/strong>I don\u2019t have an Ubuntu One account<strong>\u201c<\/strong>.<ul><li>Use the same email address that was used during the OpenStack Foundation account setup.<\/li><\/ul><\/li><li>Fill all information and \u2018Create Account\u2019.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"924\" src=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/TaskTracker-1024x924.png\" alt=\"\" class=\"wp-image-8979\" srcset=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/TaskTracker-1024x924.png 1024w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/TaskTracker-300x271.png 300w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/TaskTracker-768x693.png 768w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/TaskTracker.png 1201w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4><strong>Install Git<\/strong><\/h4>\n\n\n\n<p>Use the same email address that was used during the OpenStack Foundation account setup.<\/p>\n\n\n\n<p><strong>Mac OS<\/strong><\/p>\n\n\n\n<ul><li>Go to the Git&nbsp;download page&nbsp;and click&nbsp;Mac OS X.<\/li><li>The downloaded file should be a dmg in your downloads folder. Open that dmg file and follow the instructions on screen.<\/li><li>If you use the package manager&nbsp;Homebrew, open a terminal and type: <code>brew install git<\/code><\/li><\/ul>\n\n\n\n<p><strong>Linux<\/strong><\/p>\n\n\n\n<ul><li>For distributions like Debian, Ubuntu, or Mint open a terminal and type: <code>sudo apt install git<\/code><\/li><li>For distributions like RedHat, Fedora 21 or earlier, or CentOS open a terminal and type: <code>sudo yum install git<\/code><\/li><li>For Fedora 22 or later open a terminal and type: <code>sudo dnf install git<\/code><\/li><li>For SUSE distributions open a terminal and type: <code>sudo zypper in git<\/code><\/li><\/ul>\n\n\n\n<p><strong>Configure Git<\/strong> <\/p>\n\n\n\n<p><code>git config --global user.name \"Firstname Lastname\"<\/code><br><code>git config --global user.email \"your_email@youremail.com\"<\/code><\/p>\n\n\n\n<h4><strong>Setup Your Gerrit Account<\/strong><\/h4>\n\n\n\n<ul><li>Visit&nbsp;<a href=\"https:\/\/review.opendev.org\/\">OpenStack\u2019s Gerrit page<\/a>&nbsp;and click the&nbsp;sign in&nbsp;link.<\/li><li>You will be prompted to select a username. Choose and type your username carefully. Once it is set, you cannot change the username.<\/li><li>From here on out when you sign in to Gerrit, you\u2019ll be prompted to enter your Launchpad login info. This is because Gerrit uses it as an OpenID single sign on.<\/li><li>Sign Individual Contributor License Agreement. If you want to contribute from company then ask your company to sign the Company CLA.<ul><li>In Gerrit\u2019s&nbsp;<a href=\"https:\/\/review.opendev.org\/#\/settings\/agreements\">settings<\/a>,&nbsp;click the \u201cNew Contributor Agreement\u201d&nbsp;link and sign the agreement.<\/li><\/ul><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"930\" height=\"492\" src=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/Gerrit.png\" alt=\"\" class=\"wp-image-8982\" srcset=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/Gerrit.png 930w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/Gerrit-300x159.png 300w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/Gerrit-768x406.png 768w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/figure>\n\n\n\n<p>Setup SSH Keys<\/p>\n\n\n\n<ul><li>In order to push patches to&nbsp;<a href=\"https:\/\/review.opendev.org\/\">Gerrit<\/a>&nbsp;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.<\/li><li>Generate SSH Key Pairs: <code>ssh-keygen -t rsa<\/code><\/li><li>Copy Public Key:    <code>cat ~\/.ssh\/id_rsa.pub<\/code><\/li><li>Add Public Key Into GerritGo to&nbsp;<a href=\"https:\/\/review.opendev.org\/#\/settings\/ssh-keys\">Gerrit\u2019s SSH Public Keys settings<\/a>.<\/li><li>Click the \u2018Add Key\u2019 button.<\/li><li>Paste the public key into the&nbsp;<strong>Add SSH Public Key<\/strong>&nbsp;text box and click&nbsp;<strong>Add<\/strong>.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"700\" src=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/ssh-key-1024x700.png\" alt=\"\" class=\"wp-image-8983\" srcset=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/ssh-key-1024x700.png 1024w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/ssh-key-300x205.png 300w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/ssh-key-768x525.png 768w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/ssh-key.png 1519w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4><strong>Install git-review tool<\/strong><\/h4>\n\n\n\n<ul><li>pip&nbsp;install&nbsp;git\u2013review<ul><li>If you don\u2019t have pip installed already, follow the&nbsp;<a href=\"https:\/\/pip.pypa.io\/en\/stable\/installing\/#installing-with-get-pip-py\">installation documentation<\/a>&nbsp;for pip.<\/li><\/ul><\/li><li>git&nbsp;config&nbsp;\u2014global&nbsp;gitreview.username&nbsp;&lt;username&gt;<\/li><\/ul>\n\n\n\n<h2><strong>Step 2: Push your change<\/strong><\/h2>\n\n\n\n<p><strong>Clone the repository<\/strong><\/p>\n\n\n\n<ul><li>Clone the repo which you want to push the changes: <code>git clone https:\/\/opendev.org\/openstack\/&lt;PROJECT_NAME&gt; <\/code><\/li><li><a href=\"https:\/\/governance.openstack.org\/tc\/reference\/projects\/\">Here<\/a>&nbsp;you can find all the OpenStack projects and repo under those projects.<\/li><\/ul>\n\n\n\n<p><strong>Create your local branch to do the changes<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>    git checkout -b &lt;branch_name&gt;\n<\/code><\/pre>\n\n\n\n<p><strong>Do the changes in code and perform all required unit or functional tests<\/strong><\/p>\n\n\n\n<ul><li>To check the files that have been updated in your branch: <code>git status<\/code><\/li><\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><code>    git add -A<\/code><\/p>\n\n\n\n<p><strong>Write commit changes<\/strong><\/p>\n\n\n\n<p>Refer to&nbsp;<a href=\"https:\/\/docs.openstack.org\/contributors\/common\/git.html#commit-messages\">this document<\/a>&nbsp;for the commit message format and tips.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code> git commit\n<\/code>    or <code>\n    git commit --amend (if you are ammending the previously written commit msg)<\/code><\/pre>\n\n\n\n<p><strong>Submit your changes<\/strong><\/p>\n\n\n\n<p><code>git review<\/code><\/p>\n\n\n\n<p><strong>Tracking your changes<\/strong><\/p>\n\n\n\n<p>You can track the submitted changes at&nbsp;<a href=\"https:\/\/review.opendev.org\/\">Code Review<\/a>. After logging in, click on \u2018My\u2019 then \u2018Changes\u2019 and there you can see all your changes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"323\" src=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes-1024x323.png\" alt=\"\" class=\"wp-image-8984\" srcset=\"https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes-1024x323.png 1024w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes-300x95.png 300w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes-768x242.png 768w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes-1536x484.png 1536w, https:\/\/www.openstack.org\/blog\/wp-content\/uploads\/2020\/06\/my-changes.png 1671w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2><strong>Step3: Practice the above steps using Sandbox Project<\/strong><\/h2>\n\n\n\n<p>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&nbsp;<a href=\"https:\/\/docs.openstack.org\/contributors\/code-and-documentation\/sandbox-house-rules.html\">How to Use the Sandbox Projects<\/a>&nbsp;Guide. Sandbox project is just for practice so do not hesitate or worry about anything.<\/p>\n\n\n\n<p>For more details on OpenStack community contributor, please refer to&nbsp;<a href=\"https:\/\/docs.openstack.org\/contributors\/index.html\">The OpenStack Contributor Guide<\/a>&nbsp;or ping me on IRC (#openstack-dev or openstack-upstream-institute channels), I am available with \u2018gmann\u2019 nickname.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are new to the 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&nbsp;Gerrit&nbsp;for code collaboration tool. Also, there is some accounts setup required for using the Gerrit system. This guide will quickly help you to&#8230;  <a href=\"https:\/\/www.openstack.org\/blog\/submit-your-first-openstack-patch-in-three-steps\/\" class=\"more-link\" title=\"Read Submit your first OpenStack patch in three steps\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":93,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/posts\/8976"}],"collection":[{"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/users\/93"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/comments?post=8976"}],"version-history":[{"count":10,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/posts\/8976\/revisions"}],"predecessor-version":[{"id":8993,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/posts\/8976\/revisions\/8993"}],"wp:attachment":[{"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/media?parent=8976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/categories?post=8976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.openstack.org\/blog\/wp-json\/wp\/v2\/tags?post=8976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}