PowerBuilder Authors: Chris Pollach, Yeshim Deniz, Jayaram Krishnaswamy, Kevin Benedict, Avi Rosenthal

Related Topics: PowerBuilder, Microsoft Cloud

PowerBuilder: Product Review

Visual Studio 2008 Integration with SCM Tools

Makes securing and controlling Visual Studio 2008 objects for source code management an easy task

I am presently the administrator of SCM AllFusion Harvest. SCM AllFusion Harvest is a process-based software configuration management (SCM) tool for managing application source code. I manage 121 applications housed in SCM AllFusion Harvest and support 180 users using the product. The development tools we currently use are PowerBuilder PBV8, PBV11, Visual Studio 2003, 2005, 2008, Java, and Visual Basic.

As software configuration manager, I provide the administration of the source code management tools. This includes the entire infrastructure of the environment for development, from developing the lifecycles, to providing the best practices, procedures, processes, maintaining build machines, and training of all the developers on proper source code management using the development tools in our development environment.

This article describes the integration between the SCM AllFusion Harvest Version Control Interface (VCI) and Microsoft Visual Studio 2008 for version control. It will show how to make the necessary connections using the interface, demonstrate check-outs and check-ins, how to delete files in proper order using SCM tools, demonstrate file comparison and how to exclude files, add new files, load the initial baseline via the Visual Studio IDE and promote the Change Request (CR) Package in SCM AllFusion Harvest through the entire lifecycle leaving the initial baseline footprint across all SCM AllFusion Harvest states. Regardless of the SCM tool you use the integration process is very similar tool to tool. The same menus exist whether you're using Microsoft's Visual Source Safe, IBM's ClearCase, or CA's SCM AllFusion Harvest.

In Visual Studio 2003 and 2005 the Version Control Interface (VCI) and SCC API calls worked, but they were clunky at best. The overwhelming problem I found was binding issues with source to the IDE. However, as Microsoft has opened up its product to other SCM tools/vendors it's been evolving and getting much better at managing source code assets via interfaces in the IDE. I think the one noticeable aspect that has changed is that binding source to the IDE is becoming easier and less of an issue.

I recall being anxious when the binding was broken for any reason because error messages were almost non-existent and it was very difficult to figure out what happened and how to fix it. When you have a $20 million project on an accelerated schedule you don't really have time for these kinds of complicated issues. If there are problems, you want to be able to resolve them quickly to move forward and get everyone back to work with as little downtime as possible.

I also found that even when there were error messages they were cryptic at best and weren't always very helpful in determining the problems that occurred when the binding of the source code was lost. I have noticed a great deal of improvement in Visual Studio 2008 in terms of a more seamless integration not only with SCM AllFusion Harvest in relation to connectivity but with other SCM tools as well. As tools in general continue to evolve the importance of integrating SCM tools with development tools is getting more focus with every new release.

I wasn't all that pleased with the results at times, specifically the binding issues in past releases of both SCM AllFusion Harvest and Visual Studio. If your source code was unbound from the integration for any reason from the SCM tool you were using, it could be quite complicated to figure out what occurred and how to rebind the source code. It appears as though that problem has not cropped up in the new releases of Visual Studio 2008 or SCM AllFusion Harvest R12. At least during my evaluation I didn't see the issue occur.

In the latest version of SCM AllFusion Harvest R12 there is also a work area that is new to this version and lets you make the changes in the SCM AllFusion Harvest tool versus the IDE. I've also noticed this with other development tools as well. For example, the Eclipse plug-ins let you change code in either the SCM tool or the IDE. The choice is yours wherever you feel more comfortable using it. This in my opinion expedites development and streamlines processes to mirror your daily work lifecycle.

Here I will also provide valuable screen prints (figures) that should help you configure and load your source code into the SCM tool to begin making the necessary modifications to your application. Every software configuration management tool is different in terms of functionality. However, they all have common threads of functionality. Common activities include checking out, checking in, adding files, deleting files, obsoleting files, and loading an initial baseline. The way these task are done is different from tool to tool but all the SCM tools do these basics.

You'll forgive me if, for this article, I focus on CA's SCM AllFusion Harvest SCM tool because this is the product I prefer mainly because of the canned processes and lifecycles associated with it. I find it easy to use and integrate with other development products. I'll say this, though, that many of the SCM tools being developed today are robust and provide good integration with development tools.

