Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42785

Parameterized Pipeline Projects have their Build Triggers unset after each build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

      This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

      I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

      Specifically, the following settings, if set before the build is run, become uncheckmarked:

      • Build after other projects are built
      • Build periodically
      • GitHub hook trigger for GITScm polling
      • Poll SCM

      Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

      Here is an example Pipeline script that reproduces this problem for me:

      pipeline {
          agent any
          parameters {
             string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')
          }
          stages {
             stage('stage1') {
                steps {
                   echo 'Running stage 1'
                }
             }
          }
       }

       

      Conversely, the following doesn't lose the scheduling settings:

      pipeline {
          agent any
          stages {
             stage('stage1') {
                steps {
                   echo 'Running stage 1'
                }
             }
          }
       }

        Attachments

          Issue Links

            Activity

            keithzg Keith Zubot-Gephart created issue -
            keithzg Keith Zubot-Gephart made changes -
            Field Original Value New Value
            Description At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

            This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

            I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

            Specifically, the following settings, if set before the build is run, become uncheckmarked:
             * Build after other projects are built
             * Build periodically
             * GitHub hook trigger for GITScm polling
             * Poll SCM

            Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

            Here is an example Pipeline script that reproduces this problem for me:

            {{pipeline \{}}
            {{   agent any}}
            {{   parameters \{}}
            {{      string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')}}
            {{   }}}
            {{   stages \{}}
            {{      stage('stage1') \{}}
            {{         steps \{}}
            {{            echo 'Running stage 1'}}
            {{         }}}
            {{      }}}
            {{   }}}
            {{}}}

             

            Conversely, the following doesn't lose the scheduling settings:

            {{pipeline \{}}
            {{   agent any}}
            {{   stages \{}}
            {{      stage('stage1') \{}}
            {{         steps \{}}
            {{            echo 'Running stage 1'}}
            {{         }}}
            {{      }}}
            {{   }}}
            {{}}}
            At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

            This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

            I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

            Specifically, the following settings, if set before the build is run, become uncheckmarked:
             * Build after other projects are built
             * Build periodically
             * GitHub hook trigger for GITScm polling
             * Poll SCM

            Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

            Here is an example Pipeline script that reproduces this problem for me:

            {{pipeline \{}}
             {{   agent any}}
             {{   parameters \{}}
             {{      string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')}}
             {{   }}}
             {{   stages \{}}
             {{      stage('stage1') \{}}
             {{         steps \{}}
             {{            echo 'Running stage 1'}}
             {{         }}}
                        }
             {{   }}}
             {{}}}

             

            Conversely, the following doesn't lose the scheduling settings:

            {{pipeline \{}}
             {{   agent any}}
             {{   stages \{}}
             {{      stage('stage1') \{}}
             {{         steps \{}}
             {{            echo 'Running stage 1'}}
             {{         }}}
                        }
             {{   }}}
             {{}}}
            keithzg Keith Zubot-Gephart made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            keithzg Keith Zubot-Gephart made changes -
            Description At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

            This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

            I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

            Specifically, the following settings, if set before the build is run, become uncheckmarked:
             * Build after other projects are built
             * Build periodically
             * GitHub hook trigger for GITScm polling
             * Poll SCM

            Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

            Here is an example Pipeline script that reproduces this problem for me:

            {{pipeline \{}}
             {{   agent any}}
             {{   parameters \{}}
             {{      string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')}}
             {{   }}}
             {{   stages \{}}
             {{      stage('stage1') \{}}
             {{         steps \{}}
             {{            echo 'Running stage 1'}}
             {{         }}}
                        }
             {{   }}}
             {{}}}

             

            Conversely, the following doesn't lose the scheduling settings:

            {{pipeline \{}}
             {{   agent any}}
             {{   stages \{}}
             {{      stage('stage1') \{}}
             {{         steps \{}}
             {{            echo 'Running stage 1'}}
             {{         }}}
                        }
             {{   }}}
             {{}}}
            At least as of a few updates ago (I swear this used to work) I've noticed all the Pipeline projects I've set up only trigger once, and then I have to go in and set the build triggers again because all the triggers have become unset.

            This of course makes the pipeline projects I've set up fairly unhelpful, since this thus requires manual intervention for every single run.

            I've narrowed this down to parameters. If I have a "Pipeline script" or specify a Jenkinsfile with "Pipeline script from SCM", any build (whether triggered by one of the Build Triggers or manually) results in the Build Triggers becoming unset.

            Specifically, the following settings, if set before the build is run, become uncheckmarked:
             * Build after other projects are built
             * Build periodically
             * GitHub hook trigger for GITScm polling
             * Poll SCM

            Interestingly, although they are also under the Build Triggers heading, "Quiet period" and "Trigger builds remotely (e.g., from scripts)" remain set.

            Here is an example Pipeline script that reproduces this problem for me:
            {code:java}
            pipeline {
                agent any
                parameters {
                   string(name: 'requested', defaultValue: 'all', description: 'Which stages should be run?')
                }
                stages {
                   stage('stage1') {
                      steps {
                         echo 'Running stage 1'
                      }
                   }
                }
             }{code}
             

            Conversely, the following doesn't lose the scheduling settings:
            {code:java}
            pipeline {
                agent any
                stages {
                   stage('stage1') {
                      steps {
                         echo 'Running stage 1'
                      }
                   }
                }
             }{code}
            abayer Andrew Bayer made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Issue Type Bug [ 1 ] Story [ 10002 ]
            abayer Andrew Bayer made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Link This issue duplicates JENKINS-44621 [ JENKINS-44621 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                keithzg Keith Zubot-Gephart
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: