Mike MacDonagh's Blog

Somewhere in the overlap between software development, process improvement and psychology

Advanced RTC SCM Streaming – Part 2 Parallel branched development

Basic usage of RTC Jazz SCM is easy enough but there’s what about more advanced usage? Using streams to isolate development from integration? Cross-project component reuse? Parallel branched development? This is the guide for that stuff.

Feel free to contact me with questions or just use the comments section below – I can also offer RTC Masterclasses covering this stuff and more.

This blog is in three parts:

  1. Development, Integration and Release Streams
  2. Streams for parallel branched development
  3. Streams for component reuse

Part 1 also covers the introduction and overall conclusions

Change set based SCM systems like git (SimpleGit)and RTC do away with the need for a lot of branching. You don’t need to branch to get developer isolation, to gather file changes together to understand them as an atomic set of changes related to a bit of work or to manage concurrent development of the same files on a small scale. You get all of that for free by using change sets. Developers are always in their own private personal branch separated from the rest of the team but unified by a common stream or repository. However sometimes it’s still appropriate to branch, this blog covers some of the situations when it’s appropriate and how to do it effectively in RTC Jazz SCM.

When to branch?

Change sets provide for developer isolation and can even be shared amongst part of the team without delivering but that’s quite awkward especially when a number of developers might be working together on a change and don’t want (yet) to commit it to the rest of the team. In this case using another branch of the code to isolate the sub-team makes sense.

Another example is for parallel development of a new major version of a product while also developing and releasing updates to a historical release of a product.

In this example imagine that we’ve shipped v1 of a product. We then move onto a new lifecycle developing v2 of the the product. During that dev time critical defects are discovered in v1, they need fixing but the code in v2 has moved on too far to do the fix there. This is another case for the need for branching.

Branching in RTC SCM is achieved using streams. The main development stream continues the creation of v2 but we can make a new stream for v1 maintenance which is based on the v1 release snapshot and will ultimately release v1.1 of the product. Defect fixes in the v1 maintenance stream may or may not need to be merged into the v2 stream depending on how divergent the code is.

The practical bit

Creating a historic stream is easy enough, you create a new stream and instead of creating new components to go in it you select the “Add…” button and add the v1.0 general release snapshot. This new stream could easily have associated integration and release streams if appropriate but the focus of this blog is more about passing changes between v1 and v2 parallel development.

RTC Historical Stream

There are four ways to manage flowing changes from maintenance work in the historical stream to main development work:

  1. Don’t – just rewrite any changes that are necessary in both streams. Generally a bad idea, but if v2 and v1 are extremely divergent it might be quicker to re-develop something than merge in a change.
  2. Baseline components in the maintenance stream and replace the v2 dev stream versions with those baselines. This is the easiest option but presupposes that there are no changes in the v1 stream which is extremely unlikely in real life.
  3. An “Integrator” can create a workspace in between the two streams and manage changes between them.
  4. Non-conflicting changes can be simply transferred between the streams directly

I would generally recommend option 4, falling back to option 3 where necessary in the case of conflicts.

To directly transfer changes between streams consider the following situation where I have a workspace on both the v2 dev stream and the v1 maintenance stream. I probably can’t load both simultaneously due to code overlaps but that’s not necessary to do this kind of thing. There’s nothing special about this setup other than I’ve added the v2 development stream as a flow target from the v1 maintenance stream.

As well as the pending changes views I’ve got on my two workspaces I can also create a pending changes view between the streams (as of RTC 3.0.1). To do this simply right click on the maintenance stream in the Team Artifacts view and select Show -> Pending Changes

The pending changes view now has 3 root entries:

  1. v2 dev local -> v2 dev stream
  2. v1 maintenance -> v1 maintenance stream
  3. v1 maintenance stream -> v2 development stream

Initially this is going to show a fair few incoming changes from the v2 dev stream to the v1 maintenance stream, however we don’t necessarily want to accept in that direction. If I make a change in my maintenance workspace and deliver it with a comment such as “Fix critical bug 69″ then the Stream Pending changes view allows me to deliver this change from the maintenance stream to the dev stream

This works great for non-conflicting changes however if the changes do conflict then you’ll get an error saying as much and telling you to accept all first and so on. At this point I’d fall back to option 3 mentioned earlier “An Integrator can create a workspace in between the two streams and manage changes between them” do essentially do what the error message tells us:

  1. Create a workspace on the development stream (or reuse your existing one)
  2. Accept all incoming so you’ve got an up to date clean workspace
  3. Open the workspace properties and add the maintenance stream as a flow target, making sure you make it current.
  4. Accept the conflict from the maintenance stream to your local dev workspace

RTC Cross-stream conflict resolution

  1. Resolve the conflict in your local dev workspace
  2. Change the flow target of your workspace back to the development stream – you should now have two outgoing changes: the conflicting change from the maintenance stream and your merges that fix the conflict
  3. Deliver the change and merge to the development stream
  4. w00t! :D

RTC Deliver Merges

Doing this sort of thing without support isn’t easy so call on your software development mentors for help. Don’t be afraid to cross the streams! If you want some expert SCM support, backup or help in your organisation get in touch.

See Part 1 for Development, Integration and Release Streams

See Part 3 for Component reuse

easy cloning with SimpleGit

About these ads

4 responses to “Advanced RTC SCM Streaming – Part 2 Parallel branched development

  1. Pingback: Advanced RTC SCM Streaming – Part 1 Development, Integration and Release Streams « The Mac Daddy

  2. Pingback: Advanced RTC SCM Streaming – Part 3 Component reuse « The Mac Daddy

  3. Anonymous December 12, 2013 at 9:35 pm

    Nice article, thank you.

    Maybe you can help us with an issue we have with our maintenance streams/branches. When we create fixes in our maintenance stream/branches, we need to determine the prerequisites, i.e. which fixes were made to the same file in that specific release. Unfortunately, when viewing the file history in the maintenance stream/branch, we see the history from when the file was created. This makes it challenging to know which changes were made in the maintenance stream/branch. Is there a way to ‘reset’ the file history in the maintenance stream/branch, or limit the history to only those change sets made in the maintenance stream/branch? Any help would be much appreciated. Thank you. Chris

  4. mikemacd December 17, 2013 at 3:35 pm

    Hi, you could try making snapshots at the branch points and then comparing current history against the snapshot.

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 345 other followers

%d bloggers like this: