dragouf / Stash-Reviewers-Chrome-Extension

This chrome/firefox extension allow to define groups of reviewers in Atlassian Stash/Bitbucket to bulk add them when creating or updating pull request + other features
MIT License
88 stars 34 forks source link

Bitbucket Server Reviewers Groups - Extension

extension art

:warning: if you have stash server (previous version of bitbucket) please switch to 'stash-server-version' branch

This chrome/firefox extension allow to define groups of reviewers in Atlassian Bitbucket Server (previously stash) to bulk add them when creating or updating pull request.

Features

Installation

Chrome

you can find this extension on chrome webstore here: https://chrome.google.com/webstore/detail/bitbucket-server-extensio/hlagecmhpppmpfdifmigdglnhcpnohib

OR from the code source of this repository:

Firefox (webextensions)

you can find this module on mozilla addons website here: https://addons.mozilla.org/en-US/firefox/addon/bitbucket-server-extension/

OR from this repository:

Note: if ff version is greater than 41 you will have to change xpinstall.signatures.required value to false in about:config page.

Configuration

Enable/Disable features

just go to options panel and enable or disable features you want.

Configure reviewers groups

A "Stash" icon will appear on the top right corner of chrome window. Click on it. It will ask you to add a json to describe which group you want to create with which reviewers.

Configuration

Json format is as follow :

{ "groups": [ {
    "groupName":"first group name",
    "reviewers": ["first reviewer name or email"]
  },
  {
    "groupName":"second group name",
    "reviewers": ["first reviewer name or email", "second reviewer name or email"]
  } ] }
Using centralized lists

If you want to share one list between more users. You need to upload .json file so it is accessible by everyone. Then you just add URL to URL to json field. There can be more sources. All lists from files and from JSON field are merged together. Remote lists are reloaded on launch and every 6 hours.

Add Urls

After that when you will go to pull request creation page or update page a dropdown will appear after reviewers list with a list of groups you defined.

Add Group

Note: the extension will make a bitbucket server api request to find reviewers. It will simply send the string you added in the reviewers array as search term. Normally if you add email or username as recommanded API should return only one user. You can also enter a name but in this case if the API return more than one user, only the first one will be added.

Using centralized template

If you want to share template between more users. You need to upload template in text format on server accessible to everyone. Then just add URL in template tab to Template URL and save. After save, template is downloaded overwrites manual template stored. Remote template is reloaded on launch and every 6 hours.

Template Tab

Development troubleshooting

Firefox in development mode logs Error: The storage API will not work with a temporary addon ID. Please add an explicit addon ID to your manifest. For more information see https://bugzil.la/1323228.

How to fix: add a temporary key to your manifest.json:

{
    "applications": {
        "gecko": {
            "id": "dev@example.com"
        }
    },
    "manifest_version": 2,