This is an automated email from the ASF dual-hosted git repository. abeizn pushed a commit to branch zk-0924 in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 897130608a0397a67de2445d588ac32f439eee5c Author: abeizn <[email protected]> AuthorDate: Tue Sep 24 10:37:03 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 }
