Friday, September 28, 2012

working with different currencies

One of the things that I like the most about Rational Team Concert is how we solve problems which cross-cut across the developer's perspective.  What this means is that the change sets that a developer produces are linked to work items, which often have a particular process workflow to them.  The change sets are also captured in snapshots via builds, so we have traceability from builds right through to the work item or plan.  We almost take this traceability for granted, having used the product now for > 5 years and counting.  This traceability provides another benefit that may be subtle to some people.

The linking of work items to change sets allows for users of different backgrounds to talk about the same problem in language that they are most familiar with.  We have found that many people indicate that they "deliver work items" to the stream when they are done.   The work item tends to be where the discussion happens, and where consensus is reached.  The code artifacts are derived from that understanding.  So when talking to a development manager, they are interested in knowing that the work item is closed (and the fix delivered) rather than the specifics as to how the fix was done.

So while developers may talk change sets, their bosses may talk work items, or change requests.  Which is why we try and write features which deal in both currencies, like Locate Change Set.


As you see in the above screenshot, Locate Change Set allows users to work with either change sets or work items in order to ensure that people can answer questions using the terms and currencies they are most comfortable with.

Similarly, when someone compares builds, the comparisons come back in the forms of change sets or work items.  We have numerous features in Rational Team Concert that work like this.  When you allow for users to answer questions using the concepts they are most comfortable with, you create an ease of use that really helps to allow different roles to enjoy using the product.  

Thursday, September 27, 2012

Preview - Gap detection when reviewing changes (Eclipse & VS clients)

A developer gets often asked to review the changes associated to a work item. What if some change sets are missing? The new Change Summary view detects inconsistent situations automatically for you.


In the above example, the reviewer selected the change sets associated to the work item to be reviewed and clicked 'open'. The Change Summary view shows which files are modified by these change sets. The file MobileWebView.java is flagged with a special decoration - a red square and a description 'in 2 disjoint change sets'. What is so special about this file?

The reviewer decides to double-click on this element. Instead of a compare editor showing the changes to that file, a prompt comes up.

 

The file MobileWebView.java is modified by 2 disjoint change sets, i.e. change sets that aren't related to each other because they refer to unrelated versions of MobileWebView.java. The Details pane comes up automatically in this case, showing the change sets that have a gap as shown below. The dependency graph is actually disconnected (broken green and red graphs).


The reviewer can ping the developer on the work item and ask him or her if they have forgotten to associate a change set to the work item. In this case, the developer had associated a change set to a different work item by mistake. After moving it to the correct work item, the reviewer could review the three change sets together correctly.

Note. In certain situations, disjoint change sets are expected and perfectly valid (e.g. developer had to do multiple change sets intertwined with deliveries from other team members). The reviewer will simply review each disjoint change set through the Details pane.

Note. Prior to 4.0.1, there was no Details pane. Disjoint changes were represented as multiple nodes in the Change Explorer view with no identifier about which change set they originate from. In 4.0.1, the Change Summary pane and the Details pane provide more comprehensive information in these situations, making code review both efficient and safe.

Note. Visual Studio client figures the same details pane support in the Change Summary view, as illustrated below. This feature was jointly developed in 4.0.1 by a feature team working simultaneously on the Eclipse, Visual Studio and Server development. In prior releases, different component teams were responsible for adopting new features, usually in different milestones.


Note. Expect to be able to try out this new feature with 4.0.1 M4. As we are transitioning toward feature teams and continuous delivery, I am experimenting with previewing our latest work on this non official blog. Go to jazz.net for the latest milestone build and official new and noteworthy. There is no guarantee a preview will make it to a stable build.

Preview - New details pane when reviewing changes (Eclipse & VS clients)

In certain situations, seeing all the combined changes from the various change sets doesn't give a clear picture. The reviewer may want to understand which individual change sets modified the file MobileWebView.java. Simply turn on the 'Show details pane' option under the Change Summary's drop down menu. This brings up the Details pane shown below.


 In our example, the file MobileView.java was modified by all three change sets created by Christophe. Each change set's comment is available, which can help understand the purpose of each change set. Dependency graph shows the ordering of the change sets and the reviewer can double click on each row to inspect each change individually, gaining a progressive idea of how the whole bug was fixed.

Note. Expect to be able to try out this new feature with 4.0.1 M4. As we are transitioning toward feature teams and continuous delivery, I am experimenting with previewing our latest work on this non official blog. Go to jazz.net for the latest milestone build and official new and noteworthy. There is no guarantee a preview will make it to a stable build.

Preview - New dedicated Change Summary view for reviewing change sets (Eclipse & VS clients)

Once a bug is fixed, a good practice is to ask one of your peers to review your changes. Ping them on the work item you have resolved or set an approval. The reviewer will be notified and will open the associated change sets.


The reviewer can then go through every file that was modified and open a compare editor showing the combined changes for that file.


In the above example, the reviewer selected the file MobileWebView.java and double clicked (or right clicked and selected the action 'Open in Compare Editor'). This brings up a compare editor that shows how the selected change sets combine to modify that file.



Note. The Change Summary view should look familiar since it is drawn from the previous Change Explorer in the 'Show Files' mode. The previous Change Explorer view supported two modes, one focused on file changes 'Show files' mode and one focused on comparing sources such as streams and workspaces 'Show change sets' mode. In 4.0.1, the 'Show files' mode is evolving with richer capabilities such as the Details pane and is moved to a separate new view named 'Change Summary'.

WorkflowView used in 4.0.1View used in previous releases <= v4.0Artifacts shown
Review change setsChange SummaryChange Explorer in 'Show files' modefiles and folders affected by selected change sets
Compare workspaces, streams, snapshots or baselinesChange ExplorerChange Explorer in 'Show change sets' modeChange sets (e.g. change sets from source stream that aren't in target stream and vice versa)


Note. Expect to be able to try out this new feature with 4.0.1 M4. As we are transitioning toward feature teams and continuous delivery, I am experimenting with previewing our latest work on this non official blog. Go to jazz.net for the latest milestone build and official new and noteworthy. There is no guarantee a preview will make it to a stable build.

Preview - Choose which change sets to review or accept from a work item (VS Client)

The Work Item editor in the Visual Studio client now lets you select the associated change sets you want to open or accept (Press CTRL key and mouse click over the selected change set triangle icon and repeat as desired).


Note. Expect to be able to try out this new feature with 4.0.1 M4. As we are transitioning toward feature teams and continuous delivery, I am experimenting with previewing our latest work on this non official blog. Go to jazz.net for the latest milestone build and official new and noteworthy. There is no guarantee a preview will make it to a stable build.

Thursday, September 20, 2012

Change set under the microscope

RTC Source Control users deal with hundreds or thousands of change sets every day. Let's stop a bit here and have a look at what a change set looks like under a microscope.

Change sets are everywhere. Wherever you put your microscope inside SCM, you'll quickly find them under the cover.
  • In the Work Item editor, as links to the code that was modified to fix that work item.
  • In the Pending Changes view, as the currency you exchange with your team to collaborate
  • In the History view of your workspace or of your team stream, nicely sequentially organized
  • In the Build Results page, showing you what happened to the code since the previous build
  • In a Source Editor, when using the annotate feature
Under the naked eye, this is how a change set looks like, an innocent blue triangle:

When you create a change set, it remembers you for ever. So anyone who finds this change set will know its author. It also knows the date and time related to its creation.

A change set describes its purpose with a comment. It describes its mission with a bi-directional link to a work item. So you can trace back why that change set is there and who approved it, give feedback.

A change set is tied to a component. If you have permission to see the component, you can see the change set. Otherwise you won't. A change set is designed to flow between workspaces and streams, within the same RTC server or between different RTC servers.

A change set knows who it is. It is different from all the other change sets out there in the world. It's important because that is how RTC Source Control is a modern distributed SCM. A change set has a unique ID. We'll never mix your change set with mine, even if we are on different servers.

Now it's time to zoom into the core of a change set. Until now, we were just looking at its outer shell... A change set holds an immutable list of files and folders, with their expected starting state (required to apply the change set) and final state (after the change set is applied). It's immutable once its author decided to seal it (by completing or delivering it). The change set will forever describe how to take a set of resources from a particular state to another particular state.

There are things you won't see in the change set itself. Content of the files changed in the change set isn't part of it. You see, the change set is designed to be a very lean entity so you can scale huge histories of change sets and not hurt the database. Change set only contains the IDs that identify the starting states and final states of the files and folders modified. The content corresponding to these states is efficiently stored once in the DB (keyed with a hash). A change set is a bunch of ID's, not a huge text patch.

Another thing you won't see is path names. The change set stores the name of the files and folders that are modified (or moved, renamed..). But being efficient and portable, it stores only the ID of the parent folder of these modified items. No lengthy path name. Change set describes a change in a mathematically accurate manner (IDs). Of course humans will need to see path strings at some point e.g. src/com/my/project/A.txt. The UI resolves these paths when needed in the context (configuration) in which the change set is used (your workspace, a stream, etc.). For most SCM operations, only IDs matter. IDs are reliable and efficient (and unique). Paths are only useful when a reviewer is looking at the change set.

Sometimes a bacteria runs into another bacteria and consumes it. Some change sets are the result of merging change sets. For each file or folder merged, the change set tracks the starting state, the merge state(s) and the final (merged) state. So a change set knows it represents a merge between conflicting states and the UI can specially decorate it to get user's special attention (hey, did my team mate override my change?).

And this allows SCM to show the following merge graph. It displays the relationship of the states in the change sets forming the history of a file in a particular stream or workspace.



At that point, we've used a regular magnification. But we can push further, though beware most users usually don't get in there. A change set also knows a lot about how its author got to that final state for each file or folder it modifies. In the early stages of a change set, its author checks-in local changes he or she made to files and folders. The same file may be modified and checked-in many times into that same change set. The last check-in will define the final version - the one that will be applied with the change set. But the change set also remembers somewhere very deep each intermediate version that was checked-in before it was sealed. Since 4.0, these versions are available to the user through the File History View / Check-in History pane.



That's how far we will take our journey inside a change set today. It's the building block of SCM, and a pretty solid one.