> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/general/incorrect-scm-links.md).

# Incorrect SCM Links

### Problem <a href="#problem" id="problem"></a>

Sealights attempts to create links back to the customers SCM based on the repo URL and the type and version of the SCM the customer uses.\
In some cases this cannot be created properly as the repo URL is different to the actual URL used when browsing to the files through a browser.

1. Wrong SCM type is sent to Sealights
2. Wrong bitbucket on premise version - As Bitbucket has changed their link format between versions, if the wrong version is provided to Sealights the link can be incorrect
3. Different DNS and port - The DNS and port used by the CI could be different to the one used when browsing to the files through a browser. This mainly happens when connecting in the CI through ssh rather than https
4. CI uses a local repo and in turn sets the repo URL to be a local or temp path rather than the real repo

### Solution <a href="#solution" id="solution"></a>

Sealights provides the ability to set what the correct values should be with 3 parameters. See various agent documentation on means to doing so

**SCM Provider**

Sealights attempts to identify this on its own by looking at the DNS. If it cannot be identified automatically, this must be provided.\
Possible values are: **github, bitbucket, gitlab** (no capitals)

**SCM base URL**

If not identified automatically you should provide the following based on your SCM:

<table><thead><tr><th width="169.66015625">SCM</th><th>URL format</th></tr></thead><tbody><tr><td>bitbucket.org</td><td><code>https://bitbucket.org/{account}/{repo}/src</code></td></tr><tr><td>Bitbucket On-Prem</td><td><code>https://{dns}/projects/{project}/repos/{repo}/browse</code></td></tr><tr><td>Github On-Prem</td><td><code>https://{dns}/{account}/{repo}/blob</code></td></tr><tr><td>Gitlab On-Prem</td><td><code>https://{dns}/{account}/{optional:subgroup}/{repo}/blob</code></td></tr><tr><td>Gitlab CI</td><td><code>${CI_SERVER_URL}/${CI_PROJECT_PATH}/blob</code></td></tr></tbody></table>

**SCM version**

Should be set for any On-Premise SCM type.\
If using a cloud SCM and the repo URL is not sent correctly, this should be set to "[c](https://sealights.atlassian.net/wiki/spaces/SUP/pages/1054113800)loud"

{% hint style="info" %}
If your on premise SCM version is often updated in order to comply with latest security patches for example, you can also provide a version retrieved dynamically as the sample command lines below

* GitHub on-prem: `` githubVersion=`curl -sI https://github.mycompany.com/api/v3 | grep Version | awk '{print $2}' | tr -d '\r'` ``
* Bitbucket: `` bitbucketVersion=`curl -s https://mybitbucket.mycompany.com/rest/api/1.0/application-properties | jq -r .version` ``
* GitLab: `` gitlabVersion=`curl https://mygitlab.mycompany.com/api/v4/version | jq -r .version` ``
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/general/incorrect-scm-links.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
