Skip to content

Latest commit

 

History

History
215 lines (151 loc) · 5.83 KB

README.rst

File metadata and controls

215 lines (151 loc) · 5.83 KB

Klonfisch, the FishEye simulator for GitLab

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.

  • 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
doc/issue-source.png

JIRA's issue source tab

doc/project-source.png

JIRA's project source tab

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)
  1. git clone the klonfisch git repository
  2. Create a (MySQL) database to store the commits in
  3. Import data/database.sql into that database
  4. Copy data/klonfisch.config.php.dist to data/klonfisch.config.php and adjust it to your environment.
  5. Setup your (apache) webserver by adding a virtual host and pointing its document root to $klonfisch/www/
  6. Execute curl -I http://klonfisch.example.org/rest-service-fe/server-v1 and if you get a 401 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.

  1. 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:

  1. In GitLab project settings, click "Web Hooks"
  2. 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.

  1. Install the FishEye plugin. Just installation, no configuration
  2. Go to Administration / Applications / Application Links
  3. Click "Add Application Link"
  4. Set the Server URL, e.g. http://klonfisch.gitlab.example.org/
  5. Disable Also create a link from "klonfisch" back to to this server
  6. Finish the application link setup

Hide the review buttons:

  1. Click "Configure FishEye Server" in the application links list
  2. 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