CVS Integration Setup

The following instructions show how to set up a trigger script in CVS which will notify FogBugz whenever a check-in occurs that is related to a particular bug.  

Before proceeding, please locate the following files which you will use in a moment.  If you are a trial user, you can download the trial versions of these scripts by logging into FogBugz and clicking "Demo Source Control Integration" on the main menu.

You can use either Perl:
FogBugz\accessories\SourceControl\CVS\logBugData.pl

Or VBScript:
FogBugz\accessories\SourceControl\CVS\logBugData.vbs

This article describes using the Perl script, but using the VBScript script works the same way. If you use the Perl script you will need perl on the CVS Server. Linux normally comes with perl; there are also freely available versions of perl for Windows. 

1. Check out the CVSROOT directory.

[Image]

2. Create a file named bugz.txt. Type "BUGZID:", then hit enter, then hit enter again. You can see, highlighted below, that the cursor is two lines below the text. You want those carriage returns.

[Image]

3. Add this to the repository.

[Image]

4. Copy in logBugData.pl that you located earlier, and add it to the repository. Alternately you can use the .vbs version of the file if you don't want to use Perl.  

[Image]

5. (This step is not required for trial users.)  Edit the settings at the top of logBugData.pl shown below (they look basically the same in the .vbs version):

The settings are as follows:

  • Set $BUGZ_SERVER to the DNS name of the web server running FogBugz. Let's say your FogBugz URL is:
    http://www.example.com/FogBugz/
    Then you would set $BUGZ_SERVER to:
    "www.example.com"
  • Set $BUGZ_URL to the virtual path to your FogBugz installation. In the example above, it would be:
    "/FogBugz/"
    This is whatever name you chose when you ran FogBugz setup. Make sure to include the slash on either side.
    If FogBugz is running at the root of the website instead of a virtual directory just set it to a forward slash:
    "/"
  • If you are using the PHP version of FogBugz, change "cvsSubmit.asp" to "cvsSubmit.php".

6. Edit the file rcsinfo, adding one line at the end as shown below. Change the file path shown here so that it points to the bugz.txt file in your CVS repository on your CVS server (that you created in Step 2 but haven't checked in yet).

On Unix:  ALL $CVSROOT/path-to-repository/bugz.txt
On Windows:  ALL $CVSROOT\path-to-repository\bugz.txt

[Image]

7. Edit the file loginfo, adding one line at the end as shown below. Again, change the file path shown here to point to the logBugData.pl file in your CVS repository on your CVS server.

Using Perl on Unix:  ALL perl -s /path/to/cvs/logBugData.pl "%{sVv}"
Using Perl on Windows:  ALL perl -s C:\\path\\to\\cvs\\logBugData.pl "%{sVv}"
Using VBScript on Windows:  ALL cscript.exe C:\\path\\to\\cvs\\logBugData.vbs "%{sVv}"

[Image]

8. Edit the file checkoutlist, adding two lines at the end as shown in these examples:

Using Perl:

bugz.txt Error-bugz.txt
logBugData.pl Error-logBugData.pl

Using VBScript:

bugz.txt Error-bugz.txt
logBugData.vbs Error-logBugData.vbs

[Image]

9. Check in your changes.

[Image]

Each user will have to re-check out the source tree they are working on so that the "CVS: BUGZID:" line is added to the template for log notes. (Otherwise everything will still work, but they will have to remember to add BUGZID: manually each time they commit a change.)

10. If your CVS repository is on Unix make sure to set execute permissions on the logBugData.pl file.

11. Here's a screenshot of a check-in that successfully connected to FogBugz (this screenshot is of CVSNT on Windows, utilizing logBugData.vbs, that's why you see "Windows Script Host" poking its face in): 

Notice that it says "Adding bug info for Bug ID #1"! This means that when I view bug number 1 in FogBugz I see this now:

NOTE: If this is NOT your joyous experience right now, years of technical support have shown us that it's 99.9% percent likely that you diverged ever, ever, ever so slightly from the steps above. Maybe you put .pl instead of .vbs somewhere. Maybe you put a / instead of a \ somewhere. Maybe the path that you thought lead to your bugz.txt file does not actually lead to that file. Please go over all the above steps pretending you are CVS trying to execute everything step by step. We find that lots of patience usually does the trick, especially when followed by lots of cookies afterwards.