Skip to content

Commit

Permalink
fix: jenkins should be using fullName instead of scopeId when gen…
Browse files Browse the repository at this point in the history
…erating plan (#7067) (#7071)

Co-authored-by: Klesh Wong <zhenmian.huang@merico.dev>
  • Loading branch information
github-actions[bot] and klesh authored Feb 29, 2024
1 parent 7733647 commit 17221ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
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

0 comments on commit 17221ae

Please sign in to comment.