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

triggers is deprecated -> UNSTABLE build

    XMLWordPrintable

Details

    Description

      Hi,

      I am getting the warning:

      Warning: (xxxxxxxxxxx.groovy, line NNN) triggers is deprecated

      that exists as an UNSTABLE build,

       

      whereas I am using the new syntax for pipelineJob creation:

       

        properties {
              disableConcurrentBuilds()
              if(params.triggers != null && params.triggers.cron != null) {
                  triggers {
                    pipelineTriggers {
                      triggers {
                          cron {
                              spec(params.triggers.cron)
                          }
                      }
                   }
                 }
              }
      

      regards,

       

       

       

      Attachments

        Issue Links

          Activity

            based3 Basile Chandesris created issue -
            based3 Basile Chandesris made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-61463 [ JENKINS-61463 ]
            based3 Basile Chandesris made changes -
            Labels cron job-dsl-plugin pipelineJob properties unstable
            based3 Basile Chandesris made changes -
            Description Hi,

            I am getting the warning:

            {color:#ff8b00}Warning: (xxxxxxxxxxx.groovy, line NNN) triggers is deprecated{color}

            that exist as an {color:#0747a6}UNSTABLE{color} build,

             

            whereas I am using the new syntax for pipelineJob creation:

             
            {code:java}
              properties {
                    disableConcurrentBuilds()
                    if(params.triggers != null && params.triggers.cron != null) {
                        triggers {
                          pipelineTriggers {
                            triggers {
                                cron {
                                    spec(params.triggers.cron)
                                }
                            }
                         }
                       }
                    }
            {code}
            regards,

             

             

             
            Hi,

            I am getting the warning:

            {color:#ff8b00}Warning: (xxxxxxxxxxx.groovy, line NNN) triggers is deprecated{color}

            that exists as an {color:#0747a6}UNSTABLE{color} build,

             

            whereas I am using the new syntax for pipelineJob creation:

             
            {code:java}
              properties {
                    disableConcurrentBuilds()
                    if(params.triggers != null && params.triggers.cron != null) {
                        triggers {
                          pipelineTriggers {
                            triggers {
                                cron {
                                    spec(params.triggers.cron)
                                }
                            }
                         }
                       }
                    }
            {code}
            regards,

             

             

             

            There is no `triggers` in `properties`. In this case Groovy will search the outer contexts for a method with the same name and finds the deprecated one in `pipelineJob`.

            pipelineJob('example') {
              properties {
                disableConcurrentBuilds()
                if(params.triggers != null && params.triggers.cron != null) {
                  pipelineTriggers {
                    triggers {
                      cron {
                        spec(params.triggers.cron)
                      }
                    }
                  }
                }
              }
            }
            daspilker Daniel Spilker added a comment - There is no `triggers` in `properties`. In this case Groovy will search the outer contexts for a method with the same name and finds the deprecated one in `pipelineJob`. pipelineJob( 'example' ) { properties { disableConcurrentBuilds() if (params.triggers != null && params.triggers.cron != null ) { pipelineTriggers { triggers { cron { spec(params.triggers.cron) } } } } } }
            daspilker Daniel Spilker made changes -
            Assignee Daniel Spilker [ daspilker ] Basile Chandesris [ based3 ]
            Resolution Not A Defect [ 7 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]

            People

              based3 Basile Chandesris
              based3 Basile Chandesris
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: