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: jenkins should be using fullName instead of scopeId when generating plan #7067

Merged
merged 1 commit into from
Feb 29, 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: 2 additions & 2 deletions backend/plugins/jenkins/api/blueprint_v200.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func makeDataSourcePipelinePlanV200(
subtaskMetas,
scopeConfig.Entities,
tasks.JenkinsOptions{
ConnectionId: jenkinsJob.ConnectionId,
ScopeId: jenkinsJob.ScopeId(),
ConnectionId: connection.ID,
FullName: jenkinsJob.FullName,
},
)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions backend/plugins/jenkins/impl/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,8 @@ func EnrichOptions(taskCtx plugin.TaskContext,
op *tasks.JenkinsOptions,
apiClient *helper.ApiAsyncClient) errors.Error {
jenkinsJob := &models.JenkinsJob{}
// If this is from BpV200, we should set JobFullName to scopeId
if op.JobFullName == "" {
op.JobFullName = op.ScopeId
op.JobFullName = op.FullName
}
// validate the op and set name=owner/repo if this is from advanced mode or bpV100
op, err := tasks.ValidateTaskOptions(op)
Expand Down
12 changes: 6 additions & 6 deletions backend/plugins/jenkins/tasks/task_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
type JenkinsApiParams models.JenkinsApiParams
type JenkinsOptions struct {
ConnectionId uint64 `json:"connectionId" mapstructure:"connectionId"`
ScopeId string `json:"scopeId" mapstructure:"scopeId"`
ScopeConfigId uint64 `json:"scopeConfigId" mapstructure:"scopeConfigId"`
JobFullName string `json:"jobFullName" mapstructure:"jobFullName"` // "path1/path2/job name"
JobName string `json:"jobName" mapstructure:"jobName"` // "job name"
JobPath string `json:"jobPath" mapstructure:"jobPath"` // "job/path1/job/path2"
Tasks []string `json:"tasks,omitempty" mapstructure:"tasks"`
ScopeConfigId uint64 `json:"scopeConfigId" mapstructure:"scopeConfigId,omitempty"`
FullName string `json:"fullName,omitempty" mapstructure:"fullName,omitempty"` // "path1/path2/job name"
JobFullName string `json:"jobFullName,omitempty" mapstructure:"jobFullName,omitempty"` // "path1/path2/job name"
JobName string `json:"jobName,omitempty" mapstructure:"jobName,omitempty"` // "job name"
JobPath string `json:"jobPath,omitempty" mapstructure:"jobPath,omitempty"` // "job/path1/job/path2"
Tasks []string `json:"tasks,omitempty" mapstructure:"tasks,omitempty"`
ScopeConfig *models.JenkinsScopeConfig `mapstructure:"scopeConfig" json:"scopeConfig"`
api.CollectorOptions `mapstructure:",squash"`
}
Expand Down
Loading