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

When clause shouldn't require node to evaluate

    XMLWordPrintable

Details

    • Pipeline - December

    Description

      In previous versions of Jenkins Pipeline, each stage's "where" clause would evaluate quickly, not requiring an allocated node to see if its stage needed to be run.  Suddenly, we see Jenkins  allocating the stage's node to evaluate the "where" clause for each stage.  Allocating nodes for us is fairly expensive and we want to avoid this if the where clause stipulates the stage won't run.

      Attachments

        Issue Links

          Activity

            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

            Code changed in jenkins
            User: Liam Newman
            Path:
            content/doc/book/pipeline/syntax.adoc
            http://jenkins-ci.org/commit/jenkins.io/003b9ead4337beba1b4a835a2496f2d7ce1ad365
            Log:
            Merge pull request #1290 from abayer/jenkins-44461

            JENKINS-44461 Add documentation for new when->beforeAgent field

            Compare: https://github.com/jenkins-infra/jenkins.io/compare/ff40d07092a3...003b9ead4337

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Liam Newman Path: content/doc/book/pipeline/syntax.adoc http://jenkins-ci.org/commit/jenkins.io/003b9ead4337beba1b4a835a2496f2d7ce1ad365 Log: Merge pull request #1290 from abayer/jenkins-44461 JENKINS-44461 Add documentation for new when->beforeAgent field Compare: https://github.com/jenkins-infra/jenkins.io/compare/ff40d07092a3...003b9ead4337

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            content/doc/book/pipeline/syntax.adoc
            http://jenkins-ci.org/commit/jenkins.io/09ee78185f68c7212613202ef20d7523504acf1c
            Log:
            JENKINS-44461 Add documentation for new when->beforeAgent field

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: content/doc/book/pipeline/syntax.adoc http://jenkins-ci.org/commit/jenkins.io/09ee78185f68c7212613202ef20d7523504acf1c Log: JENKINS-44461 Add documentation for new when->beforeAgent field
            abayer Andrew Bayer added a comment -

            Merged, will be in Declarative 1.2.6.

            abayer Andrew Bayer added a comment - Merged, will be in Declarative 1.2.6.

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWhen.java
            pipeline-model-api/src/main/resources/ast-schema.json
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/StageConditionals.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/RuntimeASTTransformer.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WhenStageTest.java
            pipeline-model-definition/src/test/resources/json/whenBeforeAgentTrue.json
            pipeline-model-definition/src/test/resources/whenBeforeAgentFalse.groovy
            pipeline-model-definition/src/test/resources/whenBeforeAgentTrue.groovy
            pipeline-model-definition/src/test/resources/whenBeforeAgentUnspecified.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ae2406d833ccb9b199e9c4865d302ef882ed1dae
            Log:
            [FIXED JENKINS-44461] Add beforeAgent flag for when

            If true, the when condition will be evaluated before entering the
            stage's agent (if defined). The default is false - better safe than
            sorry there.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWhen.java pipeline-model-api/src/main/resources/ast-schema.json pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/StageConditionals.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/RuntimeASTTransformer.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/WhenStageTest.java pipeline-model-definition/src/test/resources/json/whenBeforeAgentTrue.json pipeline-model-definition/src/test/resources/whenBeforeAgentFalse.groovy pipeline-model-definition/src/test/resources/whenBeforeAgentTrue.groovy pipeline-model-definition/src/test/resources/whenBeforeAgentUnspecified.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/ae2406d833ccb9b199e9c4865d302ef882ed1dae Log: [FIXED JENKINS-44461] Add beforeAgent flag for when If true, the when condition will be evaluated before entering the stage's agent (if defined). The default is false - better safe than sorry there.

            People

              abayer Andrew Bayer
              chrisleck Christopher Eck
              Votes:
              10 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: