Git Connector
Overview
The Git connector is used to align a source code check-in with an issue in an ALM system providing traceability. An example flow would be:
- Create a defect in Jira.
- Change the source code that will fix the defect.
- Check in the source code and put the Jira issue id (eg JRA-349) in the check-in comment. Repeat as many times as necessary.
- For each check-in, the checked-in comment and the files will be visible in the Jira issue.
The check-in information is great for non-developers like QA so they can see what (and how many) files were changed to solve a bug or implement a new feature. The information is also good for traceability to ensure a feature is in a specific release or to refer back to if the defect appears again.
Installing the Git Connector requires the installation of a trigger in the target Git instance. For that reason, the Git connector cannot be installed on a SaaS version of Git.
An example of the check in information stored in an issue comment looks like this:
A check in comment can be stored in the issue in three ways:
- Store the check in comment as a Jira comment (as above).
- Store the check in comment in a custom field.
- Display the check in comment in an issue tab. This is only available in Jira when using the ConnectALL-Jira plugin.
Configuration
To configure the git connector in the UI select Bitbucket and Jira then enter a unique alpha-numeric name.
Then configure the URLs of the two servers:
Finally, select the field to put the change list in - either comment or a large text area custom field:
The next step in the configuration is to install a script on the git repository. The script will be used to send the check in comment to ConnectALL. The name of the script is post-commit and can be found in the $MULE_HOME/apps/ConnectAll*/classes folder. The script can be installed as a trigger on a workstation repository in the repository/.git/hooks folder. The script can also be put on the Git server in the repository/.git/hooks folder. When installed on the Git server the file must be renamed to post-receive.
The script needs to be configured in two areas. The Stash project and repo that the script is installed in and the name of the automation you just made in the UI needs to be added to the script like this:
The variables to be set are:
Variable | Contents |
---|---|
HOST | The url of the ConnectALL user interface |
BASICAUTH | The login to the ConnectALL user interface (future versions will implement an auth token) |
automation | The name of the automation created in the user interface in the previous step |
project | The key of the GIT repository |
repo | The git repository this script is installed in |
The variables automation, project, and repo are important for the ConnectAll-Jira plugin. If the plugin is not used, these variables are not needed.
The last step is configuring the ConnectAll-Jira plugin. This is used to render the changelist in a Jira issue tab. The step is shown below. Keep in mind that the variable must be set to "Only".
Time Difference Configuration
To know how to calculate the time difference, and configure it in the ConnectALL UI, read the topic Time Difference Configuration.