Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 04a8c1a

Browse files
[Backport 5.0] Fix Bitbucket Server exclude repo to use project key instead of name (#49837)
The excludable repo name should be created from the `Project.Key` (i.e. `pjlast`) and not the `Project.Name` (i.e. `Petri-Johan Last`). This fixes the `Exclude repository` button in the repo settings page not necessarily working for Bitbucket Server repositories. ## Test plan Tests updated &lt;!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --&gt; <br> Backport af8da59 from #49829 Co-authored-by: Petri-Johan Last <[email protected]>
1 parent e7379b3 commit 04a8c1a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/frontend/backend/external_services.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func ExcludableRepoName(repository *types.Repo, logger log.Logger) (name string)
221221
if repo.Project == nil {
222222
return
223223
}
224-
name = fmt.Sprintf("%s/%s", repo.Project.Name, repo.Name)
224+
name = fmt.Sprintf("%s/%s", repo.Project.Key, repo.Name)
225225
} else {
226226
logger.Error("invalid repo metadata schema", log.String("extSvcType", extsvc.TypeBitbucketServer))
227227
}

cmd/frontend/backend/external_services_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func makeBitbucketServerRepo() *types.Repo {
153153
Slug: "jsonrpc2",
154154
Project: &bitbucketserver.Project{
155155
Key: "SOURCEGRAPH",
156-
Name: "SOURCEGRAPH",
156+
Name: "Sourcegraph e2e testing",
157157
},
158158
}
159159

0 commit comments

Comments
 (0)