Skip to content

Fix browser extension URL mismatch + add support for sourcegraph custom baseURL with path

Administrator requested to merge erzhtor/fix-bext-url-mismatch into main

Created by: erzhtor

Closes https://github.com/sourcegraph/sourcegraph/issues/26170.

Description

It seems that in client GQL we didn't support a custom base-URL for self-hosted instances. For example: https://my-org.com/sourcegraph would trim /sourcegraph and try to use only the domain part of the URL. I guess, nobody used a custom domain with a path as sourcegraph baseURL so far.

However, because ofthis user could put any URL in the browser extension, and it would validate and work for GQL requests, but links on the page would be constructed incorrectly.

How to test

  • Browser extension
    1. yarn --cwd client/browser dev:chrome + install extension in chrome
    2. Open extension popup and check that URL input validates full URLL (doesn't ignore URL path)
    3. Open any public repo and check extension correctly works & builds links
  • Web
    1. Run sourcegraph web locally (or fully) & and check that everything is working as expected

Screenshots

Before After
image image
image image

Merge request reports

Loading