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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: build-flow-plugin
    • Labels:
      None
    • Environment:
      RHEL6, Jenkins 1.473
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            jglick 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.

            Show
            jglick 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 .
            Hide
            scm_issue_link 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

            Show
            scm_issue_link 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
            Hide
            jglick Jesse Glick added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: