Browser Extension Configuration

The Code Climate Browser Extension can be configured to work well with your on-premise Enterprise installation.

To configure the extension, you'll need to configure a few endpoints so the extension can communicate with your instance. First, open up the extension's configuration page by clicking the gear icon in the lower left corner of the extension's popup.

346

Next we'll configure your endpoints.

Let's assume our Code Climate Enterprise instance is reachable at https://codeclimate.mydomain.com. The extension can then be configured as seen below. Our configuration looks like:

  • the CODE CLIMATE URL value is set to https://codeclimate.mydomain.com
  • the CODE CLIMATE API URL value is set to https://codeclimate.mydomain.com/api
  • the GITHUB HOSTNAME value is set to your GitHub host, e.g. github.com if using the hosted version, otherwise your-github-domain.com (note the lack of http or https)

If you are also using an on-premise installation of Github, you may configure the GITHUB HOSTNAME value accordingly. If you are not using a custom Github installation, you may leave the default value of github.com as-is.

316

Distributing the Chrome extension settings to your team

The Chrome extension comes pre-configured with default options -- those options are appropriate for our hosted customers (codeclimate.com) but not for CC:E customers. To change them, please follow the instructions above. Sending the instructions above along with your CC:E specific values is a perfectly fine way to make sure your team sets up the extension properly.

If you want to ensure your engineers get the settings right, without potential typos that render the extension unable to retrieve data, there is another option available: you can generate and distribute a special chrome extension link (chrome-extension://...) which launches the chrome extension options page with your instance-specific values pre-populated. Users just need to click "Save" on this page to commit these values.

Generating the link

Generate a link by concatenating the base URL with the instance-specific querystring options. These are defined below:

Base URL: chrome-extension://phgahogocbnfilkegjdpohgkkjgahjgk/options.html
The long string in this URL is the app id for the Code Climate Chrome extension. It will be the same for all installs and all versions of the Chrome extension.

Querystring: ?codeClimateHost={your-code-climate-host}&apiHost={your-host}&vcsHost={your-vcs-host}

This querystring is specific to your instance. You'll want to replace the tokens with your instance-specific values.

  • the codeClimateHost is set to https://codeclimate.mydomain.com
  • the apiHost is set to https://codeclimate.mydomain.com/api
  • the vcsHost value is set to your GitHub host, e.g. github.com if using the hosted version, otherwise your-github-domain.com (note the lack of http or https)

For example, the following is a valid Chrome extension URL:

chrome-extension://phgahogocbnfilkegjdpohgkkjgahjgk/options.html?codeClimateHost=https://codeclimate.silent-runners.com&apiHost=https://codeclimate.silent-runners.com/api&vcsHost=git.silent-runners.com

Once you have your URL, you can distribute this link to your team in whichever forum is most appropriate for your team. You'll want to remind them to click save.

Caveats

  • Users will still need to click save after loading the options page with the pre-populated values. This URL does not automatically set the values, just pre-populates them.
  • If values have been previously saved, they will take precedence over the querystring. If you would like to re-use this link-based approach, please uninstall and reinstall the extension.