Unsupported SCM

Even though some SCMs aren’t natively supported by Spectral, the account owner can still manage the construction of issue URLs within SpectralOps.

This can be done by navigating to Settings -> SCM page.
Below the on-prem SCMs domains configuration, you'll notice a section dedicated for building templates for your issues that were originated in SCMs that Spectral does not support by default.

This section allows you to set templates that will be used to construct URLs for your issues using placeholders that would be replaced with real issue data.

Let's create it!

Two templates should be created:

  1. Blame URL - used to examine which contributors made specific changes.
  2. URI - used to link to the line of code associated with the issue.

Each template is constructed of placeholders and characters.
The sample issue data (a real issue from your account) displayed in the table might be helpful to understand which data the placeholder represents.

Placeholders

A placeholder would be replaced with real issue data while creating a URL for an issue.
To declare a placeholder in the template you'll need to surround its name with triple curly braces.
The supported placeholders are:

{{{assetUri}}} - represents the URI of your repository
{{{assetName}}} - reporesents the name of your repository (useful when the SCM has different host for the git server)
{{{commitSha}}} - represents the commit hash associated with the issue
{{{branch}}} - represents the branch associated with the issue
{{{start}}} - represents the line of code that the issue start in
{{{path}}} - represents the file path the issue found in

Examples

Below are examples of templates that might help you understand how a template should look like:

URI

{{{assetUri}}}/blob/{{{branch}}}{{{path}}}#L{{{start}}}

Blame URL

{{{assetUri}}}/blame/{{{branch}}}{{{path}}}#L{{{start}}}

Time savers

  1. In order to avoid typos you can copy the placeholder name by clicking on it within the table.
  2. You can see the result of injecting the sample issue data into your template below the input - if your template is valid and produces a valid URL - you'll see it clickable! Click the link to make sure you are being redirected correctly.

Saving your work

You've made it, we have a template!
When you are done and checked the links your templates created - hit the Save button.

Behind the scenes

Saving the templates will update the URLs of your existing issues generated by unsupported SCMs.
Make sure to save the templates when you are sure you have done it right, because it might affect your data!

The issues that would be modified are issues that were created after this ability is enabled, so if you wish to update old issues URLs as well, consider deleting such assets and re-scan them.

Happy templating!