Posts Tagged ‘branching and merging’

Agile and SCM: Helping You Get to “Done”

January 24th, 2011 by clucca

You spent the last 2 weeks working on 10 user stories for you sprint. Your team has completed 8 of the 10 user stories, and now it’s time to show a working demo for your sprint review. Sounds like a typical scenario right?

Here’s the problem, the 2 remaining user stories have partial work associated with them. That code is in your source control system, and in order to correctly demo or ship what was accomplished in your sprint, you’re going to have to do some work to create a “done” product. You will have to subtractively merge those changes, or put them on another branch, then re-test the application, redeploy.. check the changes again etc. There is still a lot of work to finished in getting this sprint to “done.”

One way to get around this is to associate user stories with code changes in your SCM tool.  AccuRev already creates a link between your user stories and code in the form of change packages. Creating that link between the user stories and your code is the first step. But using a powerful story-driven process out of this linkage is the key to “getting to done” in an Agile environment.

Your user story will move through different stages as you move through your process. One user story may have these states:

chart Agile and SCM: Helping You Get to DoneDEV- Currently in progress with dev team, or “coding”
QA- Coding finished, ready for QA to test
UAT- QA finished ready for user acceptance testing
PROD- Tested by QA and users, ready to ship

However, while  user stories move through this process, the code doesn’t follow. Traditional SCM systems are designed around single branches and a long and lengthy merge processes. Fast paced Agile environments expose those limitations as development teams struggle to ship code to customers at the end of iterations.

During that iteration, testers may want to test completed user stories, but need a stable configuration to do so. If you’re using a traditional waterfall branching and merging based SCM tool, you may end up with some user stories ready for QA, and some still in the DEV stage, creating a poor testing environment and broken builds. As a result, developers often delay committing code so changes can be implemented, tested, and passed to QA before they integrate.

During your retrospective of the previous iteration, you may decide that parts of your process need modification. For example, you may decide to add a code review process right before testing. Your SCM system has to be flexible to enable this new step without time consuming tasks, like re-writing scripts.

SCM and an Agile Process

The trick is to have an SCM system that can help you manage and enforce an Agile process. Code should be able to follow the same process user stories follow. If a user story is in QA, all of the code needed to test that issue should reside in a QA configuration. The same goes for DEV, UAT, PROD, or any other process that is part of your environment.

A stream structure is an easy way to  process change – streams can be added to adjust your process. In a few clicks, you can add a code review between a DEV, and QA step.

Agile and SCM: Avoiding Agile Merge Hell

As you start to scale Agile, code and user stories have to be merged more often. Sometimes changes my flow from one organization to another. This means that you will need to take code from one team, merge, integrate and test those changes with everyone. Each team needs to be able to work on their own schedule, this means that if multiple teams want to work on different sized iterations they can. In addition they can deliver changes as they need to on a regular basis, independent of the the other teams.

The problem here is that to do this in a traditional SCM system, you would have to merge these code changes daily for them to be of any use. You also still need to keep visibility into what stories are shared between teams, because delivering changes from user stories that are not completed in a sprint would be disastrous.

Typically, the type of configuration people use for this is a single baseline or “trunk” methodology, where all changes from each team are delivered to trunk and pulled from trunk as their iterations are completed.

Working within an Agile context, your teams will have to deal with these branching and merging issues. But there are other problems that can happen when you use this methodology:

  1. Delivering 2 weeks worth of changes only causes isolation among teams.
  2. It’s too hard to pick out each user story as it completes from our codebase.
  3. Figuring out the dependencies of those user stories is complex.
  4. Being able to identify what changes came from each branch is impossible.

This “baseline pollution” is not scale-able. You can get around this by using a development hierarchy, and manage the relationship of dependencies between branches. This could also include process steps such as integration, quality assurance, and code reviews.  A separate code configuration can be used for each step and user stories could simply be drag and dropped between each team, state or branch instead of a merge.

Doing this will increase code stability. As a completed user story is pushed from one stage to the next, the particular change, as well as the system as a whole, reaches a higher level of maturity. While many traditional SCM tools do not easily support or surface a development hierarchy, AccuRev supports the creation of a hierarchy, gives visibility into the changes at each stage, and enables straightforward merging between stages.

