You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/02/29 10:10:50 UTC
(incubator-devlake) 01/01: fix: jenkins should be using `fullName` instead of `scopeId` when generating plan
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-7059-jenkins-task-showing-undefined
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit a23219d087f460a8ca37253bf9a7a3b3f8485064
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Thu Feb 29 18:10:13 2024 +0800
fix: jenkins should be using `fullName` instead of `scopeId` when generating plan
---
backend/plugins/jenkins/api/blueprint_v200.go | 4 ++--
backend/plugins/jenkins/impl/impl.go | 3 +--
backend/plugins/jenkins/tasks/task_data.go | 12 ++++++------
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/backend/plugins/jenkins/api/blueprint_v200.go b/backend/plugins/jenkins/api/blueprint_v200.go
index 9aaf59641..cd51141e2 100644
--- a/backend/plugins/jenkins/api/blueprint_v200.go
+++ b/backend/plugins/jenkins/api/blueprint_v200.go
@@ -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 {
diff --git a/backend/plugins/jenkins/impl/impl.go b/backend/plugins/jenkins/impl/impl.go
index f8f0e16d3..586074358 100644
--- a/backend/plugins/jenkins/impl/impl.go
+++ b/backend/plugins/jenkins/impl/impl.go
@@ -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)
diff --git a/backend/plugins/jenkins/tasks/task_data.go b/backend/plugins/jenkins/tasks/task_data.go
index c2058412e..44bf8f2c8 100644
--- a/backend/plugins/jenkins/tasks/task_data.go
+++ b/backend/plugins/jenkins/tasks/task_data.go
@@ -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"`
}