This documentation relates to an earlier version of FishEye.
View

Unknown macro: {spacejump}

or visit the current documentation home.

When browsing commit messages or comments in FishEye, any issue IDs or Bug IDs that appear will be turned into hyperlinks, allowing you to easily click to see those referenced issues or pages. This capability is due to FishEye's ability to detect special substrings in commit messages, and hyperlink those substrings to other systems.

This is particularly useful if you use an issue tracking system, and put the issue identifiers into your commit messages. The 'Linkers' repository option (Administration > Repository Defaults > Linkers, or Administration > View Repository List > View (next to your REPO) > Linkers) allows you to define the substrings and their related URLs.

Any linkers defined in the repository defaults are added to each individual repository.

Example Linkers

Here are some examples of how to create simple linkers.

JIRA Examples

If you have already set up JIRA integration, ignore the following instructions.

  • To link any occurrence of a JIRA-style issue to JIRA:
    Regex: [a-zA-Z]{2,}-\d+
    Href: http://jirahost:8080/browse/${0}
    
    The regular expression above matches any sequence of two or more alphabetical characters, followed by a dash, followed by a number, which comprise the format of JIRA isssue IDs (such as AB-123 or ABC-123 or ABCDE-123). Replace jirahost with the hostname of the desired JIRA instance.
  • To link a specific set of JIRA projects (e.g. JRA, CONF and CRUC) to a JIRA instance:
    Regex: (JRA|CONF|CRUC)-\d+
    Href: http://jirahost:8080/browse/${0}
    
    The regular expression above matches only specific JIRA issue keys with any number, like JRA-123 or CONF-123 or CRUC-123. Replace jirahost with the hostname of the desired JIRA instance.

Bamboo Examples

  • To link to specific Bamboo builds:
    Regex: (ABC)-[a-zA-Z]+-\d+
    Href: http://bamboohost/browse/${0}
    
    The regular expression above matches Bamboo build IDs like ABC-MAIN-123 or ABC-BRANCH-123. These will then be made links to the build reports in your Bamboo instance. Replace bamboohost with the hostname of the desired bamboo instance.

Bugzilla Examples

  • To link bug numbers that occur at the start of a line to Bugzilla:
    Regex: ^BUG: (\d+)
    Href: http://bugzilla/bugzilla/show_bug.cgi?id=${1}
    
  • To link bug numbers that occur after the word bug and optionally whitespace, ":" or "#" (e.g. Bug123, bug:123, or BUG #123):
    Regex: (?i)bug[#|\s|:]*(\d+)
    Href: http://bugzilla/bugzilla/show_bug.cgi?id=${1}
    
    The regular expressions above matches Bugzilla bug IDs. These will then be made links to build reports in your Bamboo instance.

About FishEye Regular Expressions

FishEye uses the Java regular expression language, which is based on Perl 5 regular expressions.

Note: If you want your regex to be case insensitive, put (?i) at the start of the regex.

To try out your regular expressions, you can use this online test page.

Example: The SyntaxDef Field

This is an advanced feature, intended for use by experienced developers only.

  • The 'description' is optional.
  • You will want to define the three region properties as in the example below.

This example matches numbers that appear after a PR: and might be seperated by commas or 'and':

   PR: 123
   PR: 123 456
   PR: 123, 456
   PR: 123, 456 and 789
<syntaxdef>
/PR:\s*((\d+\s*(and|,)?\s*)+)/i : {
      nummatcher(${1});
    }
    context nummatcher {
      /\d+/ : {
        region {
          href="http://issues.apache.org/bugzilla/show_bug.cgi?id=${0}";
        }
      }
    }

Understanding the SyntaxDef example

  • The first regex matches means: match "PR:" followed by a sequence of numbers ("\d+") separated by whitespace, "and" or commas.
  • The "context" means in the above match, link each number individually.