Issue Tracker Integration
Ankh.ExtensionPoints.IssueTracker namespace contains the abstract/base classes that are relevant to integrate with AnkhSVN issue tracker features. This extension point is available since version 2.1.7444 (official release).
Ankh.ExtensionPoints.IssueTracker.IssueRepositoryConnector
This is the entry point to your connector and represents a Visual Studio service that your VSPackage proffers (How to provide a service).
Your connector also needs to be registered under [Application Registry Root]/IssueRepositoryConnectors. AnkhSVN constructs the list of registered connectors from the entries under this registry key.
[Application Registry Root] for Visual Studio 2008 would be HKLM/SOFTWARE/Microsoft/VisualStudio/9.0
The registered connectors are displayed in the Issue Tracker Connector combobox on the Issue Tracker Configuration dialog.
The main responsibilities of a connector instance are;
Provides IssueRepositoryConfigurationPage (used in Issue Tracker setup),
Creates IssueRepository instance based on the given ?IssueRepositorySettings instance.
AnkhSVN asks the selected/current connector for an instance of Ankh.ExtensionPoints.IssueTracker.IssueRepositoryConfigurationPage that allows user to specify the connector specific settings.
Ankh.ExtensionPoints.IssueTracker.IssueRepositoryConfigurationPage
Extend this base class to provide the user interface for issue repository configuration. The implementation must provide a pointer to the System.Windows.Forms.UserControl instance via virtual IWin32Window Window { get; } read-only property.
AnkhSVN listens for OnPageEvent raised by the configuration page to enable/disable OK button. OnPageEvent is raised with an instance of Ankh.ExtensionPoints.IssueTracker.ConfigPageEventArgs as the argument.
Ankh asks for the IssueRepositorySettings instance via virtual IssueRepositorySettings Settings {get; set;} property once user clicks on the OK button.
Ankh.ExtensionPoints.IssueTracker.IssueRepositorySettings
RepositoryUri: Uri of the issue repository
RepositoryId: This property is optional and can be used to specify a specific repository at the given Repository Uri.
CustomProperties: a key,value map that represents the custom properties that your connector needs to connect to a specific repository.
Ankh.ExtensionPoints.IssueTracker.IssueRepository
The repository instance created based on the IssueRepositorySettings via (in Ankh.ExtensionPoints.IssueTracker.IssueRepositoryConnector):
/// <summary>
/// Creates an Issue Repository based on the settings.
/// </summary>
public abstract IssueRepository Create(IssueRepositorySettings settings);
IssueRepository extends IssueRepositorySettings base class. Ankh communicates issue repository related tasks to this instance. Some of the Issue Repository responsibilities are as follows:
Provides System.Windows.forms.Control instance that is displayed in ?PendingChanges/Issues tab,
Processes PreCommit event raised by Ankh (this is where you can modify the commit message entered by the user),
Processes PostCommit event raised by Ankh
- Provides the regular expression used to identify the issue ids within a text
- Responsible for navigating to an issue given an issue id (identified by the regular expression provided by it). Possible implementations might be;
- opening a web browser,
- opening a form,
- opening an editor.
Issue Repository Configuration Storage
Issue repository configuration settings are stored as custom SVN properties on the solution root folder. Using this approach, only one user should need to set the configuration on the solution. Once this is committed to the repository, other users will have their solution configured automatically on Checkout/Update (given that they have AnkhSVN and the relevant connector package installed).
Sample Issue Repository Connector
Download sample VS2008 solution here