Integration with Bug Tracking System/problem tracking

Source: Internet
Author: User
Tags bug id bug tracking system subversion client tortoisesvn
Integration with Bug Tracking System/problem tracking

In software development, modification depends on a bug or problem number. Users of the Bug Tracking System (problem tracker) like to associate the modification of the subversion with a specified number in the problem tracking. Therefore, many problem trackers provide a pre-submitted hook script to analyze logs and find the submitted bug numbers. This is slightly less reliable, because it relies on the user to write the full log, the pre-commit Hook can be correctly analyzed.

Tortoisesvn can help users in two aspects:

  1. When a user inputs the log information, a well-defined line containing the question number is automatically added. This reduces the risk that the problem numbers entered by users cannot be correctly analyzed by the bug tracking system.

    Or tortoisesvn highlights the parts that can be recognized by the problem tracker in the log message. In this way, the user will know that the log message can be correctly parsed.

  2. When the user browses the log information, tortoisesvn creates a link in the log information pointing to each bug mark, which can be opened in a browser.

Adding issue numbers to log messages

You can integrate a bug tracking tool of your choice in tortoisesvn. To do this, you have to define some properties, which startbugtraq:. They must be set on folders: ("Project Settings" Section)

There are two ways to integrate tortoisesvn with issue trackers. One is based on simple strings, the other is based onRegular Expressions. The properties used by both approaches are:

Bugtraq: URL

Set this property to the URL of your bug tracking tool. It must be properly URI encoded and it has to contain%BUGID%.%BUGID%Is replaced with the issue number you entered. this allows tortoisesvn to display a link in the log dialog, so when you are looking at the revision log you can jump directly to your bug tracking tool. you do not have to provide this property, but then tortoisesvn shows only the issue number and not the link to it. e. g The tortoisesvn project is usinghttp://issues.tortoisesvn.net/?do=details&id=%BUGID%

You can also use relative URLs instead of absolute ones. this is useful when your issue tracker is on the same domain/server as your source repository. in case the domain name ever changes, you don't have to adjustbugtraq:urlProperty. There are two ways to specify a relative URL:

If it begins with the string^/It is assumed to be relative to the repository root. For example,^/../?do=details&id=%BUGID%Will resolvehttp://tortoisesvn.net/?do=details&id=%BUGID%If your repository is located onhttp://tortoisesvn.net/svn/trunk/.

A URL beginning with the string/Is assumed to be relative to the server's hostname. For example/?do=details&id=%BUGID%Will resolvehttp://tortoisesvn.net/?do=details&id=%BUGID%If your repository is located anywhere onhttp://tortoisesvn.net.

Bugtraq: warnifnoissue

Set thistrue, If you want tortoisesvn to warn you because of an empty issue-number text field. Valid values aretrue/false.If not defined,falseIs assumed.

Issue number in text box

In the simplest method, tortoisesvn displays a separate Bug ID input field for the user, and an additional line of user input log information is expected to be added later.

Bugtraq: Message

This property activates the Bug Tracking System inInput FieldMode. if this property is set, then tortoisesvn will prompt you to enter an issue number when you commit your changes. it's used to add a line at the end of the log message. it must contain%BUGID%, Which is replaced with the issue number on commit. this ensures that your commit log contains a reference to the issue number which is always in a consistent format and can be parsed by your bug tracking tool to associate the issue number with a participant commit. as an example you might useIssue : %BUGID%, But this depends on your tool.

Bugtraq: append

This attribute defines the bug-id. Is it appended to the end of (true) log information or inserted to the beginning of (false) log information. Valid values includetrue/false,If not defined, the default value istrueSo the existing project will not be broken.

Bugtraq: Label

This text is shown by tortoisesvn on the commit dialog to label the edit box where you enter the issue number. If it's not set,Bug-ID / Issue-Nr:Will be displayed. Keep in mind though that the window will not be resized to fit this label, so keep the size of the label below 20-25 characters.

Bugtraq: Number

If settrueOnly numbers are allowed in the issue-number text field. An exception is the comma, so you can comma separate several numbers. Valid values aretrue/false.If not defined,trueIs assumed.

Issue numbers using regular expressions

In the approachRegular Expressions, Tortoisesvn doesn't show a separate input field but marks the part of the log message the user enters which is recognized by the issue tracker. this is done while the user writes the log message. this also means that the Bug ID can be anywhere inside a log message! This method is much more flexible, and is the one used by the tortoisesvn project itself.

Bugtraq: logregex

This property activates the Bug Tracking System inRegExMode. It contains either a single regular expressions, or two regular expressions separated by a newline.

If two expressions are set, then the first expression is used as a pre-filter to find expressions which contain Bug IDs. the second expression then extracts the bare Bug IDs from the result of the first RegEx. this allows you to use a list of Bug IDs and natural language expressions if you wish. e.g. you might fix several bugs and include a string something like this: "This change resolves issues #23, #24 and #25"

If you want to catch Bug IDs as used in the expression above a log message, you cocould use the following RegEx strings, which are the ones used by the tortoisesvn project:[Ii]ssues?:?(\s*(,|and)?\s*#\d+)+And(\d+)

The first expression picks out "Issues #23, #24 and #25" from the surrounding Log message. the second RegEx extracts plain decimal numbers from the output of the first RegEx, so it will return "23", "24" and "25" to use as Bug IDs.

Breaking the first RegEx down a little, it must start with the word "issue", possibly capitalized. this is optionally followed by an "S" (more than one issue) and Optionally a colon. this is followed by one or more groups each having zero or more leading whitespace, an optional comma or "and" and more optional space. finally there is a mandatory "#" and a mandatory decimal number.

If only one expression is set, then the bare Bug IDs must be matched in the groups of the RegEx string. Example:[Ii]ssue(?:s)? #?(\d+)This method is required by a few issue trackers, e.g. TRAC, but it is harder to construct the RegEx. We recommend that you only use this method if your issue tracker documentation tells you.

If you are unfamiliar with regular expressions, take a look at the introductionHttp://en.wikipedia.org/wiki/Regular_expression, And the online documentation and tutorialHttp://www.regular-expressions.info/.

If bothbugtraq:messageAndbugtraq:logregexAttribute,Log Regular ExpressionWill be used first.

Prompt

Even if your problem tracking tool does not have a pre-commit hook to parse log information, you can still use this function to convert the problem list in log information into a link!

And even if you don't need the links, the issue numbers show up as a separate column in the log dialog, making it easier to find the changes which relate to a participant issue.

Sometsvn:Properties requiretrue/falseValue. tortoisesvn also understandsyesAs a synonymtrueAndnoAs a synonymfalse.

Set folder Properties

These properties must be set on folders for the system to work. when you commit a file or folder the properties are read from that folder. if the properties are not found there, tortoisesvn will search upwards through the folder tree to find them until it comes to an unversioned folder, or the tree root (eg.C:\) Is found. If you can be sure that each user checks out only from e. gtrunk/And not some sub-folder, then it's enough if you set the properties ontrunk/. If you can't be sure, you should set the properties recursively on each sub-Folder. A Property setting deeper in the project hierarchy overrides settings on higher levels (closertrunk/).

Fortsvn:PropertiesOnlyYou can use the recursive checkbox to set the property to all sub-folders in the hierarchy, without also setting it on all files.

This issue tracker integration is not restricted to tortoisesvn; it can be used with any subversion client. For more information, read the fullIssue tracker integration specification.

Getting information from the issue tracker

The previous section deals with adding issue information to the log messages. But what if you need to get information from the issue tracker? The commit dialog has a Windows COM interface which allows integration an external program that can talk to your tracker. typically you might want to query the tracker to get a list of open issues assigned to you, so that you can pick the issues that are being addressed in this commit.

Any such interface is of course highly specific to your system, so we cannot provide this part, and describing how to create such a program is beyond the scope of this Manual. the Interface Definition and sample programs can be obtained fromcontribFolder inTortoisesvn Repository.

For authentication purposes, let's suppose that your system administrator has provided you with an issue tracker plugin which you have installed, and that you have set up some of your working copies to use the Plugin in tortoisesvn's Settings dialog. when you open the commit dialog from a working copy to which the plugin has been assigned, you will see a new button at the top of the dialog.

Figure 5.49. Example issue tracker query Dialog

In this example you can select one or more open issues. The plugin can then generate specially formatted text which it adds to your log message.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.