Skip to content

GraphQL API returns invalid repository and tree URLs for repo with spaces in name (not percent-encoded)

Created by: felixfbecker

This is the root cause of https://github.com/sourcegraph/sourcegraph/issues/15615, which affects https://app.hubspot.com/contacts/2762526/company/1085513342.

Repro:

  1. Go to https://k8s.sgdev.org/sourcegraph.visualstudio.com/Test%20Repo
  2. Check the network tab for the RepositoryRedirect and ResolveRev queries.

Actual: RepositoryRedirect has repositoryRedirect.url: "/sourcegraph.visualstudio.com/Test Repo" ResolveRev has repositoryRedirect.commit.tree.url: "/sourcegraph.visualstudio.com/Test Repo"

which are invalid URLs and cause React client routing to break.

Expected: Both should be "/sourcegraph.visualstudio.com/Test%20Repo"