Subversion Notify for Windows

Michael McKechney (michael@subversionnotify.com)
Updated For: Subversion Notify for Windows v2.1.0
Copyright ©2007-2009

Subversion Notify for Windows is an open source project administered by Michael McKechney on SourceForge.net

 

Contents

Introduction. 3

Summary. 3

Key Features. 3

Installation – “hooking into Subversion”. 4

Quick Start 4

Send an e-mail after commits. 4

Check for a log message prior to allowing a commit 5

Integrate with Bugzilla. 6

Custom Format Tokens. 7

General Settings. 7

subversionNotifyConfig (global settings) 7

Subversion Executable Path. 8

Mail Server. 9

Repository Path Control 9

RepoPathConfig. 10

MailTo. 10

DefaultLogMessage. 12

Execute. 12

CommitterExclusions. 13

Commit Requirements. 14

CommitRequirements. 14

CommitRequirement 15

FileTypeTagCheck. 16

FileTypeExclusion. 17

FolderNameExclusion. 18

Full Repository Control Elements. 19

Locked Paths. 19

User Mappings. 20

Pre-Property Change Check. 20

EMailGroup. 21

PreCommitFailureMessage. 22

Item Tracking and Control - General 23

Summary. 23

ItemTrackerRegistration. 23

ItemTrackers. 24

ItemFindRegex and ItemLinkURL. 25

AllowedProducts. 25

DisallowedStatuses. 26

LockedItems. 27

ItemUpdater. 28

Item Tracking and Control - Bugzilla. 29

Summary. 29

XmlRpcConfig. 29

WebProxyCredentials. 30

Item Tracking and Control - Rally. 30

Summary. 30

RallyConfig. 31

WebServiceConnection. 31

Item Tracking and Control – HP Quality Center. 32

Summary. 32

QualityCenterConfig. 33

DbConnection. 33

Subversion Notify Utility. 33

Summary. 33

Implementation note: 34

 

Introduction

Summary

Subversion Notify is small executable that enables Subversion source control administrators, through a simple configuration file, to be able to control multiple repository paths for all pre- and post-commit hooks, enforcing commit regular expression requirements, integration with bug and task tracking systems and e-mail notification.

Key Features

Control at folder level

By using multiple <RepoPathConfig> elements, you have the granular control to alter the hook checks at any folder level. (Check out the sample SubversionNotify.cfg for set-up examples included in the download package)

Pre-commit checks

Post-commit processing

Pre-Prop change hook

User Mapping

 

Installation – “hooking into Subversion”

  1. Download the latest version of Subversion Notify from SourceForge.net
  2. Unzip the package into the directory of your choice
  3. Copy the included pre-commit.batpost-commit.bat and pre-revprop-change.bat to the hooks folder of your repository (or repositories, you can configure as many as you want!)
  4. Edit the batch files to correctly reflect the installation location of the SubversionNotify.exe file you just extracted.
  5. Configure the SubversionNotify.cfg file as appropriate (see this later in this manual for quick start examples and detailed implementations). To assist you in creating a well formed XML configuration, the Schema file (SubversionNotifyConfig.xsd is included in the download)

Quick Start

Examples of simple configurations to get you started using Subversion Notify. Before using any of them, make sure you modify at least the SVNConfig element to point to your Subversion installation.

Send an e-mail after commits

The sample configuration below will send an e-mail for all commits made to any repository that is hooked into Subversion Notify. It does not filter by repository, path or file type. For these more advanced features, see the sections for RepoPathConfig, Mailto and Custom Format Tokens. To use this template, be sure to change the MailServer and E-mail address settings.

<?xml version="1.0standalone="yes"?>
<subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsdLoggingLevel="INFOMaximumEMailSizeInMb="5MaximumEmailSubjectChars="255">
    <!-- Basic configuration of where to locate the SVN executables -->
    <SVNConfig ExePath="C:\Program Files\Subversion\bin\svnlook.exe" />
     
    <!-- Configure your mail server. Needed for e-mail notifications -->
    <MailServer Name="smtp.mydomain.comUsername="" Password="" ADGlobalCatalog="mydomain.com" FromAddress="fromaddress@mydomain.com"/>
     
    <!-- An example 2-types of e-mail: to a specific user and to a distribution group. Also demonstrates custom e-mail formats.-->
    <RepoPathConfig ControlledPaths="/">
       <MailTo EMailGroupName="Managers"  EMailType="HTML" />
       <MailTo EMailAddress="custom@mydomain.comEMailType="Custom" CustomSubjectFormat="#user# - #fileNames#CustomEmailTemplateFile="customemail.txt" />    
   </RepoPathConfig>

    <EMailGroup Name="Managers">
        <EMail Address="email3@mydomain.com" />
        <EMail Address="email4@mydomain.com" />
    </EMailGroup>

