How to create an adapter for the TFS Integration Platform - Appendix 1: Power Tips
Note: This post is part of a series and you can find the rest of the parts in the series index.
Throughout the series, I’ve shared a bunch of power tips for making this easier—and here’s a quick cheat sheet of them all.
From Part II: Getting Started
- Power Tip: Once you’ve completed the tools install, go into SQL Server and back up the TFSIntegrationPlatform database immediately. There aren’t just a few odd bugs lurking that may require it, but if you want to test in a clean environment, a restore is quicker than a reinstall.
- Power Tip: Make a common root for the TFS code and yours (in my case, I used
RangersCode) and then create subdirectories for both platform and your code (so I had My Production and MS Production folders underRangersCode). This keeps everything close for easier access later while keeping them separate, so you can identify them quickly.
From Part III: Overview of Adapters
- Power Tip: The
TraceManagerputs all its output into the log files, so make sure you never write sensitive information there.
From Part IV: IProvider
- Power Tip: Using Visual Studio 2010’s “Generate from usage” feature makes this stage of development much easier.
From Part V: Items (IMigrationItem & IMigrationItemSerializer)
- Power Tip: VC stands for Version Control, which refers to an adapter working with the source control aspects of the system. WI (work items) and WIT (work item tracking) are the same thing. File attachments in WI are not considered VC and must be handled by your WI adapter.
- Power Tip: When you’re downloading files via
IMigrationItem, you’re also responsible for creating the correct path. Ensure you’re creating the necessary directories—and checking whether they exist.
From Part VIII: IMigrationProvider
- Power Tip: In my implementation, I used
.NET’sPath.GetTempFileName()to get a temp location for the file. However, this creates an empty temp file by default, which the platform doesn’t like—so I deleted it first, then calledDownload. - Power Tip: For folder creation or file/folder deletion, you can use the
Pathproperty of the action to retrieve the folder name.
From Part IX: IServerPathTranslationService
- Power Tip: The neutral path (or canonical path, as it’s properly called) is a Unix-style path (e.g.,
/src/project/). However, these don’t follow all Unix path rules—for example,:is a valid character in the path.