Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bamboo using api client in tool/domain layer #8094

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading