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

Deterministic order of build condition block execution in Declarative

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The build condition responders (currently postBuild and notifications, soon to be post within a stage) currently execute in the order they're specified in the Jenkinsfile. That should be changed to a deterministic order that'll be the same every time, and that order should be well documented and exposed in the logs.

        Attachments

          Issue Links

            Activity

            Hide
            casz Joseph Petersen added a comment - - edited

            Andrew Bayer

            The deterministic order is irritating to deal with when having to do something like this because Macs that have static workspaces and working with multiple nodes.
            I would prefer to have it follow my order or actually lower the always to something below success and failure...
            I could do the success as part of the stages but success provide me with a logical block to put certain events into the proper block

                        post {
                            failure {
                                archiveArtifacts 'fastlane/logs/**/*.log'
                            }
                            success {
                               script { 
                                   if (env.BRANCH_NAME == 'development') { 
                                       stash name: 'debug-ipa', includes: "output/*.ipa" 
                                   }
                                }
                            }
                            always {
                                delete()
                            }
                        }
            
            Show
            casz Joseph Petersen added a comment - - edited Andrew Bayer The deterministic order is irritating to deal with when having to do something like this because Macs that have static workspaces and working with multiple nodes. I would prefer to have it follow my order or actually lower the always to something below success and failure... I could do the success as part of the stages but success provide me with a logical block to put certain events into the proper block post { failure { archiveArtifacts 'fastlane/logs /**/ *.log' } success { script { if (env.BRANCH_NAME == 'development' ) { stash name: 'debug-ipa' , includes: "output/*.ipa" } } } always { delete() } }
            Hide
            scarlson scott carlson added a comment -

            Just want to add we currently feel the same was Joseph Petersen feels above, follow my order or at the least always would be better at the end.  Thankfully we have a way around it for now.

            Show
            scarlson scott carlson added a comment - Just want to add we currently feel the same was Joseph Petersen feels above, follow my order or at the least always would be better at the end.  Thankfully we have a way around it for now.
            Hide
            stefanthurnherr Stefan Thurnherr added a comment - - edited

            Andrew Bayer Agree with the two previous comments, for a similar reason:

            post {
            	always {
            		deleteDir()
            	}
            	success {
            	   emailext to: 'some@address.mail',
            		subject: 'Build was successful!',
            		mimeType: 'text/html',
            		body: readFile('releaseNotes.html') -- file is already deleted by "always" post-condition above
            	}
            }
            
            Show
            stefanthurnherr Stefan Thurnherr added a comment - - edited Andrew Bayer Agree with the two previous comments, for a similar reason: post { always { deleteDir() } success { emailext to: 'some@address.mail' , subject: 'Build was successful!' , mimeType: 'text/html' , body: readFile( 'releaseNotes.html' ) -- file is already deleted by "always" post-condition above } }
            Hide
            casz Joseph Petersen added a comment -

            I think we should reopen this issue, if you disagree Andrew, go ahead and close it.

            Show
            casz Joseph Petersen added a comment - I think we should reopen this issue, if you disagree Andrew, go ahead and close it.
            Hide
            abayer Andrew Bayer added a comment -

            Yeah, I'm closing this. JENKINS-41519 covers documenting the order, since that's not actually documented at this point.

            Show
            abayer Andrew Bayer added a comment - Yeah, I'm closing this. JENKINS-41519 covers documenting the order, since that's not actually documented at this point.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                abayer Andrew Bayer
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: