This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch zk-0924-1
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/zk-0924-1 by this push:
new e4174f226 fix: bamboo using api client in tool/domain layer
e4174f226 is described below
commit e4174f226af0f397918649f486f475d8413c4e0c
Author: abeizn <[email protected]>
AuthorDate: Tue Sep 24 10:42:25 2024 +0800
fix: bamboo using api client in tool/domain layer
---
backend/plugins/bamboo/impl/impl.go | 4 ----
.../bamboo/tasks/deploy_build_to_deployment_commit_convertor.go | 6 +++---
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/backend/plugins/bamboo/impl/impl.go
b/backend/plugins/bamboo/impl/impl.go
index 0ac41bbd8..b90331df1 100644
--- a/backend/plugins/bamboo/impl/impl.go
+++ b/backend/plugins/bamboo/impl/impl.go
@@ -160,11 +160,7 @@ func (p Bamboo) PrepareTaskData(taskCtx
plugin.TaskContext, options map[string]i
if err != nil {
return nil, err
}
-
op.ScopeConfigId = scope.ScopeConfigId
- if err != nil {
- return nil, errors.Default.Wrap(err, fmt.Sprintf("fail
to find plan: %s", op.PlanKey))
- }
}
if op.BambooScopeConfig == nil && op.ScopeConfigId != 0 {
diff --git
a/backend/plugins/bamboo/tasks/deploy_build_to_deployment_commit_convertor.go
b/backend/plugins/bamboo/tasks/deploy_build_to_deployment_commit_convertor.go
index 9dc4600ef..4a68b0e8e 100644
---
a/backend/plugins/bamboo/tasks/deploy_build_to_deployment_commit_convertor.go
+++
b/backend/plugins/bamboo/tasks/deploy_build_to_deployment_commit_convertor.go
@@ -146,7 +146,7 @@ func ConvertDeployBuildsToDeploymentCommits(taskCtx
plugin.SubTaskContext) error
RepoId: strconv.Itoa(input.RepositoryId),
DisplayTitle:
input.GenerateCICDDeploymentCommitName(),
}
- u, err := url.Parse(data.ApiClient.GetEndpoint())
+ u, err := url.Parse(data.EndPoint)
if err != nil {
log.Fatal(err)
}
@@ -162,9 +162,9 @@ func ConvertDeployBuildsToDeploymentCommits(taskCtx
plugin.SubTaskContext) error
duration :=
float64(input.FinishedDate.Sub(*input.ExecutedDate).Milliseconds() / 1e3)
deploymentCommit.DurationSec = &duration
}
- fakeRepoUrl, err :=
generateFakeRepoUrl(data.ApiClient.GetEndpoint(), input.RepositoryId)
+ fakeRepoUrl, err := generateFakeRepoUrl(data.EndPoint,
input.RepositoryId)
if err != nil {
- logger.Warn(err, "generate fake repo url,
endpoint: %s, repo id: %d", data.ApiClient.GetEndpoint(), input.RepositoryId)
+ logger.Warn(err, "generate fake repo url,
endpoint: %s, repo id: %d", data.EndPoint, input.RepositoryId)
} else {
deploymentCommit.RepoUrl = fakeRepoUrl
}