</subversionNotifyConfig>

Check for a log message prior to allowing a commit

This configuration checks that the user has added a message along with their commit via the CommitRequirements element. If no comment is added, the commit will fail and the user will get the failure message explaining why. This also demonstrates that you can have more than one CommitRequirement element. At least one will need

<?xml version="1.0standalone="yes"?>
<subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsdLoggingLevel="INFOMaximumEMailSizeInMb="5MaximumEmailSubjectChars="255">
    <!-- Basic configuration of where to locate the SVN executables -->
    <SVNConfig ExePath="C:\Program Files\Subversion\bin\svnlook.exe" />
          
    <!-- An example of a simple commit requirement – the user needs to add some commit message-->
    <RepoPathConfig ControlledPaths="/">
       <CommitRequirements>
          <!--This simple Regular Expression makes sure at least something was typed. Make the pattern more complex to meet you own needs. -->
          <CommitRequirement Description="A commit log message is requiredRegex="\w"
                  RegexFailureMsg="A commit log message is required. Please enter a log message" RegexIgnoreCase="true" />


          <!--This simple Regular Expression makes sure the message is at least 10 characters. Make the pattern more complex to meet you own needs. -->
          <CommitRequirement Description="A longer commit message is requiredRegex=".{10}"
                  RegexFailureMsg="A log message of at least 10 characters is required!" RegexIgnoreCase="true" />

       </CommitRequirements> 
   </RepoPathConfig>

</subversionNotifyConfig>

 

Integrate with Bugzilla

This configuration integrates your Subersion with Bugzilla. Assuming the repository is configured with pre-commit processing (see Installation), this configuration will in enforce:

·         The commit message includes a “bug tag” ” [Bug ###] (via the the Regex in the CommitRequirement section)

·         The bug item is not in the RESOLVED status (via the Bugzilla section DisallowedStatuses sub-element)

When configured with post-commit processing, the bug will be updated with a new public comment with the default update message format (see the Bugzilla section for details)
Before using this, you will want to change the XmlRpcConfig section to match your Bugzilla installation. Note that your username and password can be encrypted using the SubversionNotify.Utility.exe

 

<?xml version="1.0" standalone="yes"?>

<subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd" LoggingLevel="DEBUG" MaximumEMailSizeInMb="5" MaximumEmailSubjectChars="255">

       <!-- Basic configuration of where to locate the SVN executables -->

       <SVNConfig ExePath="C:\Program Files\VisualSVN Server\bin\svnlook.exe" />

       <!-- Register the Bugzilla plug-in -->

       <ItemTrackerRegistration>

              <Registration ElementName="BugzillaConfig" AssemblyName="SubversionNotify.Integration.Bugzilla.dll"/>

       </ItemTrackerRegistration>

       <RepoPathConfig ControlledPaths="/">

              <CommitRequirements>

                     <!--This enforces that the commit be associated with a Bugzilla bug via adding a [Bug ###] tag to the message-->

                     <CommitRequirement Description="A commit log message is required" Regex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]"

                           RegexFailureMsg="A Bugzilla item tag is required for commit. Please reference it via a [Bug ###] tag in your commit message"

RegexIgnoreCase="true" />

              </CommitRequirements>

              <ItemTrackers>

                     <!-- Configure the Bugzilla integration -->

                     <BugzillaConfig

                                  ItemLinkURL="http://landfill.bugzilla.org/bugzilla-3.2-branch/show_bug.cgi?id={0}"

                                  ItemFindRegex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" >

                           <XmlRpcConfig Host="landfill.bugzilla.org" Port="443" Path="bugzilla-3.2-branch"

                                         BugzillaUserId="michael@subversionnotify.com"

                                         BugzillaPassword="baKvK4982FJCavbtvJzsng==" UseSSL="true" />

 

                           <DisallowedStatuses>

                                  <DisallowedStatus Name="RESOLVED" RepoPathException=""/>

                           </DisallowedStatuses>

                           <ItemUpdater IsPrivate="false" />

                     </BugzillaConfig>

              </ItemTrackers>

       </RepoPathConfig>

</subversionNotifyConfig>

 

Custom Format Tokens

Throughout the configuration file, there are opportunities for you to customize the output from the Subversion Notify tool. This is accomplished by using replacement tokens. The list of defined replacement tokens and the content type that will be inserted is as follows:

#user# - the subversion login ID of the user who has made the commit

#userId# - same as above, the login ID of the user
#commitMessage# - the commit message entered for this revision
#revision# - the revision number of the revision just created with the commit
#fileNames# - comma delimited file name list of the files committed (no path information, just file names)
#filesWithPaths# - comma delimited file list with full repository path information
#repoPhysicalPath# - physical repository path that was committed to

#repository# - same as above, the physical repository path.
#date# - date and time of the commit
#controlledpaths# - the list of RepoConfig ControlledPath values that applied for the commit

#itemNumber# - when using an ItemTracker, this is the item number that was found.

 

General Settings

subversionNotifyConfig (global settings)

Example:

<subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd" LoggingLevel="DEBUGMaximumEmailSubjectChars="255" MaximumEMailSizeInMb="3ConcatPreCommitFailures="true">

Properties

Mandatory: Yes
Occurrence: Once only

Attributes

This is an attribute off of the root <subversionNotifyConfig> element that will set the amount of logging that will be included in the SubversionNotify.log file.

§  LoggingLevel - optional. Sets the amount of logging that will be included in the SubversionNotify.log file.  Allowed values include:
ERROR - this is least verbose level of logging, only recording error and exception messages
INFO - (default if not specified) A good level of logging that adds informational message to the log plus error messages 
DEBUG - the most verbose level. Includes all ERROR and INFO messages plus additional messages that are used solely to aid in the testing and debugging of the application.

§  MaximumEmailSizeInMb - optional. Will set the maximum size allowed for the HTML body. If it exceeds this limit, the program will Zip the HTML content and attach it to the e-mail. If even the Zip exceeds the limit, a generic message will be sent, referring the recipient to the Subversion log for details. Decimal value, default is 5.0 for 5Mb maximum size

§  MaximumEmailSubjectChars  - optional. Limits the length of the e-mail subject text. Some e-mail clients need this to be set in order to properly display the subject.
Integer value, default is 255 characters.

§  ConcatPreCommitFailures - optional. Determines whether or not the commit will fail upon finding the first pre-commit check failure (when set to false), or continue processing and concatenate the full list if failures that will then be presented to the user (when set to true).
The default it true so that the users can try to correct all the failures before attempting the next commit.

Subversion Executable Path 

Purpose:

Sets the path to the Subversion executable. For a standard installation, this will be:   C:\program files\subversion\bin\svnlook.exe,  however it should be set to the correct path as per the installation.

Hierarchy:

Child of <subversionNotifyConfig>

Example:

<SVNConfig ExePath="c:\program files\subversion\bin\svnlook.exe" />

Properties

Mandatory: Yes
Occurrence: Once only

Attributes

 

Mail Server

Purpose:

Sets the parameters for the mail server that will be the host for outgoing e-mail messages.

Hierarchy:

Child of <subversionNotifyConfig>

Example:

<MailServer Name="mailsrv.mydomain.com" Username="un" Password="pwADGlobalCatalog="mydomain.com" FromAddress="mail@mydomain.comEMailSubjectTag="[SVN]" UseSecureConnection="true"/>

Properties

Mandatory: Yes
Occurrence:
Once only

Attributes

·         Name - required. Defines the name of the target mail server.

 

Repository Path Control

RepoPathConfig

Purpose

The root element for defining Pre and Post Commit hook configurations. You can define 1-N number of these elements to provide full granular control over your repository.

Hierarchy

Child of <subversionNotifyConfig>

Example

<RepoPathConfig ControlledPaths="/branches/latestBranch" ControlledRepos="D:/myRepos,E:/theirRepos" ExcludeFromPrecedenceFilter="true">

Properties

Mandatory: Yes. At least 1 RepoPathConfig element is required
Occurrence: One or more

Attributes:

** If either of these values is set to DEFAULT, then this configuration will be used if there are no other matches by path and repository. **

 

MailTo

Purpose

Sets the "To" mail target for sending of the post-commit e-mails. There can be 1-N number of MailTo elements.

Hierarchy

Child of <RepoPathConfig>

Example

<MailTo EMailAddress=”michael@mckechney.comEMailGroup="group1" EMailType="HTML" EMailSuppressionChar="~" FileNameRegex="\.cs" RegexIgnoreCase="true" />

<MailTo EMailAddress=”custom@mydomain.comEMailType="Custom" CustomSubjectFormat="#user# - #fileNames#" CustomEmailTemplateFile="customemail.txt" FileNameRegex="\.pdf" RegexIgnoreCase="true" />

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

 

Keep in mind that your e-mail client may truncate overly long subject lines. You can use the top level MaximumEmailSubjectChars setting as described in the General Settings section to manually set a maximum length

 

DefaultLogMessage

Purpose

If no commit message is specified and there are no Commit Requirements specified, this is the message that will be automatically added to the notification e-mail.

Hierarchy

Child of <RepoPathConfig>

Example

<DefaultLogMessage Text="#user# has decided not to add a log message. "/>

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

·         Text - required. Sets the default message that will be added to the commit message. The token #user# can be added to insert the user id of the committer

Execute

Purpose

Defines a target external process to run after the commit has successfully passed all requirements and before the notification e-mail has been sent out. The commit will not continue until this process has completed. A non-zero return code will cause the error message to be written to the log file.

Hierarchy

Child of <RepoPathConfig>

Example

<Execute Application="C:\PathTwo.bat" CommandLine="#revision# #userid# #controlledpaths#" FileNameRegex="\.cs" LogRegex="^merge" RegexIgnoreCase="true"/>

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

NOTE: If you do not add either regex values, the execute will process be default unless a CommtterExclusion is found (see below)

CommitterExclusions

Purpose

Allows you to configure individual users to be excluded from producing e-mail alerts and/or executing the external process directives as specified in the Execute element(s).

Hierarchy

Child of  <RepoPathConfig>

Example

<CommitterExclusions>
      <CommitterExclude SvnID="mmckechn" CommitterExclusionType="EmailAndProcessExecution"/>
</CommitterExclusions>

Properties

Mandatory: No
Occurrence: Only 1 element per RepoPathConfig element allowed

Attributes

 None

Child Elements

§  CommitterExclude – required (1-n child elements allowed) 

Attributes

 

Commit Requirements

 

CommitRequirements

Purpose

Defines the section that controls the required format and content of commit messages and file types before the commit can be completed.

Hierarchy

Child of <RepoPathConfig>

Example 

<CommitRequirements FailureMessage="A Bug/Enhancement number was not specified.">
   <!—One or more commit checks-->
</CommitRequirements>

Properties

Mandatory: No
Occurrence: Only 1 element per RepoPathConfig element allowed

Attributes
Child Elements:

 

CommitRequirement

Purpose

Defines a commit message requirement either by regular expression match. If there are more than one of these elements specified, only 1 requirement will need to match in order to allow the commit.

Hierarchy

Child of <CommitRequirements>

Example

<CommitRequirement Description="Merge tag" Regex="\[merge\]" RegexFailureMsg="When performing a merge, a [merge] tag is required"
  SecondaryRegex="(http://|svn://|https://).+r\d+.to.r\d+"   SecondaryRegexFailureMsg="Merge requires:[merge] http://server/branch r## to r##)" RegexIgnoreCase="true"/>

Properties

Mandatory: Yes
Occurrence: One or more

Attributes

 

FileTypeTagCheck

Purpose

Sets a rule defining the types of files that can only be committed to the repository with a special commit tag. It is designed to remind committers these file types are "special" and should only be committed with full consideration.

Hierarchy

Child of <CommitRequirements>

Example

<FileTypeTagCheck Description="Resx Files" Regex="\[Add Resx File\]" FileExtension=".resx" FailureMessage ="Committing .resx files, requires [Add Resx File] tag."
   ControlledActionType="All" RegexIgnoreCase="true"/>

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

 

FileTypeExclusion

Purpose

Defines file types that are not allowed to be committed to the repository. This is a server side implementation of the "ignore" client property setting.

Hierarchy

Child of <CommitRequirements>

Example

<FileTypeExclusion Description="IdentCache Files" FileExtension=".identcache"/>

<FileTypeExclusion Description="Temporary Files" FileNameRegex="\w*\.~\w*" FailureMessage="Commits of files of the format 'name.~ext' are not allowed." ControlledActionType="Update" RegexIgnoreCase="true"/>

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

 

FolderNameExclusion

Purpose

Defines folder paths that if found in the source files being committed, will cause the commit to fail.

Hierarchy

Child of <CommitRequirements>

Example

<FolderNameExclusion Description="Obj folder" FolderName="obj" FailureMessage="obj folder contents can not be committed" ControlledActionType="All"/>

<FolderNameExclusion Description="Tilde folders" FolderNameRegex="\w*\.~\w*" FailureMessage="Folders with a '~' are not allowed" ControlledActionType="All" RegexIgnoreCase="true"/>

Properties

Mandatory: No
Occurrence: Zero or more

Attributes

 

Full Repository Control Elements

These elements set additional control parameters for the entire repository.

Locked Paths

Purpose

Allows your to define one or more repository paths as being closed (locked) against further commits. This useful to prevent accidental commits to retired branches. The LockedPaths element has no attributes defined.

Hierarchy

Child of <subversionNotifyConfig>

Example

<LockedPaths>
   <LockedPath RepoPath="ProductTwo" ControlledRepos="D:/MyRepo"/>
</LockedPaths>

 

Properties

Mandatory: No
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes

None

Child Elements

·         LockedPath - required (1 - n  child elements allowed)

LockedPath Attributes

User Mappings

Purpose

Defines a mapping between a Subversion ID and an Active Directory account ID. This is useful when your Subversion ID's are not the same as the AD accounts, but you would still like the e-mails to be send "from" the committer's e-mail address.

Hierarchy

Child of <subversionNotifyConfig>

Example

 <UserMappings>
      <UserMapping ActiveDirectoryID="mckechney" SvnID="mike"/>
 </UserMappings>

Properties

Mandatory: No
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes

None

Child Elements

§  UserMapping – required (1 - n  child elements allowed)

UserMapping Attributes

 

Pre-Property Change Check

Purpose

Defines how a pre-property change hook call should be processed. This is used in conjunction with the "pre-revprop-change.bat" hook batch file.

Hierarchy

Child of <subversionNotifyConfig>

Example

<PrePropChangeRequirements  FailureMessage="A revision comment may only be changed if it includes an item number">
       <PrePropChangeRequirement Description="Bug NumberRegex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" IsBugMatch="trueRegexIgnoreCase="true"/>
</PrePropChangeRequirements>

Properties

Mandatory: No
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes
Child Elements

§  PrePropChangeRequirement – required (1-n child elements allowed) 

PrePropChangeRequirement Attributes

 

EMailGroup

Purpose

Defines a reusable distribution list for e-mail notification. This list usage is set by the <Mailto> element.

Hierarchy

Child of <subversionNotifyConfig>

Example

<EMailGroup Name="group1">
   <Email Address="developer1@mail.com" DisplayName="Mike"/>
   <Email Address="worker2@mail.com" DisplayName="John"/>
</EMailGroup>

Properties

Mandatory: No
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes

 

Child Elements

§  Email required (1-n child elements allowed) 

Email Attributes:

 

PreCommitFailureMessage

Purpose

Let administrators get an e-mail whenever a pre-commit check fails. The e-mail includes the DEBUG level logging text related to the attempted commit. 

Hierarchy

 Child of <subversionNotifyConfig>

Example

<PreCommitFailureMessage>
     <MailTo EMailAddress="michael@mckechney.com" EMailGroupName="Developers" CustomSubjectFormat="[SVN Precommit Failure] #user# :: #commitMessage#" />
</PreCommitFailureMessage>

Properties

Mandatory: No
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes

None

Child Elements

§  MailTo – required (1-n child elements allowed) 

MailTo Attributes

Same as the <MailTo> element used in the <RepoPathConfig> element with the following limitations:

 

 

Item Tracking and Control - General

Summary

Item tracking allows you to integrate with task and bug tracking systems via a simple plug-in style configuration. The tool comes with 3 "out of the box" integrations:

Each integration inherits functionality from the integration base and this functionality is exposed via common XML attributes and elements in each configuration section.

ItemTrackerRegistration

Purpose

Registers the item tracking plug-in with Subversion Notify.

Hierarchy

Child of  <subversionNotifyConfig>

Example

<ItemTrackerRegistration>
    <Registration ElementName="BugzillaConfigAssemblyName="SubversionNotify.Integration.Bugzilla.dll"/>
    <Registration ElementName="QualityCenterConfigAssemblyName="SubversionNotify.Integration.QualityCenter.dll"/>
    <Registration ElementName="RallyConfigAssemblyName="SubversionNotify.Integration.Rally.dll"/>
</ItemTrackerRegistration>

Properties

Mandatory: No (Yes, if you plan on integrating an item tracker) 
Occurrence: Only 1 element per subversionNotifyConfig element allowed

Attributes

None

Child Elements

§  Registration – required (1-n child elements allowed) 

Registration Attributes

 

 

ItemTrackers

 Purpose

This is the container element for the registered item tracker base elements.

Hierarchy

Child of  <RepoPathConfig>

Example

<ItemTrackers>
    <BugzillaConfig>...</BugzillaConfig>
    <QualityCenterConfig>...</QualityCenterConfig>
    <RallyConfig>...</RallyConfig>
</ItemTrackers>

Properties

Mandatory: No (Yes, if you plan on integrating an item tracker) 
Occurrence: One or more

Attributes

None

Child Elements

Any element defined in the ItemTrackerRegistration element (1-n child elements allowed) 

 

ItemFindRegex and ItemLinkURL

Purpose

 ItemFindRegex - required. Specifies the regular expression that will be used to search the commit message. If found, it sets the flag that this item tracking integration applies for this commit and the appropriate checks and data retrieval will take place.

ItemLinkURL - optional. The link format to be used when creating the HTML notification message. This will provide a direct hyperlink to the tracking item from the e-mail message. If omitted, no hyperlink is created.

Hierarchy

An attribute of the root integration element. <Bugzilla>, <QualityCenter>, <Rally>

Example

<BugzillaConfig ItemLinkURL="http://mydomain.com/bugzilla/show_bug.cgi?id={0}" ItemFindRegex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" >

 

AllowedProducts

Purpose

Provides for a check against the item tracking system to make sure that the commit is allowed against the items specified product/project. If this element is not specified, there is no check against products.

 

Hierarchy

An attribute of the root integration element. <Bugzilla>, <QualityCenter>, <Rally>

Example

<AllowedProducts>
   <AllowedProduct Name="ProductOne"/>
   <AllowedProduct Name="Rewrite"/>
</AllowedProducts>

Properties

Mandatory: No
Occurrence: One or more

Attributes

None

Child Elements

·         AllowedProduct – mandatory (1-n child elements allowed)

AllowedProduct Attributes:

·         Name - required. The name of the product/project that is allowed for the controlled repository path.

DisallowedStatuses

Purpose

Provides for a check against the item tracking system to make sure that the item is not in a prohibited status. If it is found to be in a disallowed status, the commit will fail. If this element is omitted, no status check will be made.

Hierarchy

An attribute of the root integration element. <Bugzilla>, <QualityCenter>, <Rally>

 Example

<DisallowedStatuses>
  <DisallowedStatus Name="CLOSED" RepoPathException="Test" UserException="mmckechney,user"/>
  <DisallowedStatus Name="RESOLVED" RepoPathException=""/>
</DisallowedStatuses>

Properties

Mandatory: No
Occurrence: One or more

Attributes

None

Child Elements

·         DisallowedStatus –required  (1-n child elements allowed) 

DisallowedStatus Attributes

 

LockedItems

Purpose

Provides a place to always prevent commits against specific items

Hierarchy

An attribute of the root integration element. <Bugzilla>, <QualityCenter>, <Rally>

Example

<LockedItems>
   <Item ItemId="1000"/>
   <Item ItemId="1002"/>
</LockedItems>

Properties

Mandatory: No
Occurrence: One or more

Attributes

None

Child Elements

·         Item – required (1-n child elements allowed) 

Item Attributes

 

ItemUpdater

Purpose

Allows for updating of the tracker item via whatever method is provided by the particular tracker.

Hierarchy

An attribute of the root integration element. <Bugzilla>, <QualityCenter>, <Rally>

Example

<ItemUpdater IsPrivate="false">
       <MessagePattern>
Committed by: #userId#
Commit Message: #commitMessage#

       </MessagePattern>
<ItemUpdater>

Properties

Mandatory: No
Occurrence: One or more

Attributes
Child Elements

·         MessagePatternoptional.  (1 child elements allowed). This element allows you to specify what will be included in the update message. You can use any text (assuming it is XML compliant) and the replacement tokens defined for the application. If omitted, the default format is:

Revision:       #revision# [#repository#]

Commited By:    #userId#

Commit Date:    #date#

Commit Message: #commitMessage#

File List:

#filesWithPathsAndChangeType#

Item Tracking and Control - Bugzilla

Summary

Bugzilla integration, inherits from the base integration functionality described in the Item Tracking and Control section of the manual. This includes, checking for allowed products/projects, disallowed item statuses, locked items and item updating.

Specific to the Bugzilla plug-in are the <XmlRpcConfig> and <WebProxyCredentials> elements. These configure the XML-RPC service endpoint that will be used to gather data and provide updates into Bugzilla (note: this requires Bugzilla version 3.+) and any credentials needed to go through a web proxy respectively.

Remember to register the plug-in via the <ItemTrackerRegistration> element.

Hierarchy

Child of <ItemTrackers>

Example

<BugzillaConfig  ItemLinkURL="http://mydomain.com/bugzilla/show_bug.cgi?id={0}
       ItemFindRegex="\[b?u?g? ?#?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" >

   <XmlRpcConfig Host="landfill.bugzilla.org" Port="443" Path="bugzilla-3.2-branch" BugzillaUserId="myUserId@email.com"                                         BugzillaPassword="myBugzillaPassword UseSSL="true" />

   <WebProxyCredentials ProxyUserId="myproxyid" ProxyPassword="myproxypassword"/>

   <AllowedProducts>
      <AllowedProduct Name="ProductOne"/>
   </AllowedProducts>

   <DisallowedStatuses>
      <DisallowedStatus Name="CLOSED" RepoPathException="Builds"/>
      <DisallowedStatus Name="RESOLVED" RepoPathException=""/>
   </DisallowedStatuses>

   <LockedItems>
      <Item ItemId="1000"/>
      <Item ItemId="1002"/>
   </LockedItems>

   <ItemNotification EMailAddress="system@email.com" SubjectFormat="Bug ##itemNumber#"
       AddedBodyText="Updated by Subversion Notify" />

</BugzillaConfig>

XmlRpcConfig

Purpose

Manadatory. Configures the XML-RPC service endpoint and credentials required to make connection. This connection is used to retrieve item information from Bugzilla as well as update information on the item

Attributes

·         Hostrequired. The DNS name or IP address of the Bugzilla server. Just enter the value, do not prefix with http://.

·         Pathconditionally optional. If your Bugzilla instance is not the root web site, add the remaining path information to the site here. For instance the Bugzilla “landfill” site is in a sub-directory so the values for Host and Path are: Host=”landfill.bugzilla.org” and Path=”bugzilla-3.2-branch

·         Portoptional. The port that Bugzilla is found on. Usually 80 if you connect to the site via http and 443 if you connect via https. Default is 80.

·         UseSSL optional. Sets whether or not the connection uses SSL secure connection to connect to Bugzilla (yes, you need to set this even if you specify a port value of 443).  Default is false

·         BugzillaUserID required. The user id/account that you want to use. This account needs to have access to both read bugs as well as add comments to bugs.

·         BugzillaPassword required. The password for the above account

WebProxyCredentials

Purpose

Optional. If you need to connect to Bugzilla through a proxy server that required authentication, you can provide the credentials

Attributes

·         ProxyUserIdrequired. The user ID to be accepted by the Web Proxy for authentication.

·         ProxyPasswordrequired. The password for the above ID.

 

Item Tracking and Control - Rally

Summary

Rally integration, inherits from the base integration functionality described in the Item Tracking and Control section of the manual. This includes, checking for allowed products/projects, disallowed item statuses, locked items and item notification.

Specific to the Rally plug-in are the ItemType and WorkspaceNameattributes as well as the <WebServiceConnection> elements that are described below.

Remember to register the plug-in via the <ItemTrackerRegistration> element.

Example

<RallyConfig ItemFindRegex="\[t?a? ?([0-9]+(?:\s*,?\s*[0-9]+)*)\]" ItemType="Task"
    WorkspaceName="WorkSpace1" IncludeParentItemSummary="true">

   <WebServiceConnection URL="https://myserver:443/slm/webservice/1.05/RallyService"
      UserName="yZptbWeXsjS7tBvSHnxf8Aio51g9xQLXfzJ3cGfQNmI="
      Password="tBFogQ9xMiBuTIxi5c5nLg==" />

   <AllowedProducts>
      <AllowedProduct Name="Product1"/>
   </AllowedProducts>

   <DisallowedStatuses>
     <DisallowedStatus Name="Completed"/>
   </DisallowedStatuses>

  <LockedItems>
    <Item ItemId="323"/>
    <Item ItemId="333"/>
  </LockedItems>

   <ItemNotification EMailAddress="system@email.com" SubjectFormat="Task ##itemNumber#" AddedBodyText="Updated by Subversion Notify" />

</RallyConfig>

 

RallyConfig

purpose

Sets the attributes that will be used for Rally integration

Hierarchy

Child of <ItemTrackers>

Attributes

·         ItemType – required. Sets the item type that will be queried from Rally. The two valid types are Task and Defect.

·         WorkspaceNamerequired. . Sets the name of the Rally workspace that will be queried.

·         IncludeParentItemSummary – optional. Sets whether or not the summary text of the parent User Story should be included with the retrieved text of the Rally task or defect. This can be useful if your tasks are fairly generically named. Default it false

 

WebServiceConnection

Purpose

Required. Defines the parameters that will be used to call the Rally open API web service

Attributes

§  URL - Required. Sets the URL for the Rally web service.

Item Tracking and Control – HP Quality Center

Summary

HP Quality Center integration, inherits from the base integration functionality described in the Item Tracking and Control section of the manual. This includes, checking for allowed products/projects, disallowed item statuses, locked items and item notification. This integration utilized a direct database connection to the Quality Center Oracle database. As such, you need to define the database server connection parameters as well as the "bug" table that should be queried.

Specific to the Quality Center plug-in is the <DbConnection> element and the ItemTableName attribute described below.

Remember to register the plug-in via the <ItemTrackerRegistration> element.

Hierarchy

Child of <ItemTrackers>

Example

<QualityCenterConfig ItemFindRegex="\[t?d? ?([0-9]+(?:\s*,?\s*[0-9]+)*)\]ItemTableName="MyDatabase.BUG" >

 <DbConnection UserName="cgsps9ZYHP8X5tIwXsTnIQ==" Password="yUjmskyRQteYxpapnSuTRQ==" sid="sidvalue"/>

 <AllowedProducts>
    <AllowedProduct Name="Product2"/>
 </AllowedProducts>

 <DisallowedStatuses>
   <DisallowedStatus Name="Closed" RepoPathException="Test"/>
   <DisallowedStatus Name="Fixed" RepoPathException=""/>
 </DisallowedStatuses>

 <LockedItems>
   <Item ItemId="6104"/>
   <Item ItemId="3002"/>
 </LockedItems>

 <ItemNotification EMailAddress="system@email.com" SubjectFormat="Bug ##itemNumber#"
       AddedBodyText="Updated by Subversion Notify" />

</QualityCenterConfig>

 

 QualityCenterConfig

purpose

Sets the attributes that will be used for HP Quality Center integration

Hierarchy

Child of <ItemTrackers>

Attributes

§  ItemTableName - Required. Sets the table name where the tracking items (defects in Quality Center vernacular) are found.

DbConnection

Purpose

Required. Defines the database connection that will be used to connect to the HP Quality Center Oracle database.

Hierarchy

Child of the <QualityCenterConfig> element


Attributes

 

Subversion Notify Utility

Summary

This utility is a very basic tool to create encrypted usernames and passwords that can be used in the Item Tracking and Control integrations. It works by first creating an encryption text file named EncryptionFile.txt that will act as the "key" for the 2-way encryption. It then uses this file for the processing.

This file must be placed in the same directory as SubversionNotify.exe for the tool to be able to decrypt the text. If this file is modified in any way, you will need to re-run the Utility to regenerate the text file as well as the encrypted user names and passwords.

 

http://svnnotifyforwindows.googlepages.com/utility_screenshot.JPG/utility_screenshot-large.JPG

 

Implementation note:

The utility required the .NET Framework 3.5 to be installed on the running computer.

 

Michael McKechney

www.mckechney.com

sflogo.php?group_id=207825&type=1