Implements the Atlassian FishEye API for GitLab, so that you can view GitLab commits in JIRA.
It's better than all the JIRA Git plugins because it displays the commits in a separate "Source" tab instead of adding a comment or activity for each commit.
Contents
- Simulates a part of the FishEye API
- Works with the JIRA FishEye plugin 5.0.7, 5.0.10 and 7.0.13
- Shows commits on issues (Tab "Source")
- Shows commits for projects (Tab "Source")
- Search for a ticket number and get the commit history
- Show the commit history in JIRA Cloud with the Greasemonkey script
- Showing files that got changed in a commit.
- Project statistics
- Authentication - everyone can see all commits
- Activity streams
Klonfisch is a PHP application that sits between JIRA and GitLab.
GitLab sends commit information to Klonfisch which stores them in a MySQL database. This is done via "web hooks".
JIRA on the other hand talks to Klonfisch, asking for commit information for projects or single issues. Klonfisch searches in the commit database and returns them to JIRA. JIRA then displays the commits in the "Source" tab of issues and projects.
You just have to install the FishEye plugin for JIRA, which takes care of talking to Klonfisch and the commit visualization.
- PHP 5.3+
- Apache with
mod_rewrite
enabled - MySQL (or any other database supported by PDO)
git clone
the klonfisch git repository- Create a (MySQL) database to store the commits in
- Import
data/database.sql
into that database - Copy
data/klonfisch.config.php.dist
todata/klonfisch.config.php
and adjust it to your environment. - Setup your (apache) webserver by adding a virtual host and pointing its
document root to
$klonfisch/www/
- Execute
curl -I http://klonfisch.example.org/rest-service-fe/server-v1
and if you get a401 Unauthorized
, you have done everything correct
Delete all entries of a repository that have the same hash and keep only the entry with the highest branch.
- Import
data/migrations/001-duplicate.sql
into the database
Klonfisch keeps record of commits to your GitLab instance via web hooks. You can setup them manually in the database, or let Klonfisch create the hooks automatically.
In every GitLab project (repository), you have to do this:
- In GitLab project settings, click "Web Hooks"
- Add a new Web Hook for commits only, to the URL
http://klonfisch.example.org/webhook-call.php
Make a copy of data/gitlab-klonfisch.sql.dist
and replace
http://klonfisch.example.org
with your klonfisch domain.
Then let cron run the following command every hour on the GitLab server:
gitlab-rails dbconsole < gitlab-klonfisch.sql
GitLab will then call /webhook-call.php
for each single commit
to a repository.
- Install the FishEye plugin. Just installation, no configuration
- Go to Administration / Applications / Application Links
- Click "Add Application Link"
- Set the Server URL, e.g.
http://klonfisch.gitlab.example.org/
- Disable
Also create a link from "klonfisch" back to to this server
- Finish the application link setup
Hide the review buttons:
- Click "Configure FishEye Server" in the application links list
- Set "Integration setup" to "FishEye integration only"
That's it. You do not need to setup any authentication. You do not need to setup any project connections.
Now do a commit, mentioning the issue number (e.g. "JGA-11") in the commit message. You will see the commit in JIRA's "Source" tab.
Also see Missing features.
Klonfisch simulates only one git repository, mainly to reduce the number of requests from JIRA. (helpful if you have 700+ repositories, and 200+ repositories for a single JIRA project) This leads to the issue that only the repository "test" is shown for the commits, even though they are from a different repository.
Use the branch link instead (master in $project/$repo
).
After removing an application link, you need to disable the FishEye plugin and re-enable it again.
If you fail to do so, you will see errors like
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
Repository test on http://klonfisch.example.org/ failed: The application link with id '46bc9c7c-0bad-3503-9ddf-0123456789ab' was not found for instance 'FishEyeInstanceImpl...'
Search for commits:
https://klonfisch.example.org/rest-service-fe/changeset-v1/listChangesets/?expand=&rep=test&comment=ABC-1
Klonfisch is licensed under the AGPL v3 or later.
Christian Weiske, Mogic GmbH
Klonfisch is available at https://github.com/mogic-le/klonfisch