Plugins Directory » Bitbucket references

19216 Author: Seppe Stas
Website: https://productize.be
Code repository: https://bitbucket.org/productize/bitbucket_reference_redmine
Registered on: 2017-01-16 (almost 2 years ago)
Current version: 0.1.2
Compatible with: Redmine 4.1.x, 4.0.x, 3.4.x, 3.3.x, 3.2.x, 3.1.x
User ratings:   (1)

Reference Redmine issues in Bitbucket.

This is both a Redmine plugin and an Atlassian Connect for Bitbucket Cloud compatible add-on.

Features

When installing this addon in Bitbucket it registers:
  • A Bitbucket linker that makes Bitbucket turn references to issues using a specified regex turn into links to the issue in Redmine;
  • Bitbucket webhooks for pushes, commit comments, pull requests and pull request comments. These webhooks get handled in the Redmine plugin, creating a journal entry for the issue containing the commit message or comment and useful links and meta-data.

Since the linker and webhooks are registered using an addon they automatically work for all repositories of the user / team for whom the addon is installed.

Limitations

  • Currently the regex is hardcoded to `(?<!&)#([0-9]+)`, meaning issues have to be referenced using `#<issue number>`. The negative lookahead is a workaround for Bitbucket bug 13642.
  • Currently only up to 5 commits per push are supported because of a limitation in Bitbucket's push webhook.
  • Issue references in pull request edits, pull request comment edits or commit comment edits will not cause Redmine journals to be updated or added.

Installation notes

First, install the plugin in Redmine

From your Redmine installation directory:

  • Download or clone this repo
    mkdir plugins/bitbucket_reference_redmine
    wget -qO - https://bitbucket.org/productize/bitbucket_reference_redmine/get/master.tar.bz2 | tar jx --strip-components=1 -C plugins/bitbucket_reference_redmine
or
    git clone https://bitbucket.org/productize/bitbucket_reference_redmine.git plugins/bitbucket_reference_redmine
  • Install the plugin's dependencies
    bundle install
  • Run the migrations
    bundle exec rake redmine:plugins:migrate
  • Restart Redmine

    E.g, if Redmine is installed as an Apache 2 passenger:

    sudo service apache2 restart
or if Redmine has it's own service:
    sudo service redmine restart

Next, install the addon in your Bitbucket user/team:

  • Navigate to https://bitbucket.org/account/user/user_or_team_name/addon-management
  • Click "Install add-on from URL"
  • Enter <base URL of your Redmine installation>/bitbucket-references
  • Click "Install"
  • Click "Grant access"
  • You will now get redirected to the plugin's settings page in your Redmine instance, This might require you to log in.
  • Click "Allow" on the Bitbucket connection you just added.

Notes

  • The Bitbucket Connect system requires your Redmine installation to use HTTPS.
  • To add a second Bitbucket account make sure the "Allow new Bitbucket connections" option is enabled on the plugin's configuration page.

Changelog

0.1.2 (2017-07-13)

Compatible with Redmine 4.1.x, 4.0.x, 3.4.x, 3.3.x, 3.2.x, 3.1.x.

Made plugin ignore references to issues of closed projects

This prevents the plugin from adding journal entries to referenced issues that belong to closed projects, partly solving #5 for specific use-cases.
Note that the Bitbucket link will still create links to the issues in Bitbucket.

Added a migration to change the user type to User

This makes the name of the Bitbucket reference user show up in the journal entries. I.e instead of "Updated by Anonymous" it now says "Updated by Bitbucket reference".

0.1.1 (2017-04-25)

Compatible with Redmine 4.0.x, 3.5.x, 3.4.x, 3.3.x, 3.2.x, 3.1.x.

Added support for textile formatting.

0.1 (2017-01-16)

Compatible with Redmine 3.4.x, 3.3.x, 3.2.x, 3.1.x.

User ratings

  by Robert Freigang almost 2 years ago