Submitting patches and features

From OpenPetra Wiki
Revision as of 10:16, 3 January 2012 by Pokorra (talk | contribs) (changes to use Launchpad instead of own server)
Jump to navigation Jump to search

Where Contributions to Our Code Base Go To

The openPETRA source code is managed with the Bazaar source code versioning system. The official repository of openPETRA can be browsed here: http://code.openpetra.org.


How We Handle Contributions to Our Code Base

  • Write permissions to head/trunk are given only to the core members of the development team, just to keep the project on one track.
    • We very much need your contributions though, and we will aim to quickly deal with requests from developers who want to submit patches and code!
  • We accept contributions from non-core members of the development team only in a Launchpad branch.
    • You can create your own branch on Launchpad for each feature and for each bug you are working on.

See Submitting patches and features#Workflow for Contributions below for the actual workflow involved.


Initial Setup for Contributing

The contributor (=you) needs to have an account on the Launchpad website, as we host the openPETRA Bazaar repository on that server.

Please follow the instructions at How to work with bazaar on the command line or How to work with bazaar through the GUI on Windows to get an account at Launchpad and to create the SSH keys and to upload the SSH key to Launchpad.

Workflow for Contributions

  1. A Bug needs to be created for every single contribution if there isn't already a bug for it (the bug can also be marked as 'Feature' if it is a feature and not a bug!). Anyone who has a sourceforge.net account can do that.
  2. A new Branch needs to be created on the Bazaar server. Its name includes the bug number and a shortened title (examples can be found here).
    1. See Create a new branch for details how to create a new branch
      1. Only You will have write access to this branch
      2. Everybody else can see that this branch exists and has read-only access to it
  3. You can work on the branch until the the bug is fixed or a new feature is implemented.
    1. Be sure to do frequent 'rebases'/'merges' from the openPETRA trunk to ensure that you have changes that are done in trunk and that your code still compiles against it.
    2. You can commit changes to your branch at any time.
      1. We encourage you to commit your changes to your branch frequently.
      2. Commit your own changes to your branch before doing a rebase/merge. In that way your changes are kept in separate commits from the changes that others did.
      3. Commit the changes that came in through a rebase/merge to your branch immediately after doing a rebase/merge. In that way changes that others did (in trunk) are kept in separate commits from your changes.
  4. Once you are done with your bug fix or implementation of a feature:
    1. Do a last 'rebase'/'merge' from the openPETRA trunk to ensure that you have changes that are done in trunk and that your code still compiles against it.
    2. Run Unit tests which you might have created in the process (or which already exist and cover your code change) after the last 'rebase'/'merge'.
    3. Make a request to the core development team members to review your changes and to merge your changes to the openPETRA head/trunk.
      1. Ask for that in the openPETRA IRC chat or in the openPETRA Developer Forum, mentioning the Bug Number. You can also use the functionality on the Launchpad website for proposing a merge for the branch.
  5. Once your contribution has been reviewed and it got approved, the changes from your developer branch will be merged into the offical openPETRA trunk by a core developer. You will be informed once this has happened.
  6. You are ready for another contribution ;-)