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

Build Flow jobs display “Post-build Actions” which are never saved

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • build-flow-plugin
    • None
    • RHEL6, Jenkins 1.473

      I am unable to add a Post-Build action to start another job from a Build Flow job. The option is there but if I add the action, save the job, and then go back to the configuration screen, my Post-Build action isn't saved. Other configuration params are saved properly.

          [JENKINS-14411] Build Flow jobs display “Post-build Actions” which are never saved

          Jesse Glick added a comment -

          Reproducible. This applies to any of the publishers that appear in the Post-build Actions list as of pull request #15. The reason seems to be this bit of code in BuildFlow:

          @Override
          public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() {
              return new DescribableList<Publisher,Descriptor<Publisher>>(this);
          }
          

          In other words, as of pull #15 it pretends to support publishers, but the list is always empty regardless of what you do.

          Adding a post-build action to start another job to a Build Flow job does not make a lot of sense; it would be clearer and simpler to just add build('thatJob') to your script. However, if the option appears in the UI it ought to work. More to the point, if you configure a downstream job to use the “Build after other projects are built” trigger and point to a Build Flow project, you expect that to either work or report an error; currently it is offered as an option but has no effect, which is very confusing.

          Probably the fix is to copy Project.publishers into BuildFlow, returning it from getPublishersList, and editing/overriding various associated methods to match: onLoad, getResourceActivities, buildDependencyGraph, and most importantly submit.

          Jesse Glick added a comment - Reproducible. This applies to any of the publishers that appear in the Post-build Actions list as of pull request #15 . The reason seems to be this bit of code in BuildFlow : @Override public DescribableList<Publisher, Descriptor<Publisher>> getPublishersList() { return new DescribableList<Publisher,Descriptor<Publisher>>( this ); } In other words, as of pull #15 it pretends to support publishers, but the list is always empty regardless of what you do. Adding a post-build action to start another job to a Build Flow job does not make a lot of sense; it would be clearer and simpler to just add build('thatJob') to your script. However, if the option appears in the UI it ought to work. More to the point, if you configure a downstream job to use the “Build after other projects are built” trigger and point to a Build Flow project, you expect that to either work or report an error; currently it is offered as an option but has no effect, which is very confusing. Probably the fix is to copy Project.publishers into BuildFlow , returning it from getPublishersList , and editing/overriding various associated methods to match: onLoad , getResourceActivities , buildDependencyGraph , and most importantly submit .

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          src/main/java/com/cloudbees/plugins/flow/BuildFlow.java
          src/main/java/com/cloudbees/plugins/flow/FlowRun.java
          http://jenkins-ci.org/commit/build-flow-plugin/1a536a0e0beb6d61695316a34f7d17f309fb685c
          Log:
          [FIXED JENKINS-14411] publisher support
          extend Project/Build, not AbstractProject/AbstractBuild
          to get full publisher support

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/com/cloudbees/plugins/flow/BuildFlow.java src/main/java/com/cloudbees/plugins/flow/FlowRun.java http://jenkins-ci.org/commit/build-flow-plugin/1a536a0e0beb6d61695316a34f7d17f309fb685c Log: [FIXED JENKINS-14411] publisher support extend Project/Build, not AbstractProject/AbstractBuild to get full publisher support

          Jesse Glick added a comment -

          For reference: this commit has been reported to cause an NPE for people upgrading from older versions.

          Jesse Glick added a comment - For reference: this commit has been reported to cause an NPE for people upgrading from older versions.

            ndeloof Nicolas De Loof
            rsweet Rob Sweet
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: