Your SlideShare is downloading. ×
How Mahara code revision works
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

How Mahara code revision works

2,059
views

Published on

Mahara started to use Gerrit code revision system recently. All proposed changes to master branch of the project now go through the compulsory revision process that requires approval of the change by …

Mahara started to use Gerrit code revision system recently. All proposed changes to master branch of the project now go through the compulsory revision process that requires approval of the change by the other developers. Adding this revision step in the code committing workflow improves the quality of the committed code and team awareness about the changes and new features. It allows absolutely anyone to contribute to Mahara by committing the patch or new feature directly to the code revision system, getting feedback from the core developers and other people and participate in code revision themselves. Making participation in development process simpler could attract more people to Mahara developers’ community and make Mahara better.
The presentation will demonstrate how code revision works. It will display the whole way of the patch from creation on developer’s local system to the merge into master branch through revision and validation. The presentation will cover how to use Gerrit interface, best practices in revision system use, as well as most common scenarios that may occurs during revision process.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,059
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • As you know Mahara uses Git.
  • Now and then. Details of the workflow. Before the contribution was done through patch submission over email to core developers team, after a while when developer gained some reputation, the main repository commit permission was granted. Thus only core developers were able to push changes to the main repo.
  • On Mahara-dev meeting in February, Francois suggested to try using gerrit for code revision.Essentially gerrit revision system is intermediate step on the way of the patch between the master repository and your local branch. It is a web-based collaborative tool for code revision that works with Git. Gerrit was originally a patch-set to Rietveld (subversion) designed for facilitating code revision in Android project. From git perspective, gerrit is just another remote branch which one can push changes (thanks to git distributed version control).
  • Once the change is pushed, it is being shown on Gerrit web-interface. After the change has been revised and verified it is being merged into main repo automatically by gerrit. Permissions to push directly to the main repository has been revoked from everyone.
  • Accept contributions from members of Mahara community more easy.Anybody can submit the change, get feedback from core developers and participate in revision. Just get an account, push your change and get feedback right on the gerrit web-interface.No need to have special rightsCreate get account, set up tools and submit the bug-fix or the feature
  • Time to show gerrit interface. List of chnages.Sections. Change-id. Patchsets. Dependencies. Tags. Merged and Abandoned changes.Handy documentation. (search commands:) commit: change: owner:
  • PushReviewChange and pushReviewVerifyApprove
  • Fixing, pushing,
  • Thank you
  • Transcript

    • 1. Mahara UK 2011 – Technical Workshop21st June 2011
    • 2. How Mahara code revision works
      Ruslan Kabalin
      Mahara UK, 21nd June 2011
    • 3. Plan for the next 30 minutes
      • Where Mahara code is located
      • 4. Old patch submission workflow
      • 5. Gerrit code revision system
      • 6. Why do we need to review the code
      • 7. Revision process
      • 8. Live demo
      • 9. Concluding remarks
    • Mahara main repository
      http://gitorious.org/mahara/mahara
      (Image from https://launchpad.net/mahara/+series)
    • 10. How revision was done before
      Change is reviewed and pushed to master
      Change is mailed
      to core developers
      • Patch was submitted using email to the core developers
      • 11. Core developers reviewed and responded with proposed changes
      • 12. Only core developers could push changes to master repo.
      • 13. Those who gained reputation became core developers with push permission
      Change appears on master repo
    • 14. Limitations of the old workflow
      • Complicated workflow
      • 15. Takes time
      • 16. No one reviews core developers’ patches
      • 17. Contributors do not feel involved
    • Gerrit code revision system
      • Intermediate step between master and your local branch
      • 18. Web-based collaborative code revision tool
      • 19. All changes go through revision
      • 20. Revision and verification are required
      • 21. Only Gerrit can push directly to master
      • 22. For your git repo it is just another remote branch*
      * git remote add gerrit ssh://user@reviews.mahara.org:29418/mahara
    • 23. Gerrit simplified workflow
      Change is pushed
      to gerrit repo
      Change appears on
      revision interface
      Change is being reviewed
      Change needs to be updated and resubmitted
      Change is merged to main repo
      Reviewed & verified?
      Yes
      No
    • 24. Reasons for code review
      • Improve the quality of the code
      • 25. Mentor each other
      • 26. Learning from others
      • 27. Improve security
      • 28. Remove old code
      • 29. Team awareness about project
      • 30. Attract more developers
    • Open to everyone!
      • Anybody can submit the change for revision*
      • 31. No specials rights are required
      • 32. Anybody can review someone’s patches
      • 33. Active contributors with good reputation will become core developers
      * Just do some initial dev tools set up: https://wiki.mahara.org/Developer_Area/Developer_Tools
    • 34. Revision process
      • Change needs to be both revised and verified before being merged into master
      • 35. Anybody can do revision (add revision points)
      • 36. Only Gerrit reviewers (core developers) can mark the change as verified
    • Gerrit code revision system
      Gerrit Web Interface
      https://reviews.mahara.org
    • 37. Pushing your changes
      • Set up dev environment
      https://wiki.mahara.org/Developer_Area/Contributing_Code
      • Push your change:
      git push gerritHEAD:refs/for/master
      • Wait for revision of your change patch-set...
      • 38. If not approved, amend the change accordingly and push again (preserve same Change-Id)
      • 39. Wait for revision of your second change patch-set...
      • 40. Update tracker if applicable once the change is merged
    • Live demo
      Let’s fix the bug!
      https://bugs.launchpad.net/mahara/+bug/799768
    • 41. Best practices
      • If you want to merge a big feature, break it down into lots of smaller ones (maybe dependencies first, etc.)
      • 42. When pushing patches that are related, use a Gerrit tag
      • 43. Every new patch should be applied on top of the clean checked-out branch to avoid adding dependencies in error
      • 44. When reviewing a series of related patches, keep in mind that the patches after the first rejected one will need to be reviewed again
      From the April IRC dev meeting: http://meetbot.mahara.org/mahara-dev/2011/mahara-dev.2011-04-20-19.40.html
    • 45. Further information
      • Developer tools setup: https://wiki.mahara.org/Developer_Area/Developer_Tools
      • 46. Contributing the code: https://wiki.mahara.org/Developer_Area/Contributing_Code
      • 47. Discussion on the IRC meeting: http://meetbot.mahara.org/mahara-dev/2011/mahara-dev.2011-04-20-19.40.html
      • 48. Mahara code revision system:
      https://reviews.mahara.org
    • 49. Questions?
    • 50. Thank you!
      @rkabalin
      Ruslan Kabalin <ruslan.kabalin@luns.net.uk>