Assign, Commit, and Review           A developer’s guide to           OpenStack contribution           Luo, Zhongyue      ...
TODO    Why contribute?    Terminologies    Overview    Prerequisites    Assign    Commit    Review    Summary2
Why contribute?    Tons of new requirements everyday when operating an IaaS     • New customers, competitors, regulations,...
Terminologies    Git     • github.com: Code repository     • git-review: The tool to submit code patches     • git commit ...
Overview                                                 git clone                                                        ...
Overview                              gets aggregated                                                                2    ...
Prerequisiteshttp://wiki.openstack.org/HowToContribute#If_you.27re_a_developer.2C_start_here:
Create Launchpad account    https://launchpad.net/+login    Also enables access to mailing list, wiki, gerrit, and jenkins8
Sign your CLA    Mandatory     • Individual Contributor License Agreement    Optional – done by your company     • Corpora...
Add your name to contributors wiki     http://wiki.openstack.org/Contributors     2                               (Individ...
Add your name to contributors wiki                                              3                                   2     ...
Join the openstack-cla team     https://launchpad.net/~openstack-cla/+join12
Add SSH public key to Gerrit     https://review.openstack.org                                    113
Add SSH public key to Gerrit     GitHubs guide to SSH keys     2          314
Install git-review     $ sudo pip install git-review15
Assign
Key takeaway     Ways to assign yourself work      1. Attend IRC meetings      2. Find bug reports on Launchpad      3. Ha...
Find out what others are having problems with     Start with low-hanging-fruit, Triaged     http://bugs.launchpad.net/${pr...
How to assign yourself a bug report     Find a unassigned one                             119
How to assign yourself a bug report     Not so simple with blueprints…                       220
Get involved in the community     Attend weekly IRC meetings      • Fastest way to find work      • Most effective way to ...
Write blueprint/bug reports of your own     Report new features/requirements you need     http://blueprints.launchpad.net/...
Commithttp://wiki.openstack.org/GerritWorkflow
Key takeaway     One code patch should      • be on one git branch      • be about one blueprint/bug report      • have a ...
Git commit message example                                                        Less than 50 char     Remove DB access f...
Send your code patch for review     Update the master branch and rebase your branch to master      • git checkout master  ...
Some tips for using Git     Git commands      • Everyday GIT With 20 Commands Or So     git-review options and functionali...
Some tips for writing Python code     Best Python tutorials – read every page      • http://docs.python.org/tutorial/index...
Review
Key takeaway     Take responsibility for your submits      • Respond professionally to your comments      • Not everyone l...
Replying to a comment     131
Replying to a comment                   4                       2                       332
Replying to a comment     533
Replying to a comment     6     734
Summary     Contribute code to have others contribute to you     Do the prerequisites     Get involved in the community an...
Assign, commit, and review - A developer’s guide to OpenStack contribution-2012osac-lzy
Upcoming SlideShare
Loading in …5
×

Assign, commit, and review - A developer’s guide to OpenStack contribution-2012osac-lzy

988 views
943 views

