Google Projecs Vs CodePlex Vs Tigris Vs SourceForge

Google projects is essentially free subversion hosting.  Ordinarily you’d have to pay a monthly fee for that.  It runs on Subversion, so with an Ankh plug in, it is Visual Studio Friendly.  Google isn’t the biggest in the world, but they have a reputation for leaving services free and I’m not expecting them to fold anytime soon.

Future Stability

On the other hand, there is GotDotNet CodePlex.  GotDotNet was it’s own source control engine, as fair as I can tell. I can’t blame MS for killing the project when they have VSS and Team System to support.  Killing the project instead of putting it into permanent minimal support mode is not entirely forgivable.  Now how many years until CodePlex gets the axe?

Underlying Source Control

TeamSystem is optimized for corporations with 100-1000 developers, with lot and lots of process, like bug tracking, work flow, metrics, etc.  It costs money, unless you have a MSDN subscription, then you can get a the rights to spend a week installing a team system server.  God forbid you gave the server the wrong name.  If the installation succeeds, you and four other people with VS can start developing together.  One or two of these people are going to be full time process and server admin people, so really, this is a team of about three developers.

CodePlex could be forgiven that, but it’s getting a reputation for performance problems.  To be fair, my first checkout of a project from Googe Projects was zipping along at 2Kb/sec.

As of right now, I’m thinking I will go with Google Projects, because I already have some experience with subversion and liked it. My experience with Team System may never pay off in terms of productivity at the office, unless I join a 1000 developer team, which doesn’t sound like an environment I’d enjoy anyhow.

Tigris is backed by Collabnet, an open source company.  Source Forge is owned by another open source company, VA Software.  All, I know is, they can’t be as big and as well funded as Google.  I’d worry that these will convert to paid accounts or shut down.

And don’t even get me start talking about Source Forge.  I still have nightmares about trying to get ssh, tortoise and cvs to play with each other. (They might have improved since then, but I still remember the site as being a bit clunky)

All of the above have really lousy project search features. 

Peripheral Services

Google Project Hosting has a Wiki, Download section, Issue Tracker, subversion source code browser and of course subversion.  What more does one need?  Mailing lists handle through integration hooks, so you can use google groups or any other mailing list provider.

Posted in VSS

The Search for FAST Souce Control

The goal is to check out a big project from the office and edit it on my home PC using the company VPN connection.

Visual Source Safe, while not safe at any speed, isn’t able to reach very high speeds to begin with. I though for a few seconds about using the web services access, but decided slow web services on top of a file based database doesn’t equal faster. (however I will find out what the real numbers are)

Team System has a beautiful source control system, but my company has only 5 licences. And the set up and care and feeding for Team System is a remarkably high barrier to entry. (Soon I will see if it is worse than the others)

CVS is free, but has a user interface only a cave man could love.

Subversion. You are my only hope.

Subversion is a collection of command line applications, one of which can run as a server. The server component can be accessed across the network. There are two protocols that are safe, https:// and svn_ssh://, the former being Apache 2.0 and webdav based, the latter being based on ssh tunneling.

Subversion uses some weird protocols plus webdav. The svnserve process talks TCP/IP but has primitive security: passwords stored in plain text, doesn’t look like it encrypts traffic, etc. Webdav is a HTTP protocol that makes your web server work like a windows file share. Sort of. And at least you can encrypt traffic and use apache’s security.

