Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused site setting git.cloneURLToRepositoryName #3768

Closed
keegancsmith opened this issue May 2, 2019 · 2 comments
Closed

unused site setting git.cloneURLToRepositoryName #3768

keegancsmith opened this issue May 2, 2019 · 2 comments
Assignees
Labels
debt Technical debt. estimate/0.5d planned/3.13 Issues that were planned for the given milestone. Used by cmd/tracking-issue.
Milestone

Comments

@keegancsmith
Copy link
Member

The documentation for this setting is

JSON array of configuration that maps from Git clone URL to repository name. Sourcegraph automatically resolves remote clone URLs to their proper code host. However, there may be non-remote clone URLs (e.g., in submodule declarations) that Sourcegraph cannot automatically map to a code host. In this case, use this field to specify the mapping. The mappings are tried in the order they are specified and take precedence over automatic mappings.

However, I do not see anywhere in our codebase we actually read this setting. We should remove this field. cc @sourcegraph/core-services to discuss.

@tsenart tsenart added the debt Technical debt. label Dec 18, 2019
@keegancsmith keegancsmith added this to the 3.13 milestone Jan 13, 2020
@tsenart tsenart assigned keegancsmith and unknwon and unassigned keegancsmith Jan 14, 2020
@tsenart tsenart added the planned/3.13 Issues that were planned for the given milestone. Used by cmd/tracking-issue. label Jan 24, 2020
@unknwon
Copy link
Member

unknwon commented Jan 31, 2020

If I'm looking at the correct configuration git.cloneURLToRepositoryName, looks like it's still being used, call stack (bottom up):

conf.Get().GitCloneURLToRepositoryName:

var cloneURLResolvers = conf.Cached(func() interface{} {
cloneURLConfig := conf.Get().GitCloneURLToRepositoryName
var resolvers []*cloneURLResolver

cloneURLResolvers:

func CustomCloneURLToRepoName(cloneURL string) (repoName api.RepoName) {
for _, r := range cloneURLResolvers().([]*cloneURLResolver) {
if name := mapString(r.from, cloneURL, r.to); name != "" {

reposource.CustomCloneURLToRepoName:

func reposourceCloneURLToRepoName(ctx context.Context, cloneURL string) (repoName api.RepoName, err error) {
if repoName := reposource.CustomCloneURLToRepoName(cloneURL); repoName != "" {
return repoName, nil

Calls of reposourceCloneURLToRepoName in GraphQL layer: https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24%4087e0033+file:%5Ecmd/frontend/graphqlbackend/+reposourceCloneURLToRepoName&patternType=literal

@unknwon
Copy link
Member

unknwon commented Jan 31, 2020

I think this was a false positive, closing.

@unknwon unknwon closed this as completed Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Technical debt. estimate/0.5d planned/3.13 Issues that were planned for the given milestone. Used by cmd/tracking-issue.
Projects
None yet
Development

No branches or pull requests

3 participants