However, I still favor the process-based software life cycle management tools because when you're a large organization like the state of New Hampshire, process-based management tools allow one individual to manage hundreds of applications. All processes are canned, and lifecycles and an environment can be tailored and set up quickly. Many of these process-based management tools have databases behind them that make storage and retrieval efficient, secure, and easier to control. It also provides wonderful exporting for disaster recovery purposes. In my professional opinion any tool where you have to build the environment with triggers for processes, use SQL command line or write Perl for the environment to do basic SCM activities is too much overhead for large shops to take on.

For this article I'll be integrating CA SCM Harvest R12 with Visual Studio 2008. The first thing we're going to have to do is go to the Tools menu and select Options. This is where we'll do all the source code set-up activities. I found this screen to be quite informative and useful because once you save this you don't need to do it again.

Go to Tools/Options. Once the "Option" menu is selected the following screen will appear ( see Figure 1), which provides many set-up opportunities. However, in this case we are only concerned with the "Source Control" option. Click on the Source Control option to progress in the set-up of the SCM tool.

The first choice in this option is to select the VCI plug-in for SCM AllFusion Harvest. The current source plug-in is not yet selected and reflects "none." If you use the drop-down you'll see a selection for the SCM. Once the option has been selected other options will become available related to the integration of the two products.

Figure 2 reflects the SCM selection available.

Once the VCI plug-in is selected the "Environment" and "Plug-in Settings" become available for configuration. For this example I selected "Custom" under Source Control Environment Settings and I set the flag to "Get everything when opening a solution or project." There are other selections that may be applicable to your environment that can also be checked. Due to the fact that I set the flag for "Get everything when opening a solution or project"; when Visual Studio opens, I get prompted for my SCM tool login at that time. What's happening is that because the VCI is connected to the IDE it's automatically pulling the source code from the SCM tool when Visual Studio 2008 is opened, prompting a user name and password login to the SCM tool to complete this activity.

Once the environment has been set up, you can now set the Plug-in Settings to "Custom" and place your user name login in the Login ID (SCM) field. Once this is all set up it's time to move on to settings in the "Advanced" tab.

Figure 3 shows the "Advanced" screen and there are a number of tabs that can be selected and set. The first tab deals with setting the "Broker name." In this example I have set the broker name field to the server name where our SCM tool and database reside and the HarWeb server name is set to an open port. I have set two flags below; the second one is the more important of the two. "Always bind old VCI projects" is quite important, especially if you are migrating from one version of Visual Studio to another. You want to have the bindings preserved from one version to another should you upgrade.

On the "Advanced Tab" screen the only other tab to be concerned with is making sure that files are compared by version data and that when a writable file is replaced the user is prompted. All the other defaults on other tabs are acceptable as is.

When everything is set up as it should be you can click on the "About" tab and see the tool reflected along with the version of the plug-in ready for use. In this example the figure reflects "CA SCM Plug-in for Visual Studio" version 12.0.0 Build 56. Should you get to this screen and not have anything representative of your SCM tool then you know that somewhere along the line the set-up, the VCI plug-in patch, or product install didn't go as expected. I would reinstall the SCM tool again and see if you get different results.

As I was writing this article and navigating through Visual Studio, I noticed that some of the Version Control Interface menus were not available and I had to reinstall the VCI plug-in for the menus to appear.

This completes the set-up of your SCM tool in the IDE. With these tasks behind us we can now add a Solution and Project to the SCM AllFusion Harvest tool for what I call the "Initial Baseline Load." This will create a version zero in the SCM tool in a repository housed on the server and stored in an Oracle database that will become our protected baseline forever. This allows complete traceability back to the original loaded baseline regardless of whether there are five changes or 5,000 to files. If we go back to the top menu and select "File," "Source Control" we can now begin to load the Solution or Project to an already existing environment and repository in the SCM AllFusion Harvest tool.

Once you click on File, Source Control you are then prompted to place your SCM AllFusion Harvest credentials in the sign-on field placing your user name, password, and broker name. When the credentials have been satisfied you will get the context screen, which allows you to begin the set-up of your project just prior to the actual loading of files. Figure 4 for the login and context screen. It has several fields that get populated with information important to the project set-up.

First you'll need to select and populate the following fields with information required for the set-up: 1. Project Name, 2. SCM State, 3. Change Request Package, 4. Check Out Process, 5. Check In Process, 6. Select mode for each of the two processes, 7. Set Refactor Flag, 8. View Path, and 9. Local Path. Figure 5 illustrates how the fields are populated. When the fields have been completed set the context of the project by clicking on the context button.

The Mode for the "Check Out Process" is set to Synchronize and the Mode for "Check In Process" is set to Update and Release. Based on the Project, Package, View Path, and Local Path the initial baseline will be loaded. When the Project has been bound to the SCM tool via a Solution the Change Source Control screen reflects the bindings that have been anchored with the initial baseline load.

Figure 6 illustrates the binding connections once secured by the IDE.

Once the environment has been secured under source control via the IDE and your SCM tool, you can then go to file, source control, CA SCM Properties and view the status of the package and initial baseline load.

Once the Solution/Project has been bound you can then go to Tools on the top menu in Visual Studio select "Add-In Manager" and the Add-in Manager screen will appear. In this screen you can set the flag for Startup and click on VCI Add-In R12.0.0 and the tool bar will reflect the CA SCM VCI when this tool bar is invoked there are a number of features available that allow functionality from the SCM tool to exist in the IDE without having to go and launch your SCM tool. Now I don't know if all tools have this functionality but CA SCM AllFusion Harvest R12 certainly does.

The tool bar for the CA SCM VCI interface allows additional functionality. For example, you can change the package you were originally using to a different package for additional check-outs and check-ins by changing the Current Context. In fact, using the Edit button on any one of the options presented on this screen lets you modify the context of all the project information.

The Package Explorer shows all packages in the SCM AllFusion Harvest R12 environment by Package Name, State, and User. You can also create a new package in the Explorer view, which will be reflected in your SCM tool.

There is also a separate function on the tool bar for creating a new Change Request Package.

The context view lets you switch packages from the original package you were using to do your check-outs and check-ins. By using the down arrow you can select a different package to use for check-out providing the package was created in the SCM AllFusion Harvest tool.

Once the Solution and Project information have been bound and the initial baseline promoted through the SCM AllFusion Harvest R12 lifecycle as the footprint of version zero, you will see a lock on the files that means the file(s) are now under source control and ready for modifications. To check out a file do a right mouse-click and select "Check Out for Edit" and the file will be checked out and reserved in SCM AllFusion Harvest. No one can modify this file until it's been checked back in to SCM AllFusion and the lock has been released. When the file has been checked out there will be a checkmark on the file as illustrated in Figure 7. In SCM AllFusion Harvest the file will reflect the letter "R" for reserved.

When the check-out is occurring if there are dependencies or inheritances in the file being checked out then all associated files will also be checked out for update as well. Click on the "Check Out" button and you'll see the file(s) bearing a checkmark. The checkmark indicates the file is checked out and reserved and not available to anyone else until the file is checked back in.

If you right-click on the file(s) after it's checked out you can view its properties. For example, the Process in this case is Update, the package name, the item(s) checked out, and the version of the file checked out for update.

Figure 7 illustrates a checkmark on the file that has been checked out for update (testclass.cs).

Once your changes have been made to the file(s) you can then do a right mouse-click on the file and use the "Check In" process now available. Once the file is checked back in the changes are recorded in SCM AllFusion Harvest using the Version Control Interface (VCI) and a new version is assigned. Figure 8 illustrates not only the process available but also the file(s) associated with this file as dependencies.

Click on the "Check In" button and the lock is released (reserve tag) and the file is then available again for others to check out for update. Prior to this "Check In" the file is locked in the SCM AllFusion Harvest tool and cannot be modified until the lock is released.

Once the "Check In" is complete you can do a right mouse-click and view the history of the file in terms of activity.

There is also a compare utility available under the Source Control menu view. Figure 9 and Figure 10 illustrates the screen that is available.

Our Experience
We develop and maintain a variety of applications at the state of New Hampshire's Department of Office of Information Technology (DoIT). The applications are used extensively in our welfare and health services delivery agencies. Example applications are for childcare licensing and managing adult and elderly care. Throughout the state the programs are used by hundreds of users.

Using SCM AllFusion Harvest R12 with Visual Studio 2008 has made securing and controlling Visual Studio 2008 objects for source code management an easy task. My synopsis and review of SCM AllFusion Harvest R12 and Visual Studio 2008 goes as follows: SCM AllFusion Harvest R12 and Visual Studio 2008 from environment use, processes built into the products, interfacing capabilities, and ease of use make for a seamless integration. If you are in an environment where you require products that encompass the best seamless interfacing capability with Visual Studio 2008 for source code management then you shouldn't be without SCM AllFusion Harvest R12 with Visual Studio managing your assets.

More Stories By Al Soucy

Al Soucy is software configuration manager at the State of New Hampshire's Department of Information Technology (DoIT). In that role Al manages software configuration for dozens of PowerBuilder applications as well as applications written in Java, .NET, and COBOL (yes, COBOL). Al plays bass guitar, acoustic guitar, electric rhythm/lead guitar, drums, mandolin, keyboard; he sings lead and back up vocals and he has released 8 CDs.

Comments (1)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.