Continuous Integration with Feature Streams

by Stephen Worthington 27. April 2010 12:55

The 2010/1 release of PureCM was packed full with so many new features that it is easy to overlook some of the more important ones. So I wanted to focus on one of the new features I am really excited about – features.

Working with Features

 

To create a feature in PureCM open the Projects view, right-click a version and select ‘New Feature’.  From here you will specify the name of the feature and a description. You can see a video of this on the PureCM website.

To start working on the feature go to the My Workspaces view and select ‘Add Workspace’. You can select the feature from the Projects tab.

If you already have a workspace you can switch it to the new feature by selecting ‘Switch’ in the My Workspaces view. This will be very quick and will only change the files which are different.

This has created a new stream for the feature. So you can submit in this workspace without changing the version stream. This is great for checkpointing your code where you can submit incomplete/untested code without breaking everybody else’s workspace.

Having used features for a few months now this has really changed the way I work. I now submit every hour or so. This allows me to try something different safe in the knowledge that I can get back to my previous checkpoint if it doesn’t work out. After completing a piece of work I can also go to one of our testing machines, create/switch a workspace for the feature stream and run the acceptance tests. Only if the acceptance tests pass will I merge the feature changes back into version stream. And I have become more productive because while the acceptance tests are being run on the testing machine I can start working on my next feature.

When I am ready to merge all the feature changes back into the version stream I go to the My Tasks view. The feature is listed under ‘Pending Features’ and I can select ‘Complete’. 

 

 

This will launch the changeset dialog where I can review the edits and submit them as one changeset back into the version. The feature will also be complete – so will no longer appear in the Projects view.

 

Continuous Integration and Feature Streams

 

The simplicity of working with feature streams hides a very powerful aspect to PureCM features – they keep themselves up to date with the version stream. When another developer submits changes to the version stream the changes are automatically merged into your feature stream. So all you have to do is update your workspace.

So you get the best of both worlds. The changes you are making are isolated from other developers, so you can checkpoint your code. But the changes other developers make are being pulled into your feature.

The other advantage with keeping your feature up to date with the version is that merging the feature changes back into the version is trivial. You have already merged the version changes into the feature, so merging the feature changes back into the version is simply a matter of copying the files across.

There are occasions where another developer will submit changes to a file which you have already changed in your feature. This will create an update conflict which will appear in My Tasks and My Workspaces.

 

You can press ‘Resolve’ to launch the Resolve Tool to resolve the conflicts and merge the changeset into the feature.

Guidelines for using Features

As a rule of thumb we recommend you create a feature for any piece of work which takes longer than half a day.

·        Create a new feature

·        Shelve and revert your current changes

·        Switch the workspace to the feature

·        Unshelve the changes into the feature workspace

We are already working on making this process automatic.

Features do not support file locking. So if you cannot allow multiple developers to work on the same files concurrently then features are not appropriate. Cross-stream file locking is something we are hoping to implement for the 2010/2 release.

 

If a feature takes longer than a week then we recommend you perform interim submits back to the version. You can do this in the Project view by right-clicking the feature and selecting ‘Administration | Merged’. This will merge the changes without completing the feature. It is important not to isolate your feature changes from the version for too long if you want to practice continuous integration.

To get the full benefits of features you will need a Professional License. The Standard License will alow you create features but the features will not automatically keep up to date with the version.

Using tasks you can streamline the process of creating and working with features. Please refer to the PureCM Admin Guide for a full explanation of tasks and how they relate to features.

 

 

Tags: ,

Agile | Best practices | Parallel development

Comments

5/21/2010 9:18:25 AM #

SDC, Part 4: Branching patterns

SDC, Part 4: Branching patterns

PureCM Blog

Powered by BlogEngine.NET 1.6.0.0