Opening the Desk Drawers of the AccuRev Mind

January 3rd, 2011 by jtalbott

To borrow from a common print journalism trick, consider this the cleaning out the desk drawers of my AccuRev mind.  Or if you tend to avoid newspaper columnists, especially sports ones, then let’s just call this a random “did you know” or “what’s new” post.  I think the last time I did one of these was in the AccuRev Version 4.5 days, and we now entered the days of AccuRev 4.9, so there might be a few things tossed in here that aren’t necessarily fresh off the presses…

AccuRev 4.9 introduces the long sought after “stale filter”.  Actually, it’s an Update Preview search, but it shows not just (stale) files, but also anything that will change at update time, like moves and new elements.  You can even perform actions in that search pane, like Diffs, prior to updating…

    Software Configuration Management

AccuRev 4.9 also brings you the -t <time_spec> argument for both stat and pop.  This lets you provide a transaction or time stamp to the command so you can reference a configuration of code at a point in time without having to utilize a time-based stream.

Software Configuration Management

Sticking with command-line tidbits, you can now use pop -D to populate elements without including their entire directory structure.  Very useful in situations where you might have different applications contained under a root folder yet want to populate them at a top level.

Software Configuration Management

Another really helpful enhancement is to the Deep Overlap search.  Now when you Merge a file that is in Deep Overlap, AccuRev changes the status to (kept)(member) in the filter so that you know which files have been operated on.  You also have the ability to promote from this search window, and subsequently the promoted file will no longer appear in the filter.

Software Configuration Management

If you haven’t started using the AccuRev WebUI, you’re really missing out.  One lesser known capability in the WebUI is the ability to take a regular query, Group by any field, and automatically convert it to a bar, line, or pie chart.  This report can then be sent and accessed as a URL, and obviously can be viewed by users without installing the classic GUI.

Software Configuration Management

To further bind the classic GUI and WebUI together, AccuWork issues in the classic GUI now contain a hyperlink “Issue URL” which takes you directly to the URL rendering of the issue in the WebUI.  And for those with a very extensive stream structure, have you checked out the St\ream Filter to personalize and only display streams that you care about?

Software Configuration Management

For folks running Continuous Integration, or for those who just want to be able to use command-line to see what’s changed in a stream over time – including inherited content! – I think you’ll be happy with this one.  You can use the accurev diff command to compare the contents of a single stream with itself over a period of time, without having to create a time-based stream.

Software Configuration Management

Have you noticed that when using the Stream Issue Mode in the StreamBrowser, you now see Incomplete Issues right in the “Show Active…” box attached to streams?

Software Configuration Management

And lastly for now, bonus points for anyone who can comment here to point out the AccuRev command-line typo that still works as if it is spelled correctly.  AccuRevers or former ones need not apply  ;-)

__________________________________________________________________________________________________________________________________________________

How AccuRev makes releasing Beta software easy

October 27th, 2008 by AccuRev

I work for a large global enterprise software company with over 500 users, that has been using AccuRev for over 4 years.

We are currently managing a Beta release of our main product line.  The management of the source code is easy thanks to AccuRev, and here’s why:

1) Stream inheritance is just plain awesome!

We manage hundreds of streams to make up our suite.  We are able to promote code up through task streams, to integration streams, to qa streams where we ship.  For the Beta, we have child streams qa.beta, and our build machines use these streams.

2) Snapshots rule!

Snapshots by definition are immutable.  So you know what you built, when you built it.  Our build process creates snapshots automatically, and we fetch code based on snapshot.  We have 100% confidence in knowing what went into a build, and our snapshots are named to a pattern i.e. <parent stream>.yyyymmddhhmmss.build<build number>.  That gives one a lot of info about a build.

3) Timelocks let you stabilize code, even if set the next day!

We built our Beta release on snapshot, and the next day we retroactively set time locks on the qa.beta streams based on build time, and we access locked them down.  Now we can finalize the Beta, and still allow other integration and qa work to happen.

In summary, if we were using a traditional branch/merge SCM, this would be a lot of work and require dedicated personnel.  Instead, we did this part time and the StreamBrowser makes is so easy to see what code is where and why.  There is no confusion with views or other techniques used by other vendors.