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

            rsweet Rob Sweet created issue -
            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 .
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Summary Build Flow jobs not able to start other jobs in Post-Build Build Flow jobs display “Post-build Actions” which are never saved
            Priority Minor [ 4 ] Major [ 3 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-14992 [ JENKINS-14992 ]
            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
            scm_issue_link SCM/JIRA link daemon made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            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.
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 145047 ] JNJira + In-Review [ 191328 ]

              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: