Baselining technique-last known good build

0 Likes

"PROBLEM/ABSTRACT:
Are there any baseline or baselining techniques (best practices) to define the last known good build?

SOLUTION:
Here is a sample process flow for implementing a baselining technique:

In all cases, both the GUI and CLI methods are given for running each command in case you eventually want to script some of this. The GUI makes heavy use of the "Stream Browser" (View->Stream Browser).
Assume this is a sample stream hierarchy, where you have a main base stream called "acme", and a last known good build stream called "acme_good_build" where your developers are doing their work off of.

acme
|--acme_good_build
|--workspace_1
|--workspace_2
|--workspace_3

To implement your "baseline" model. Do the following:

First, lock the acme_good_build stream
GUI: Right-click the "acme_good_build" stream -> Lock Stream
CLI: accurev lock acme_good_build

Start with an initial snapshot (let's call it "baseline_0")
GUI: Right-click the "acme" stream -> New Snapshot
Name the snapshot "baseline_0"
leave the basis time as "now"
click "OK"
CLI: accurev mksnap -s baseline_0 -b acme -t now

Your stream hierarchy will now look like:
acme
|--acme_good_build
| |--workspace_1
| |--workspace_2
| |--workspace_3
|--*baseline_0

Now, to have the developers work on the baseline (snapshot), re-parent the acme_good_build stream to be based on the "baseline_0" snapshot:
GUI: Just drag the acme_good_build stream on top of the baseline_0 snapshot
CLI: accurev chstream -s acme_good_build -b baseline_0

Your stream hierarchy will now look like this:
acme
|--*baseline_0
|--acme_good_build
|--workspace_1
|--workspace_2
|--workspace_3

Your developers need to update their workspaces to make sure they are up to date with respect to their new "parent".

Now the developers are ready to work on code based on the last known good build.
They edit / keep their files as needed.
When they are ready to promote, they would do the following:
Re-Parent their workspace to be based on the "acme" stream.
GUI: Just drag and drop their workspace onto the "acme" stream
CLI: accurev chws -w workspace_1 -b acme
Result is the following:
acme
|--workspace_1
|--*baseline_0
|--acme_good_build
|--workspace_2
|--workspace_3

Update their workspace (necessary after promotion)
Promote from their workspace into the "acme" stream.

NOTE: At this point, this developer may or may not want to re-parent back to "acme_good_build" yet. The reason is that once they re-parent back to "acme_good_build", those changes they just made will come back OUT of their workspace until the "acme_good_build" stream is updated to reflect the latest good build. Just a point of discussion.
At some point, they need to re-parent back to "acme_good_build"

acme
|--*baseline_0
|--acme_good_build
|--workspace_1
|--workspace_2
|--workspace_3

When you are ready to create the next baseline after confirming the build is still good, do the following:

Create the next baseline (snapshot) called "baseline_1".
GUI: Right-click the "acme" stream -> New Snapshot
Name the snapshot "baseline_1"
leave the basis time as "now"
click "OK"
CLI: accurev mksnap -s baseline_1 -b acme -t now

Your new stream hierarchy will look like this:
acme
|--*baseline_1
|--*baseline_0

|--acme_good_build
|--workspace_1
|--workspace_2
|--workspace_3

It is now time again to "re-parent" the acme_good_build stream to the next baseline (baseline_1).
GUI: Just drag the acme_good_build stream on top of the baseline_1 snapshot
CLI: accurev chstream -s acme_good_build -b baseline_1

Your hierarchy will now look like this:
acme
|--*baseline_1
| |--acme_good_build
| |--workspace_1
| |--workspace_2
| |--workspace_3
|--*baseline_0

Your developers can now update their workspace and begin working against "baseline_1".
Rinse, lather, repeat.

At any time, you can see what is different between any two baselines by doing the following:
GUI: Right-Click "baseline_0" -> Show Difference, Left-Click "baseline_1"
This will show you all the files/versions that have changed. If you want to see the actual file content differences, just Right-click a file -> Show Difference
CLI: accurev diff -a -i -v baseline_0 -V baseline_1
To see actual file differences, drop the "-i" from the command options.

You will notice I used snapshots. You can eliminate the use of snapshots by simply using a basis time on acme_good_build, and incrementing its time as you approve latest good builds. Either way works fine.

For more information contact AccuRev Support"

Comment List
Related
Recommended