To use webdav you need Apache 2.0, (not Apache 2.2!), which by the way is a steaming pile of sh*t if you need SSL. A newbie can set ssl running on IIS in a hour or two. I just burned a couple of hours trying to get Apache to run SSL. Openssl is also a steaming pile of sh*t. I don’t see why anyone would go through the significant effort of releasing code to the world without making any effort what so ever to make it work without a day of configuration. [Update, you need to use xca to generate the key and certificate, and define virtual directories in the conf file, that's what finally worked for me.]

Next you want the latest version of subversion, 1.4. Install that and set it up as a windows service.

Finally, you will want Ankh. Get Version 1.0 or higher. It is a Visual Studio plug in. It doesn’t use the same API that the VSS plug in uses, so don’t expect to find it on the options. You will need to have and see a solution to get the context menu where much of the Ankh action happens. Ankh doesn’t cover all the possible Subversion features, it is more for the basic check in, check out and see what’s changed. Alternatively, you could run the underlying commands

Appendix:

Subversion Feature List

* Working folder caches a copy of original, so change detection can be done entirely locally (to see if you change anything since last check out), saving bandwidth

* Changes are submitted as deltas (differences), not the entire file. Again, saves bandwidth.

* Changes are atomic. An update to several files either succeeds entirely or fails entirely. Changes are logged to the client, then executed. If the computer fails midway, changes can be reapplied next time.

* Working copy can become a mixture of versions. This is a feature or defect depending of your viewpoint.

* Locking-Change-Unlock is possible, but not the default workflow.

* Copy-Change-Merge is the default work flow.

* Branching is supposed to be easy.

* A VS2005 plug in exists.

* Not a relational database, but that’s okay because text and document databases are a poor fit for relational stores. It does however have a real database API behind it, Berkley DB.

* Free

* Works with SSH or SSL/Apache/Webdav

* Supports large repositories, so you needed maintain half a dozen separate repositories like in VSS.

* Tool support

Ankh (VS2005 plugin), version 1.0 or higher.

Apache (secure network layer), my advice, use the apache that comes with collabnet’s distribution.

WebSVN (php UI)

Tortoise (Client/Admin tool, stand alone GUI client, Windows Explorer integration)

VSS via IIS

One article on setting up VSS on ISS.

Here is a short list of my notes on using VSS with SQL. 1st off, I’m imagining that only procedures, views, functions and other objects that look like code will be checked in. Altering tables is rocket science and requires a specialized tool.

VSS/SQL integration mostly means you generate the scripts for all code-like objects. Then you check those into VSS. Then you edit those files and it is up to the developer to run them against the appropriate server. VSS can make sure that your local copy of the scripts and the code database’s copy of the scripts are in synch, but can’t check for people making changes to their local database’s. A developer could accidentially skip the check out and edit the proc directly in Enterprise Manager and VSS wouldn’t know it, unlike the working copy of scripts, which are set to read only until explicitly checked out. Similarly, when code is checked in, the developer could forget to publish the new proc to his local SQL server.

Also, if the developers are using a shared SQL box, then when the run the SQL script, the last one in wins, unlike VSS, which detects conflicts. This can be solved by using a shadow copy (which publishes the files in VSS to a shared folder), which could be automatically imported into the shared database, say in a nightly build process, or on demand.
VSS Client: No SQL features (the scripts are just text files), although you can tell VSS to launch your favorite editor.

Query Analyzer: No VSS features

Visual Studio: Some VSS integration, but the work flow is a bit clunky. You have to manually synch up the name of the script file and the name of the object. After exporting objects, you have to manually add the create scripts to the project.  Plus there are two ways to change a procedure, either in the object explorer in the server browser, which doesn’t have VSS features, or in the scripts folder of the database project.

SQL Server Management Studio: Some VSS integration, somewhat similar problems as Visual Studio, although different.

Script export/import: This is the process of synching VSS to SQL. Ideally, we’d want to be able to detect conflicts. Failing that, we’d have to resort to using security rules to keep people from editing the SQL code in SQL directly, or being mean and having a policy that says, the code in VSS always wins, regardless to any changes made directly to the Server.

Visual Studio Database Projects

General Idea
Don’t use SQL Server as your master code repository. You can’t see change histories, you can see when an object was changed, who changed it, etc.  Also, if you are BAD and don’t use default ANSI settings, they will need to be set at each ALTER or CREATE of a stored procedure.  Some tools and developers forget to do this.  Also, if you DROP and CREATE a stored procedure, you will also need to regrant rights on the object, unless you are BAD and have a script that grants EXECUTE to public on all objects every five minutes.

Create a Visual Studio Database Project
All scripts that are needed to create a brand new copy of your database, put into “Create Scripts”

All scripts that tranform your schema from V1.0 to V2.0, put into “Change Scripts”  Capturing these requires either creating them by hand or being diciplined when using tools like RedGate SQL Compare, EM or SSMS.

All scripts that you want to keep out of your server, can’t be turned into a stored procedure, are ad hoc but maybe reusable, put them into “Queries”

Create addtional or different folders if you don’t like this kind of logical arrangement because as far as the project is concerned these are all the same.

Generate Scripts on per object basis
If using EM, generate scripts, per object, don’t use Unicode.  VSS6 can’t deal with Unicode, although VSS2005 can. 

If using VS2003, VS will use enterprise manager to generate your scripts when you drag and drop from the Server Explorer to your Solution Explorer.  This allows for 1 file per object.

If using VS2005, VS will generate the script how it damn well pleases, in one great big file, no questions allowed.  I can’t find anywhere in the Tools Options to change this.

Checking In First Time
 Visual Studio really, really wants to check the project in for you. 

However: Visual Studio will check in in how it damn well pleases.  Checking in a database project creates about 5 layers of empty folders. VSS will also try to check in your solution file, which by default ends up in the My Document Folder.  This implies that the next developer to check out your project will have to recreate your Document Settings tree structure, very non-intuitive.

I say don’t add a database project using the ‘Add to Source Control’  Instead, use the VSS client.  You will get a slew of errors from VSS when you open that project from VSS.  Try Bind and unbind to get them to go away.  It didn’t quite work for me, but with trial and error, things seem to be OK now.

Running the Scripts
Execute scripts either by creating a command file, which runs one or more scripts through osql, or right click on a single command.  If you have SQL2005, use sqlcmd scripts instead, although I’m not sure if the DB project supports them yet.

Front Page Extentions: What are they?

0) vti_XXX directories are evidence of Front Page extensions.  VTI was the company who intially developed Front Page Extensions. 

