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

Periodic Build Trigger Column not shown for Pipeline Jobs

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • extra-columns-plugin
    • jenkins 2.121.1
      extra-columns 1.19-SNAPSHOT (private-78d5adb8-jenkins)
    • extra-columns 1.19

      When the periodic-build-trigger column is added to a list view and a pipeline job which has a periodic build trigger is displayed in that view, then the periodic-build-trigger column is empty.

      Expected behavior: the value of the periodic build trigger of the pipeline job is displayed in the periodic-build-trigger column.

          [JENKINS-52403] Periodic Build Trigger Column not shown for Pipeline Jobs

          Oleg Nenashev added a comment -

          CC svanoort rsandell abayer . I am not 100% sure Pipeline offers API which would allow doing that

          Oleg Nenashev added a comment - CC svanoort rsandell abayer . I am not 100% sure Pipeline offers API which would allow doing that

          Sam Van Oort added a comment -

          Looks like the CronTriggerColumn has an explicit typecast to AbstractProject that will fail for Pipelines – https://github.com/jenkinsci/extra-columns-plugin/blob/master/src/main/java/jenkins/plugins/extracolumns/CronTriggerColumn.java#L62

          It would work if that we did an instanceof check for AbstractProject (and only cast to that if legal), then we could handle Pipeline jobs with

          Map<TriggerDescriptor, Trigger> triggers = null;
          if (job instanceof AbstractProject) {
              triggers  = ((AbstractProject)job).getTriggers();
          } if (job instanceof ParameterizedJobMixIn.ParameterizedJob) {
              triggers = ((ParameterizedJobMixIn.ParameterizedJob)job).getTriggers();
          }
          

          Sam Van Oort added a comment - Looks like the CronTriggerColumn has an explicit typecast to AbstractProject that will fail for Pipelines – https://github.com/jenkinsci/extra-columns-plugin/blob/master/src/main/java/jenkins/plugins/extracolumns/CronTriggerColumn.java#L62 It would work if that we did an instanceof check for AbstractProject (and only cast to that if legal), then we could handle Pipeline jobs with Map<TriggerDescriptor, Trigger> triggers = null ; if (job instanceof AbstractProject) { triggers = ((AbstractProject)job).getTriggers(); } if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { triggers = ((ParameterizedJobMixIn.ParameterizedJob)job).getTriggers(); }

          Sam Van Oort added a comment -

          fredg If you want to further Pipeline-enable your plugin I suspect the above will get you there

          Sam Van Oort added a comment - fredg If you want to further Pipeline-enable your plugin I suspect the above will get you there

          Fred G added a comment -

          Released in extra-columns plugin version 1.19.

          Fred G added a comment - Released in extra-columns plugin version 1.19.

          Juergen added a comment -

          Thank you, works great.

          Juergen added a comment - Thank you, works great.

            jgk Juergen
            jgk Juergen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: