Skip to content

Commit 9ae5c41

Browse files
fsaminsguiheux
authored andcommitted
fix(api): run workflow from repository must keep repository fullname (#2973)
1 parent 8ce66f2 commit 9ae5c41

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

engine/api/api_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ func newTestServer(t *testing.T, bootstrapFunc ...test.Bootstrapf) (*API, string
4747
api.InitRouter()
4848
ts := httptest.NewServer(router.Mux)
4949
url, _ := url.Parse(ts.URL)
50-
url.Path = url.Path
5150
return api, url.String(), ts.Close
5251
}

engine/api/workflow/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func extractWorkflow(db *gorp.DbMap, store cache.Store, p *sdk.Project, w *sdk.W
7777
}
7878
opt := &PushOption{
7979
VCSServer: ope.VCSServer,
80-
RepositoryName: ope.RepositoryInfo.Name,
80+
RepositoryName: ope.RepoFullName,
8181
RepositoryStrategy: ope.RepositoryStrategy,
8282
Branch: ope.Setup.Checkout.Branch,
8383
FromRepository: ope.RepositoryInfo.FetchURL,

engine/repositories/processor_checkout.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ func (s *Service) processCheckout(op *sdk.Operation) error {
3232
}
3333
}
3434

35-
n, err := gitRepo.Name()
36-
if err != nil {
37-
log.Error("Repositories> processCheckout> gitRepo.Name> [%s] Error: %v", op.UUID, err)
38-
return err
39-
}
4035
f, err := gitRepo.FetchURL()
4136
if err != nil {
4237
log.Error("Repositories> processCheckout> gitRepo.FetchURL> [%s] Error: %v", op.UUID, err)
@@ -49,7 +44,7 @@ func (s *Service) processCheckout(op *sdk.Operation) error {
4944
}
5045

5146
op.RepositoryInfo = &sdk.OperationRepositoryInfo{
52-
Name: n,
47+
Name: op.RepoFullName,
5348
FetchURL: f,
5449
DefaultBranch: d,
5550
}

0 commit comments

Comments
 (0)