Published on

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
988
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
29
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Assign, commit, and review - A developer’s guide to OpenStack contribution-2012osac-lzy

  1. 1. Assign, Commit, and Review A developer’s guide to OpenStack contribution Luo, Zhongyue OpenStack APAC Conference, Shanghai August 11, 20121
  2. 2. TODO Why contribute? Terminologies Overview Prerequisites Assign Commit Review Summary2
  3. 3. Why contribute? Tons of new requirements everyday when operating an IaaS • New customers, competitors, regulations, and technology Always short of skill, budget, and time • Need help from community Obvious requirements are to be contributed • Someone is always smarter than you in someway  Contribute and gain respect • Have others pay attention to what you say3
  4. 4. Terminologies Git • github.com: Code repository • git-review: The tool to submit code patches • git commit message: Description of code change Launchpad (https://launchpad.net) • Bug tracker for OpenStack projects • Blueprint/Bug report: Description of a requirement/problem Gerrit (https://review.openstack.org) • Standalone patch review server for git projects Jenkins (https://jenkins.openstack.org) • Continuous integration system4
  5. 5. Overview git clone Your code patch e.g) git://github.com/openstack/nova git://github.com/openstack/quantum Your development git://github.com/openstack/cinder environment git://github.com/openstack/${project_name}5
  6. 6. Overview gets aggregated 2 openstack-ci ZUUL 4 1 reports runs tests git review Your 3 updates code patch 5 (link) Your development environment6
  7. 7. Prerequisiteshttp://wiki.openstack.org/HowToContribute#If_you.27re_a_developer.2C_start_here:
  8. 8. Create Launchpad account https://launchpad.net/+login Also enables access to mailing list, wiki, gerrit, and jenkins8
  9. 9. Sign your CLA Mandatory • Individual Contributor License Agreement Optional – done by your company • Corporate Contributor License Agreement • Update the list of authorized employees For more details • http://wiki.openstack.org/CLA9
  10. 10. Add your name to contributors wiki http://wiki.openstack.org/Contributors 2 (Individual CLA) EchoSign transaction number 110
  11. 11. Add your name to contributors wiki 3 2 1 || ${your_name} || ${launchpad_id} || [[https://rackspace.echosign.com/verifier?tx=${EchoSign_transaction_number} | ${EchoSign_transaction_number}]] || ${company_name} ||11
  12. 12. Join the openstack-cla team https://launchpad.net/~openstack-cla/+join12
  13. 13. Add SSH public key to Gerrit https://review.openstack.org 113
  14. 14. Add SSH public key to Gerrit GitHubs guide to SSH keys 2 314
  15. 15. Install git-review $ sudo pip install git-review15
  16. 16. Assign
  17. 17. Key takeaway Ways to assign yourself work 1. Attend IRC meetings 2. Find bug reports on Launchpad 3. Hack the source code How to write a blueprint • What is the current status? • How will your blueprint improve this situation? • What is the follow up? How to write a bug description • Write about WHAT the problem is17
  18. 18. Find out what others are having problems with Start with low-hanging-fruit, Triaged http://bugs.launchpad.net/${project_name}18
  19. 19. How to assign yourself a bug report Find a unassigned one 119
  20. 20. How to assign yourself a bug report Not so simple with blueprints… 220
  21. 21. Get involved in the community Attend weekly IRC meetings • Fastest way to find work • Most effective way to have presence • #openstack-meeting on irc.freenode.net • http://wiki.openstack.org/Meetings Subscribe to the mailing lists • Find out the current issues in OpenStack • http://wiki.openstack.org/MailingLists21
  22. 22. Write blueprint/bug reports of your own Report new features/requirements you need http://blueprints.launchpad.net/${project_name}22
  23. 23. Commithttp://wiki.openstack.org/GerritWorkflow
  24. 24. Key takeaway One code patch should • be on one git branch • be about one blueprint/bug report • have a decent git commit message Git commit message should • consist of title, [blueprint/bug link], description • align with the blueprint/bug description • align with fixes done on your code patch How to write a git commit message • Write about HOW and WHY you fixed the source code Code patches must be submitted by git-review24
  25. 25. Git commit message example Less than 50 char Remove DB access from Fixes console/vmrc_manager.py compute import error Implements bp no-db-compute Fixes bug #1028748 The description of a blue print The description of a bugfix should be placed here should be placed here25
  26. 26. Send your code patch for review Update the master branch and rebase your branch to master • git checkout master • git fetch origin • git pull origin master • git checkout ${your_branch} • git rebase –i master You absolutely must run unittests before submission! • Run “./run_tests.py” Use git-review to submit code patch • git checkout ${your_branch} • git review26
  27. 27. Some tips for using Git Git commands • Everyday GIT With 20 Commands Or So git-review options and functionalities • git review –-help More details about git • man git27
  28. 28. Some tips for writing Python code Best Python tutorials – read every page • http://docs.python.org/tutorial/index.html • http://docs.python.org/library/index.html PEP8 • Read it once everyday till you memorize all examples HACKING.rst • Coding conventions for OpenStack projects • Placed in base directory of every project • Built upon PEP828
  29. 29. Review
  30. 30. Key takeaway Take responsibility for your submits • Respond professionally to your comments • Not everyone lives on the same timezone When your not sure • you understand a comment, ask anyone via IRC • about your code, find help for review via IRC How to download a patch to your local machine $ git review –d 1077430
  31. 31. Replying to a comment 131
  32. 32. Replying to a comment 4 2 332
  33. 33. Replying to a comment 533
  34. 34. Replying to a comment 6 734
  35. 35. Summary Contribute code to have others contribute to you Do the prerequisites Get involved in the community and assign work to yourself Write formal git commit message with your patch Respond professionally to your review comments35

×