2012-09-02

Using private Rhodecode repositories with Mantis BT

As you know you can use Mantis BT and Rhodecode in conjunction to keep your issues and code connected. However this only worked if you opened up your Rhodecode repositories (either GIT or Mercurial) for everyone to read. With the latest version (0.3.1) of the Rhodecode Mantis connector you can use Rhodecode API keys to have an authenticated user get the information needed by Mantis.

Update 29-12-2012:
Version 1.5.0 of Rhodecode changes the Raw-Changeset page. For interaction with Rhodecode 1.5.x you need version 0.4.0 of the Mantis RhodeCode connector

 Installation

  • Install the Source Integration plugin into Mantis,
  • To allow api access to private repositories you need to edit the Rhodecode source files.
  • Open the file changeset.py (Mine was located in /usr/local/lib/python2.7/dist-packages/RhodeCode-1.3.6-py2.7.egg/rhodecode/controllers/changeset.py)
  • Locate '@LoginRequired()' and replace it with '@LoginRequired(api_access=True)', save the file and restart Rhodecode
  • In Rhodecode allow a user to have read-only access to that repository (I added a Read-Only group with a Mantis user)
  • Go to the admin page for that user (via http://%rhodecode%/_admin/users) and note the api-key listed there
  • Install v 0.3.1 of the Rhodecode Mantis connector into Mantis
  • Open the Plugins configuration dialog for the plugin (via http://%mantis%/plugin.php?page=SourceRcWeb/config)

  • Insert the API key from Rhodecode into the API Key field
Now you can use the Repositories function for private repositories just like public repositories

4 comments:

  1. Hi Ton,

    Thanks for update.Its a nice feature.let me try this and I will share my feedback.

    Thanks,
    Thirumalai.

    ReplyDelete
  2. Hi Ton,

    I updated my plugin and checked API key in mantis.Everything is working fine.Thanks for adding this feature.

    Keep rocking,

    Thanks,
    Thirumalai.

    ReplyDelete
  3. Using the latest SourceRcWeb and Mantis 1.2.15, the installation goes fine and I can add a Rhodecode repository with no problems. But when I try to "import the latest data" or "import everything", nothing happens and the following shows up in error logs:

    "Call to undefined function map() in /var/www/html/mantis/plugins/SourceRcWeb/SourceRcWeb.php on line 159"

    I must be doing something wrong. Can you please advise?

    TIA,

    ReplyDelete
    Replies
    1. Hello Bahman,
      I myself have issus running the RhodeCode Hook. However I have no issues in using the 'import everything'. Can you see something in the logs of RhodeCode?

      Delete