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

periodic trigger always results in 1 minute

    XMLWordPrintable

Details

    Description

      No matter the value passed in to a periodic trigger, it results in a period of 1 minute. (also noted in JENKINS-54877)

      I suspect the hard-coded cron spec here is the culprit: https://github.com/jenkinsci/job-dsl-plugin/blob/45052e1545c4c30496cfdda1943a1d7eac998ccc/job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/triggers/MultibranchWorkflowTriggerContext.groovy#L20

      Note that the trigger class itself actually does some comparison of the values to generate a roughly right cron spec: https://github.com/jenkinsci/cloudbees-folder-plugin/blob/master/src/main/java/com/cloudbees/hudson/plugins/folder/computed/PeriodicFolderTrigger.java

      Attachments

        Issue Links

          Activity

            Ha, good catch!

            I will enable Dynamic DSL for computed folder triggers with the next release. Then the following will work:

            organizationFolder('example') {
              triggers {
                periodicFolderTrigger {
                  interval('5m') // or '2h', '7d', '5000ms', '60s'
                }
              }
            }
            

            I will deprecate the existing periodic method in favor of the Dynamic DSL. I do not want to add any logic to Job DSL to compute the cron string nor should a user have to specify both, the cron string and the interval.

            daspilker Daniel Spilker added a comment - Ha, good catch! I will enable Dynamic DSL for computed folder triggers with the next release. Then the following will work: organizationFolder( 'example' ) { triggers { periodicFolderTrigger { interval( '5m' ) // or '2h' , '7d' , '5000ms' , '60s' } } } I will deprecate the existing periodic method in favor of the Dynamic DSL. I do not want to add any logic to Job DSL to compute the cron string nor should a user have to specify both, the cron string and the interval.

            daspilker sorry to bother but did this get documented anywhere? Took me ages to find this ticket to figure out what to set `interval` to to get it to work. The JobDSL API explorer only tells me that it expects a string, but not what format.

            gpaciga Gregory Paciga added a comment - daspilker sorry to bother but did this get documented anywhere? Took me ages to find this ticket to figure out what to set `interval` to to get it to work. The JobDSL API explorer only tells me that it expects a string, but not what format.

            The Job DSL syntax is generated from runtime information provided by the plugin, in this case the Folders plugin. The plugin needs to provide a HTML file which will be shown in the API viewer. In this case the Folders plugin needs to provide com/cloudbees/hudson/plugins/folder/computed/PeriodicFolderTrigger/help-interval.html. Can you file a pull request for the Folders plugin to add the file with the relevant documentation?

            daspilker Daniel Spilker added a comment - The Job DSL syntax is generated from runtime information provided by the plugin, in this case the Folders plugin. The plugin needs to provide a HTML file which will be shown in the API viewer. In this case the Folders plugin needs to provide com/cloudbees/hudson/plugins/folder/computed/PeriodicFolderTrigger/help-interval.html. Can you file a pull request for the Folders plugin to add the file with the relevant documentation?
            bruce_szalwinski bruce szalwinski added a comment - https://github.com/jenkinsci/cloudbees-folder-plugin/pull/172

            facing same issues.

            We are in disaster because we had 197 organizations (Bitbucket server projects)..

            Just imagine how much memory consume ?

            It consumes more than 24GO RAM and it wants more !!!

            abdennour Abdennour Toumi added a comment - facing same issues. We are in disaster because we had 197 organizations (Bitbucket server projects).. Just imagine how much memory consume ? It consumes more than 24GO RAM and it wants more !!!

            People

              gpaciga Gregory Paciga
              seadub Chris Williams
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: