Skip to content

Commit

Permalink
fix: bamboo using api client in tool/domain layer (#8094)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeizn authored and mintsweet committed Sep 24, 2024
1 parent 132566b commit 1cf7523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions backend/plugins/bamboo/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
}
Expand Down

0 comments on commit 1cf7523

Please sign in to comment.