Repository navigation
feat(scm): Pass GitLab repository paths to scm-platform - #128198
Merged
Merged
Conversation
Sentry stores a GitLab project's display name ("Group / Project") as the
repository name, so scm-platform can't use it to address the project on
its host. Its git relay builds GitLab clone URLs from the repository's
path and refuses GitLab repositories without one, so take the real path
from the repository config.
Other providers already store the path as the name and get no `path` key.
vaind
added a commit
to getsentry/scm-platform
that referenced
this pull request
Oct 20, 2026
GitLabProvider built file, commit and merge request links from Sentry's
name for the repository with its spaces removed, but that name is
GitLab's display name ("GitLab.org / GitLab FOSS"), which differs from
the path (gitlab-org/gitlab-foss) in more than spaces. The links now use
Repository.path, which getsentry/sentry#128198 fills in, and refuse with
missing_repository_path without it. API calls address projects by id
and are unaffected.
Refs CW-2221
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
billyvg
approved these changes
Oct 20, 2026
billyvg
left a comment
Member
There was a problem hiding this comment.
Would this be worth a migration later on, so that all repos have a canonical field for its path? This name vs path issue is/was a problem in Sentry in a bunch of places.
Contributor
Author
Already created an issue for this, linked above |
2 tasks done
vaind
added a commit
to getsentry/scm-platform
that referenced
this pull request
Oct 22, 2026
GitLab web links are built from Sentry's repository name with its spaces
removed. That name is GitLab's display name ("GitLab.org / GitLab
FOSS"), not its path (`gitlab-org/gitlab-foss`), so most of the links
are wrong. The git endpoint for coding jobs
([CW-2221](https://linear.app/getsentry/issue/CW-2221/git-grants-and-relay-in-scm-platform))
needs the path for clone URLs too.
First of three stacked PRs, before #158 and
#156.
## Approach
- `Repository` gains an optional `path`, which Sentry fills for GitLab
from `repo.config["path"]`
([getsentry/sentry#128198](getsentry/sentry#128198)).
The RPC payload carries it, and a payload from an older server without
it reads as `None`.
- `GitLabProvider.web_repository_path` returns `path`, and raises
`missing_repository_path` without it. API calls use project ids and
don't change.
## Changes existing behaviour
Without a `path`, GitLab's link methods raise `missing_repository_path`
instead of returning a wrong link, so getsentry/sentry#128198 must be
deployed before Sentry or Seer takes a release with this.
## Tests
Links use the path and refuse without one; `path` round-trips through
the RPC payload and reads as `None` when absent.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scm-platform's new git relay (getsentry/scm-platform#156) clones repositories, and for GitLab it builds the clone URL as
<web_base_url>/<path>.git. Sentry doesn't give it a usable path today: for GitLab, the repository'snameis the project's display name, such asGitLab.org / GitLab FOSS, not its path,gitlab-org/gitlab-foss. A clone URL built from the display name points nowhere, so the relay refuses GitLab repositories withmissing_repository_path.The real path is already stored in the repository's config (
config["path"], written when the repository is linked).fetch_repositorynow copies it into thepathkey that scm-platform'sRepositorygained for this. GitLab repositories linked without a path in their config getpath: None. Other providers get nopathkey, since theirnamealready is the path.The repository dict is built through
cast(Repository, ...), so this works with Sentry's currently pinned sentry-scm, which doesn't declarepathyet.This is independent of #128164, which sets
web_base_urlfor GitLab in the same function; the relay needs both before it can clone from GitLab.Storing the path as the GitLab repository's
nameinstead, which would make this key unnecessary, is tracked separately: related to SCM-293.