kubesphere / ks-devops

This is a cloud-native application that focuses on the DevOps area.
https://kubesphere.io/devops/
Apache License 2.0
159 stars 90 forks source link

【devops】pipeline running error after modify the jenkinsfile parameters #630

Open TinaSprunt opened 3 years ago

TinaSprunt commented 3 years ago

Describe the bug When the pipeline is running,Three situations occur randomly

Situation 1:The input window gets the parameter value of the previous jenkinsfile. The pipeline in jenkins and k8s has been updated to the parameter value of the current jenkinsfile at this time, and an error 500 will be reported when you click Run

15

Situation 2: The input window does not display the jenkinsfile parameter value, and it runs normally (but the window does not display the jenkinsfile parameter to the user, which loses the meaning of setting the jenkinsfile parameter) 11

Situation 3:The input window shows that the current jenkinsfile parameter value is running normally,everything is ok

Environment kubesphere v3.1.0 kubernetes v1.20.4

To Reproduce

  1. create a pipeline. add jenkinsfile 5

  2. first run, There is no jenkinsfile parameter "Greeting" in the entry window 6

But Jenkins has already got the "Greeting" parameter 7

Check the running log, Greeting has been used 8

  1. Modify the "Greeting" parameter in jenkinsfile to "Greeting1" 9 10

  2. Second run,There is still no jenkinsfile parameter in the input window 11

Check the running log, actually we have used Greeting1 in the jenkinsfile parameter 12

  1. Modify the jenkinsfile parameter Greeting1 parameter to Greeting2 13

  2. Third run,The input window loaded the previous parameter Greeting1, but the put request has been successfully sent and the backend changed to Greeting2, 500 error was reported. 14 15

Expected behavior pipeline running normally

Kubesphere Chinese Community https://kubesphere.com.cn/forum/d/4586-devopspipeline-jenkinsfile

/priority high /area devops

TinaSprunt commented 3 years ago

@LinuxSuRen @huanggze

LinuxSuRen commented 3 years ago

Consider you have parameter arg1 which is not in the Jenkinsfile. The possible reason is that you created a parameter via UI. Please see also the following screenshot:

image

This is a drawback of Jenkins Pipeline. We cannot fix this from the KubeSphere DevOps side. In my opinion, there're two possible solutions that we can improve.

/cc @kubesphere/sig-console , please take a look at this issue. Thanks.

/remove-priority high /priority medium

TinaSprunt commented 3 years ago

arg1 created by via UI as you say.There will be problems when using web UI parameters and jenkinsfiles parameters at the same time. Put the parameters into Jenkinsfile directly when saving it maybe good idea.thanks a lot

LinuxSuRen commented 2 years ago

/area console