Details
-
Improvement
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
Jenkins:2.61, pipeline-model-definition: 1.1.4
-
-
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
- is duplicated by
-
JENKINS-66796 Matrix command in Declarative Pipeline does not filter nodes correctly.
-
- Open
-
-
JENKINS-46693 When condition requires executor allocation
-
- Closed
-
- links to
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.