1) They are an API of server side code components.  This is quickly becoming irrelevant unless you are actually using Front Page to write your website and are using Front Page the way it was ‘meant to be used’ instead of what I’d do, which would be to ignore all the FP features.

2) It is a primitive type of source control or an FTP accellerator.  When opening a website by FPE, you get a local copy, then when you upload the pages, FP overwrites what you changed.  There is some sort of detection of things changing on the server, because Visual Studio will tell (and optionally automatically reload) any changes it detects.  There is no merge, the person who saves their file first, wins.  There is no visible history or tool for comparing what you just did to what is on the server.  Since FPE write to the server only what you changed, it is faster than FTP’ing the entire website.

3) When you check a FPE website into VSS, VS warns that FPE aren’t going to be used anymore.

VSS 6.0

OK people, I’m planning to split this into two blogs, but it hasn’t happened yet.  I’m going to have a technical blog and non-technical blog.  In the meanwhile:

VSS Good
VSS can allow for multi-day rollbacks.

VSS Bad
VSS works best when all the team users are online and have continual access to the VSS server.  If they disconnect (say by working at home) or if the server is down, VSS gets ugly.

VSS has a reputation for corrupting data, and apparently this gets worse when dealing with disconnected scenarios.

VSS has a reputation for creating strife on teams, because of the exclusive check-out system.

VSS in some environments is overly chatty (too many message boxes)

Posted in VSS

VSS Notes for SQL

Set up SQL and VSS
You will need VSS6.0 client tools on your machine.
You need to install SQL Server first, then Visual Studio 2003 or Visual Studio 2003 server tools.
**Installing SQL Server second doesn’t seem to work.  If you install SQL Server second, you might need to re-run the Visual Studio installer.

Set up Connection to SQL
Find Server Explorer.
Add you favorite servers or connections.  When setting up this connection, use your SQL login and ID.
**The developer needs SQL Sysadmin rights (not admin rights on the whole box, just on the database, although a SQL Sysadmin can do what ever the SQL service account can do, with some effort)

Add Database to VSS
Using VS2003, expand a database, Right click on the ‘Stored procedures’ icon, select ‘Add to Source Control’
**You can’t check in views, functions or DDL.
You will get a warning that says your connection needs to be set up with SQL Sysadmin rights for things to work, which lets your developers do anything on the box.
You will be prompted to find the srcsafe.ini file for your VSS repository.
You will be prompted for a project name, **VSS ID and password.

Add Individual Objects to VSS
You will then need to right click on the relevant stored procedures to add them to VSS.
**You must close the store procedure before adding it to VSS.
**Hold shift to add multiple stored procedures all at a time.  This won’t work if any highlighted stored procedure is open in the editor.

Limitations
**Nothing prevents a user from opening the stored procedure in Query Analyzer and modifying it.
**Modifications can be saved to the database before they are committed to VSS
**The time when the VSS relevant context menu turns on and off is not intuitive.
**Attempting to check in/out objects from the VSS client gets strange behavior, since VSS expects you to be writing the DDL text to the file system, not to a database.

Articles
DBAZine weighs in on VSS This article suggests that we keep track of our stored procedures in a text directory, which has the advantage of being able to see differences between what you just saved, but didn’t check in and the copy you check out.  Otherwise you’d have to check in to compare.

Also, the use of keyword expansions
/*
$History: $
*/
The above would be turned into some automatically generated change time comments.

AllisonFamily has an article.  He tells of a story about not being able to hook up VSS to SQL after moving the database from one machine to the next.  Apparently the DB script generator doesn’t script everything VSS needs to talk to a database when you use Interdev.

However, he has a very good description of how to get VSS set up, not unlike the article at DBAZine.

I tried out the above, using VSS to write stored procedures saved as text files.  VSS knew that Visual Studio 2003 could open a .prc file, but VS2003 didn’t color the text until I changed the extension to .sql.  Then VS2003 wouldn’t allow me to design the SELECT blocks, which is the best SQL editor feature in VS2003.  If the stored procedure was opened directly from the database, then the designer for SELECT blocks works.