Team Development

From PHPDevShell

Jump to: navigation, search

Contents

Beginning

Before you start, learn more by reading and understand this https://help.launchpad.net/Code It is very important that you go through the above pages, it is short and to the point like everything else in Launchpad. Don't you just love the Canonical Developers.

The combination of Bazaar branch hosting and Launchpad's teams infrastructure gives you a very powerful capability to collaborate on code. Essentially, you can push a branch into a shared space and anyone on that team can then commit to the branch.

This means that you can use Bazaar in the same way that you would use something like SVN, i.e. centrally hosting a branch that many people commit to. You have the added benefit, though, that anyone outside the team can always create their own personal branch of your team branch and, if they choose, upload it back to Launchpad.

However, Bazaar is flexible enough that you can choose your own workflow.

Ready to start working

For the next chapter you need to understand this https://help.launchpad.net/Code/TeamBranches

PHPDevShell uses the "Decentralised with shared main line" module to share code.

This is a simple method allowing you to work locally and when you have a stable piece of code you can merge it back into the main team branch, when the rest of the team updates they will find that PHPDevShell is still running with your updates included.

Note : Bazaar allows you to push the same branch to any repository in your personal account or the PHPDevShell team account.

Assuming you just started first look at what branch is the latest team branch being worked on here https://code.launchpad.net/~phpdevshell see the highest version number and use this branch. When clicking on the branch link it will show you what the commands are to pull and push this particular branch, in this case:

bzr branch lp:~phpdevshell/phpdevshell/vx.x.x

You can pull this branch into multiple directories allowing to push to experimental, development, main branch etc. making sure that the main branch, in this case "release-x.x.x" is always running code, meaning that PHPDevShell still works with this code.

To recap, I have created the following local directories for myself doing "bzr branch lp:~phpdevshell/phpdevshell/vx.x.x" in each directory, this will be used in the examples below; /experimental [experimental tests] /development [running code to merge into team development branch release-x.x.x] /projects [private projects I run on phpdevshell] /extra_whateva_folders

Scenario Examples

First and something important to NOTE

Always keep your local work up to date with the latest team branch, doing this will prevent major conflicts and assure that everyones code is compatible. When you do a merge the merge will be done locally, so do not be scared to do it.

In all scenarios you should always first merge latest development repository changes into your local development folders if it was not a freshly pulled branch;

brz commit -m "My new changes blah, blah..."
bzr merge lp:~phpdevshell/phpdevshell/vx.x.x

Now everything is merged in your code locally, when you are ready to push the merged code back into the development "release-x.x.x" branch do;

brz commit -m "My new merged code"
bzr push lp:~phpdevshell/phpdevshell/vx.x.x

Now the team branch is merged with your code available to everyone.

If you found that bad correspondence made more then 1 person work on the same lines of code, you will find conflicts, either ask the team project leader to resolve these conflicts or resolve it by;

Getting down to business

Handling new team development changes locally for "official" team repository.

Working in your "development" folder you have made working team changes and you are ready to push this into the team branch "release-x.x.x", follow above example #Scenario Examples exactly to achieve this.

Experimental Code for possible implementation

You want to try something new for PHPDevShell, which could either be a disaster or could end up as official code. So working in your "experimental" folder you do those changes.

  1. While working you could push this to any branch auto registering that branch:
bzr push lp:~phpdevshell/phpdevshell/experiment/vx.x.x

or push it to you own private repos

bzr push lp:~username/phpdevshell/experiment/vx.x.x

If you see it did not you don't have to do anything else, if it did work simply merge this experimental folder with the latest team development repository "release-x.x.x" by following the example #Scenario Examples.

Know your flexibility

Because Bazaar is so flexible, and allows you to push the same local directory to any remote location without registering it for example :

bzr push lp:~username/+junk/just-a-test

You do not have to stick tot the rules, you can have your own main branch kept up to date from the team "experiment-x.x.x" branch with your code changes added daily, then when you are ready some day you can request it to be merged, or if you are a team developer you can merge it yourself and no conflicts will exist.

The ONE thing to REMEMBER

Keep your local development folder up to date with the remove team development repository!

BZR Authentication problems

If you experience any connection or authentication problems and you have done the required steps in Launchpad. If the errors looks something like below:

sudo bzr push lp:~phpdevshell/phpdevshell/v2.8.2
Permission denied (publickey).                                                 
bzr: ERROR: Connection closed: please check connectivity and permissions 

Try doing this;

bzr launchpad-login username
bzr push bzr+ssh://username@bazaar.launchpad.net/~phpdevshell/phpdevshell/v2.8.2