Skip to content

Gitlab stay-on-code-host functionality should consider port of Gitlab URL

Created by: felixfbecker

See https://gitlab.com/gitlab-org/gitlab/issues/36417

We currently just take the rawRepoName and https:

https://github.com/sourcegraph/sourcegraph/blob/fd6f00e8867964bbb62b23dfcedb0f0d9dac9376/browser/src/libs/gitlab/code_intelligence.ts#L136

which is built from the hostname (without port):

https://github.com/sourcegraph/sourcegraph/blob/fd6f00e8867964bbb62b23dfcedb0f0d9dac9376/browser/src/libs/gitlab/scrape.ts#L62

@lguychard as the one who introduced rawRepoName, do you think we should add the port to rawRepoName (use location.host instead of location.hostname), or should we fill that in from the location when building the URL? The latter option would pose a problem if you have two Gitlab instances running on the same host under different ports.