Created by: Maria Abrahms Modified Date: Classification: How to get it done Contributing to OpenStack
Get a Launchpad account Join the OpenStack foundation Install Git Set up Git Config Install Git Review www.rackspace.com 2 How do I get Started with OpenStack?
Getting Set up for OpenStack www.rackspace.com 3
Go to https: bugs.launchpad.net –https://bugs.launchpad.net/openstack-manuals : Installation, administration, configuration, and user guideshttps://bugs.launchpad.net/openstack-manuals –https://bugs.launchpad.net/openstack-api-site : API Quick Start Guides and API referencehttps://bugs.launchpad.net/openstack-api-site For a comprehensive list of OpenStack content, see https://wiki.openstack.org/wiki/Documentation Finding an OpenStack bug www.rackspace.com 4
1.Locate the source file. In most cases, the bug should say which source file is affected by the change request. 2.Ensure that you have the appropriate GitHub repo cloned to your computer, if not, clone it to your local computer. 3.Install the Git commit message hook. This ensures that the Git Commit change- id automatically gets inserted into your commit message. 4.Open the file (.xml extension) in Oxygen and make the changes. Steps to fix a bug www.rackspace.com 6
Check the git status by typing git status in a terminal window, in the appropriate git directory (the repo you cloned). The file you modified will appear. Add the file that was modified by typing git add Commit the change by typing: commit –a “commit message”. If you have the Git commit message hook installed, the change-id will automatically be added to your commit message. Submitting your changes to Gerrit www.rackspace.com 9
If you need to make changes to your commit or if you don’t have the commit message hook installed, amend the existing commit message by typing: git commit --amend Save the commit message and exit the text editor by hitting esc and typing :wq Type git review. If you have done everything right, this command will push your changes to Gerrit and create a new code review number (CR) for review.openstack.org. Write down the code review number that is returned so you can check the progress of your CR. Submitting your changes – part 2 www.rackspace.com 11
First, read the following article: https://wiki.openstack.org/wiki/GitCommitMessages Here are the rules: Commit title can be no more than 50 characters No periods are allowed in commit titles. There must be an extra line between the commit title and commit message. Any lines in the commit message must break at 72 characters. Add the number of the bug you’re resolving in the commit message. The change-id must be at the very end of the commit message. Tips for a successful commit message www.rackspace.com 12
This is what your CR looks like in Gerrit www.rackspace.com 13
Your CR fails to pass the gateway tests Your code (content) contains extra whitespace or tabs Your commit message fails to pass the gateway tests Etc…… Things that can go wrong www.rackspace.com 14
TOX is there to help you 16 www.rackspace.com TOX helps identify build verification errors before you submit your content.
Who will review my content? 17 www.rackspace.com Use the Add Reviewer option to add reviewers Any reviewers you add will be notified by email.
After you have submitted your CR, you may not immediately get traction. Here are some tips and tricks on how you can get your CR reviewed: Get on the IRC channel for your project and spread the news about your CR being available. For more information, see Programs.Programs Attend weekly team meetings for your OpenStack project. Manually add a reviewer through the Gerrit UI. Offer to do OpenStack reviews yourself. Tips to get your CR reviewed www.rackspace.com 18
If the master repository has changed since you started your work, you should rebase your changes to the current state. To rebase, type the following commands git checkout master git pull origin master git checkout TOPIC-BRANCH git rebase -i master When he commit history in your branch looks correct, run git review to submit your changes to Gerrit. Rebasing your CR www.rackspace.com 22
Managing multiple dependent CRs 23 When you want to start new work that is based on the commit under the review, you can add the commit as a dependency.
Gerrit supports an edit mode which lets you edit multiple dependent CRs then push them up for review all at once. Using the edit mode is the easiest way to update multiple CRs at the same time. Updating multiple dependent CRs www.rackspace.com 24
Abandoning a CR 25 www.rackspace.com There may be situations where you need to abandon a CR. Review.openstack.org lets you abandon a change through the UI: Go to review.openstack.org/. Expand the latest patch set for your CR. Click Abandon Change. Under Abandon Message, type a reason for why are abandoning this CR. Click Abandon Change. Gerrit will archive abandoned changes so you can access them in the future.