Skip to content
Permalink
Browse files

Merge branch 'master' into JENKINS-40370

Conflicts:
	pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
	pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy
	pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineScript.groovy
  • Loading branch information
abayer committed Jan 9, 2017
2 parents 73fade1 + 1e14524 commit 528818f7948d6f5fd1cfa38fb5b102dbb37ecac5
Showing with 1,368 additions and 677 deletions.
  1. +32 −12 SYNTAX.md
  2. +57 −21 ...ine-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTAgent.java
  3. +135 −0 ...odel-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTClosureMap.java
  4. +1 −0 ...el-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidator.java
  5. +53 −9 pipeline-model-api/src/main/resources/ast-schema.json
  6. +20 −1 ...rc/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgentDescriptor.java
  7. +22 −16 ...odel-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
  8. +2 −7 ...model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Root.groovy
  9. +1 −11 ...odel-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Stage.groovy
  10. +33 −4 ...efinition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/JSONParser.groovy
  11. +70 −15 ...finition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/parser/ModelParser.groovy
  12. +29 −29 ...rc/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
  13. +10 −10 ...ition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipeline.java
  14. +16 −12 .../java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfile.java
  15. +6 −2 ...n/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy
  16. +12 −0 ...-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/Messages.properties
  17. +1 −2 ...inition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
  18. +1 −1 ...g/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineFromDockerfileScript.groovy
  19. +2 −2 ...n/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/DockerPipelineScript.groovy
  20. +3 −2 ...esources/org/jenkinsci/plugins/pipeline/modeldefinition/config/FolderConfig/help-dockerLabel.html
  21. +3 −2 ...esources/org/jenkinsci/plugins/pipeline/modeldefinition/config/GlobalConfig/help-dockerLabel.html
  22. +4 −7 ...definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
  23. +21 −4 ...line-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AgentTest.java
  24. +51 −0 ...el-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
  25. +117 −0 ...model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/DurabilityTest.java
  26. +9 −2 ...-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
  27. +6 −1 pipeline-model-definition/src/test/resources/agentDocker.groovy
  28. +7 −1 pipeline-model-definition/src/test/resources/agentDockerEnvSpecLabel.groovy
  29. +6 −1 pipeline-model-definition/src/test/resources/agentDockerEnvTest.groovy
  30. +6 −1 pipeline-model-definition/src/test/resources/agentDockerWithEmptyDockerArgs.groovy
  31. +6 −1 pipeline-model-definition/src/test/resources/agentDockerWithNullDockerArgs.groovy
  32. +3 −1 pipeline-model-definition/src/test/resources/agentLabel.groovy
  33. +3 −1 pipeline-model-definition/src/test/resources/buildPluginParentPOM.groovy
  34. +3 −1 pipeline-model-definition/src/test/resources/dockerGlobalVariable.groovy
  35. +3 −1 pipeline-model-definition/src/test/resources/dockerGlobalVariableInScript.groovy
  36. +3 −1 pipeline-model-definition/src/test/resources/environmentInStage.groovy
  37. +3 −1 pipeline-model-definition/src/test/resources/errors/agentMissingRequiredParam.groovy
  38. +7 −1 pipeline-model-definition/src/test/resources/errors/agentUnknownParamForType.groovy
  39. +3 −1 pipeline-model-definition/src/test/resources/errors/duplicateEnvironment.groovy
  40. +3 −1 pipeline-model-definition/src/test/resources/errors/emptyEnvironment.groovy
  41. +3 −1 pipeline-model-definition/src/test/resources/errors/globalLibraryNonStepBody.groovy
  42. +3 −1 pipeline-model-definition/src/test/resources/errors/globalLibraryObjectMethodCall.groovy
  43. +3 −1 pipeline-model-definition/src/test/resources/errors/invalidMetaStepSyntax.groovy
  44. +40 −0 pipeline-model-definition/src/test/resources/errors/multipleAgentTypes.groovy
  45. +3 −1 pipeline-model-definition/src/test/resources/errors/notInstalledToolVersion.groovy
  46. +3 −1 pipeline-model-definition/src/test/resources/errors/perStageConfigEmptySteps.groovy
  47. +3 −1 pipeline-model-definition/src/test/resources/errors/perStageConfigMissingSteps.groovy
  48. +3 −1 pipeline-model-definition/src/test/resources/errors/perStageConfigUnknownSection.groovy
  49. +3 −1 pipeline-model-definition/src/test/resources/errors/unknownAgentType.groovy
  50. +3 −1 pipeline-model-definition/src/test/resources/errors/unlistedToolType.groovy
  51. +5 −1 pipeline-model-definition/src/test/resources/failureBeforeStages.groovy
  52. +6 −1 pipeline-model-definition/src/test/resources/fromAlternateDockerfile.groovy
  53. +5 −1 pipeline-model-definition/src/test/resources/fromDockerfile.groovy
  54. +40 −0 pipeline-model-definition/src/test/resources/fromDockerfileNoArgs.groovy
  55. +3 −1 pipeline-model-definition/src/test/resources/globalLibrarySuccess.groovy
  56. +3 −1 pipeline-model-definition/src/test/resources/globalLibrarySuccessInScript.groovy
  57. +1 −4 pipeline-model-definition/src/test/resources/json/agentAny.json
  58. +19 −7 pipeline-model-definition/src/test/resources/json/agentDocker.json
  59. +4 −4 pipeline-model-definition/src/test/resources/json/agentLabel.json
  60. +1 −4 pipeline-model-definition/src/test/resources/json/agentNoneWithNode.json
  61. +0 −31 pipeline-model-definition/src/test/resources/json/agentTypeOrdering.json
  62. +3 −6 pipeline-model-definition/src/test/resources/json/basicWhen.json
  63. +4 −4 pipeline-model-definition/src/test/resources/json/environmentInStage.json
  64. +4 −4 pipeline-model-definition/src/test/resources/json/errors/agentMissingRequiredParam.json
  65. +26 −23 pipeline-model-definition/src/test/resources/json/errors/agentUnknownParamForType.json
  66. +5 −5 pipeline-model-definition/src/test/resources/json/errors/emptyEnvironment.json
  67. +2 −5 pipeline-model-definition/src/test/resources/json/errors/emptyJobProperties.json
  68. +1 −4 pipeline-model-definition/src/test/resources/json/errors/emptyParallel.json
  69. +2 −5 pipeline-model-definition/src/test/resources/json/errors/emptyParameters.json
  70. +4 −10 pipeline-model-definition/src/test/resources/json/errors/emptyPostBuild.json
  71. +2 −5 pipeline-model-definition/src/test/resources/json/errors/emptyStages.json
  72. +2 −6 pipeline-model-definition/src/test/resources/json/errors/emptyTriggers.json
  73. +16 −6 pipeline-model-definition/src/test/resources/json/errors/invalidBuildCondition.json
  74. +4 −7 pipeline-model-definition/src/test/resources/json/errors/invalidParameterTypeMethodCall.json
  75. +1 −4 pipeline-model-definition/src/test/resources/json/errors/invalidWrapperType.json
  76. +1 −4 pipeline-model-definition/src/test/resources/json/errors/malformed.json
  77. +11 −13 pipeline-model-definition/src/test/resources/json/errors/missingAgent.json
  78. +1 −4 pipeline-model-definition/src/test/resources/json/errors/missingRequiredMethodCallArg.json
  79. +2 −13 pipeline-model-definition/src/test/resources/json/errors/missingRequiredStepParameters.json
  80. +1 −6 pipeline-model-definition/src/test/resources/json/errors/missingStages.json
  81. +8 −13 pipeline-model-definition/src/test/resources/json/errors/mixedMethodArgs.json
  82. +4 −4 pipeline-model-definition/src/test/resources/json/errors/notInstalledToolType.json
  83. +4 −4 pipeline-model-definition/src/test/resources/json/errors/notInstalledToolVersion.json
  84. +1 −4 pipeline-model-definition/src/test/resources/json/errors/notificationsSectionRemoved.json
  85. +5 −8 pipeline-model-definition/src/test/resources/json/errors/perStageConfigEmptySteps.json
  86. +6 −9 pipeline-model-definition/src/test/resources/json/errors/perStageConfigMissingSteps.json
  87. +1 −4 pipeline-model-definition/src/test/resources/json/errors/perStageConfigUnknownSection.json
  88. +10 −13 pipeline-model-definition/src/test/resources/json/errors/rejectParallelMixedInSteps.json
  89. +2 −5 pipeline-model-definition/src/test/resources/json/errors/rejectPropertiesStepInMethodCall.json
  90. +13 −14 pipeline-model-definition/src/test/resources/json/errors/rejectStageInSteps.json
  91. +1 −4 pipeline-model-definition/src/test/resources/json/errors/stageWithoutName.json
  92. +4 −4 pipeline-model-definition/src/test/resources/json/errors/unknownAgentType.json
  93. +1 −4 pipeline-model-definition/src/test/resources/json/errors/unknownBareAgentType.json
  94. +2 −5 pipeline-model-definition/src/test/resources/json/errors/unknownStepParameter.json
  95. +4 −4 pipeline-model-definition/src/test/resources/json/errors/unlistedToolType.json
  96. +4 −7 pipeline-model-definition/src/test/resources/json/errors/wrongParameterNameMethodCall.json
  97. +12 −12 pipeline-model-definition/src/test/resources/json/globalLibrarySuccess.json
  98. +10 −10 pipeline-model-definition/src/test/resources/json/legacyMetaStepSyntax.json
  99. +4 −4 pipeline-model-definition/src/test/resources/json/metaStepSyntax.json
  100. +34 −0 pipeline-model-definition/src/test/resources/json/multipleVariablesForAgent.json
  101. +5 −8 pipeline-model-definition/src/test/resources/json/multipleWrappers.json
  102. +4 −7 pipeline-model-definition/src/test/resources/json/parallelPipeline.json
  103. +3 −6 pipeline-model-definition/src/test/resources/json/parallelPipelineQuoteEscaping.json
  104. +7 −10 pipeline-model-definition/src/test/resources/json/parallelPipelineWithFailFast.json
  105. +3 −6 pipeline-model-definition/src/test/resources/json/parallelPipelineWithSpaceInBranch.json
  106. +5 −8 pipeline-model-definition/src/test/resources/json/perStageConfigAgent.json
  107. +4 −4 pipeline-model-definition/src/test/resources/json/simpleEnvironment.json
  108. +2 −5 pipeline-model-definition/src/test/resources/json/simpleJobProperties.json
  109. +4 −7 pipeline-model-definition/src/test/resources/json/simpleParameters.json
  110. +1 −4 pipeline-model-definition/src/test/resources/json/simplePipeline.json
  111. +11 −14 pipeline-model-definition/src/test/resources/json/simplePostBuild.json
  112. +1 −4 pipeline-model-definition/src/test/resources/json/simpleScript.json
  113. +5 −5 pipeline-model-definition/src/test/resources/json/simpleTools.json
  114. +1 −4 pipeline-model-definition/src/test/resources/json/simpleTriggers.json
  115. +3 −6 pipeline-model-definition/src/test/resources/json/simpleWrapper.json
  116. +3 −6 pipeline-model-definition/src/test/resources/json/skippedWhen.json
  117. +24 −33 pipeline-model-definition/src/test/resources/json/stringsNeedingEscapeLogic.json
  118. +4 −4 pipeline-model-definition/src/test/resources/json/toolsInStage.json
  119. +1 −4 pipeline-model-definition/src/test/resources/json/twoStagePipeline.json
  120. +1 −4 pipeline-model-definition/src/test/resources/json/validStepParameters.json
  121. +3 −1 pipeline-model-definition/src/test/resources/legacyMetaStepSyntax.groovy
  122. +42 −0 pipeline-model-definition/src/test/resources/libraryObjectInScript.groovy
  123. +43 −0 pipeline-model-definition/src/test/resources/libraryObjectOutsideScript.groovy
  124. +3 −1 pipeline-model-definition/src/test/resources/metaStepSyntax.groovy
  125. +6 −1 ...model-definition/src/test/resources/{agentTypeOrdering.groovy → multipleVariablesForAgent.groovy}
  126. +3 −1 pipeline-model-definition/src/test/resources/noCheckoutScmInWrongContext.groovy
  127. +3 −1 pipeline-model-definition/src/test/resources/nonLiteralEnvironment.groovy
  128. +3 −1 pipeline-model-definition/src/test/resources/perStageConfigAgent.groovy
  129. +3 −1 pipeline-model-definition/src/test/resources/postStage/localAll.groovy
  130. +3 −1 pipeline-model-definition/src/test/resources/simpleEnvironment.groovy
  131. +3 −1 pipeline-model-definition/src/test/resources/simpleTools.groovy
  132. +3 −1 pipeline-model-definition/src/test/resources/toolsInStage.groovy
  133. +3 −1 pipeline-model-definition/src/test/resources/when/simpleWhen.groovy
  134. +3 −1 pipeline-model-definition/src/test/resources/when/whenEmpty.groovy
  135. +3 −1 pipeline-model-definition/src/test/resources/when/whenException.groovy
@@ -13,30 +13,48 @@ These are sections that are specified directly within the `pipeline` argument cl
* *Description*: Specifies where the build or stage will run.
* *Required*: Yes for the top-level `pipeline` closure, optional for individual `stage` closures.
* *Allowed In*: Top-level `pipeline` closure and individual `stage` closures.
* *Parameters*: Either a `Map` of one or more arguments or one of two constants - `none` or `any`.
* *Parameters*: Either a `Closure` of one key and either a single value or a `Closure` of multiple configuration pairs, or one of two constants - `none` or `any`.
* *Map Keys*:
* Note that this will be an `ExtensionPoint`, so plugins will be able to add to the available image providers.
* `docker`
* *Type*: `String`
* *Description*: If given, uses this Docker image for the container the build will run in. If no `label` is
given, the container will be run within a simple `node { ... }` block.
* *Example*: `docker:'ubuntu'`
* `dockerfile`
* *Description*: If given, builds from the Dockerfile in the repository and runs in a container using the resulting image.
* `label`
* *Type*: `String`
* *Description*: If given, uses this label for the node the build will run on - if `docker` is also
specified, the container will run on that node.
* *Example*: `label:'hi-speed'`
* `none`
* *Type*: bareword
* *Description*: If given, node/image management will need to be specified explicitly in stages and no
automatic `checkout scm` call will occur.
* *Takes a Closure*: No
* `any`
* *Type*: bareword
* *Description*: If given, any available agent will be used.
* *Takes a Closure*: yes
* *Examples*:
* `agent label:'has-docker', docker:'ubuntu:lts'`
* `agent docker:'ubuntu:lts'`
* `agent label:'hi-speed'`
* `agent none`
* `agent any`

```groovy
agent {
label 'hi-speed'
}
agent {
docker 'ubuntu:lts'
}
agent {
docker {
image 'ubuntu:lts'
label 'has-docker'
args "-v /tmp:/tmp -p 80:80"
}
}
agent none
agent any
```

### environment
* *Description*: A sequence of `key = value` pairs, which will be passed to the `withEnv` step the build will be
@@ -109,7 +127,9 @@ stages {
}
stage('second') {
agent label:'some-node'
agent {
label 'some-node'
}
when {
branch "master"
}
@@ -1,5 +1,6 @@
package org.jenkinsci.plugins.pipeline.modeldefinition.ast;

import net.sf.json.JSONObject;
import org.jenkinsci.plugins.pipeline.modeldefinition.validator.ModelValidator;

/**
@@ -9,57 +10,87 @@
* @author Andrew Bayer
*/
public final class ModelASTAgent extends ModelASTElement {
private ModelASTArgumentList args;
private ModelASTMethodArg variables;
private ModelASTKey agentType;

public ModelASTAgent(Object sourceLocation) {
super(sourceLocation);
}

@Override
public Object toJSON() {
return args.toJSON();
public JSONObject toJSON() {
final JSONObject j = new JSONObject();
j.accumulate("type", agentType.toJSON());

if (variables != null) {
if (variables instanceof ModelASTClosureMap &&
!((ModelASTClosureMap) variables).getVariables().isEmpty()) {
j.accumulate("arguments", variables.toJSON());
} else if (variables instanceof ModelASTValue) {
j.accumulate("argument", variables.toJSON());
}
}
return j;
}

@Override
public void validate(ModelValidator validator) {
validator.validateElement(this);

args.validate(validator);
if (variables != null) {
variables.validate(validator);
}
}

@Override
public String toGroovy() {
String argStr;
// TODO: Stop special-casing agent none.
if (args instanceof ModelASTSingleArgument && (
((ModelASTSingleArgument) args).getValue().getValue().equals("none") || ((ModelASTSingleArgument) args)
.getValue().getValue().equals("any"))) {
argStr = (String)((ModelASTSingleArgument) args).getValue().getValue();
StringBuilder argStr = new StringBuilder();
if (variables == null ||
(variables instanceof ModelASTClosureMap &&
((ModelASTClosureMap)variables).getVariables().isEmpty())) {
argStr.append(agentType.toGroovy());
} else {
argStr = args.toGroovy();
argStr.append("{\n");
argStr.append(agentType.toGroovy());
argStr.append(" ");
argStr.append(variables.toGroovy());
argStr.append("}");
}

return "agent " + argStr + "\n";
return "agent " + argStr.toString() + "\n";
}

@Override
public void removeSourceLocation() {
super.removeSourceLocation();
args.removeSourceLocation();
if (agentType != null) {
agentType.removeSourceLocation();
}
if (variables != null) {
variables.removeSourceLocation();
}
}

public ModelASTKey getAgentType() {
return agentType;
}

public void setAgentType(ModelASTKey k) {
this.agentType = k;
}

public ModelASTArgumentList getArgs() {
return args;
public ModelASTMethodArg getVariables() {
return variables;
}

public void setArgs(ModelASTArgumentList args) {
this.args = args;
public void setVariables(ModelASTMethodArg variables) {
this.variables = variables;
}

@Override
public String toString() {
return "ModelASTAgent{" +
"args=" + args +
"agentType=" + agentType +
"variables=" + variables +
"}";
}

@@ -77,14 +108,19 @@ public boolean equals(Object o) {

ModelASTAgent that = (ModelASTAgent) o;

return getArgs() != null ? getArgs().equals(that.getArgs()) : that.getArgs() == null;
if (getAgentType() != null ? !getAgentType().equals(that.getAgentType()) : that.getAgentType() != null) {
return false;
}

return getVariables() != null ? getVariables().equals(that.getVariables()) : that.getVariables() == null;

}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (getArgs() != null ? getArgs().hashCode() : 0);
result = 31 * result + (getAgentType() != null ? getAgentType().hashCode() : 0);
result = 31 * result + (getVariables() != null ? getVariables().hashCode() : 0);
return result;
}

@@ -0,0 +1,135 @@
/*
* The MIT License
*
* Copyright (c) 2017, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package org.jenkinsci.plugins.pipeline.modeldefinition.ast;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.jenkinsci.plugins.pipeline.modeldefinition.validator.ModelValidator;

import java.util.LinkedHashMap;
import java.util.Map;

/**
* Represents a map of names to possible method arguments, in closure form in Groovy
*
* @author Andrew Bayer
*/
public final class ModelASTClosureMap extends ModelASTElement implements ModelASTMethodArg {
private Map<ModelASTKey, ModelASTMethodArg> variables = new LinkedHashMap<>();

public ModelASTClosureMap(Object sourceLocation) {
super(sourceLocation);
}

@Override
public JSONArray toJSON() {
final JSONArray a = new JSONArray();
for (Map.Entry<ModelASTKey, ModelASTMethodArg> entry: variables.entrySet()) {
JSONObject o = new JSONObject();
o.accumulate("key", entry.getKey().toJSON());
o.accumulate("value", entry.getValue().toJSON());
a.add(o);
}
return a;

}

@Override
public void validate(final ModelValidator validator) {
for (Map.Entry<ModelASTKey, ModelASTMethodArg> entry : variables.entrySet()) {
entry.getKey().validate(validator);
entry.getValue().validate(validator);
}
}

@Override
public String toGroovy() {
StringBuilder result = new StringBuilder("{\n");
for (Map.Entry<ModelASTKey, ModelASTMethodArg> entry : variables.entrySet()) {
result.append(entry.getKey().toGroovy()).append(" ").append(entry.getValue().toGroovy()).append('\n');
}
result.append("}\n");
return result.toString();
}

@Override
public void removeSourceLocation() {
super.removeSourceLocation();
for (Map.Entry<ModelASTKey, ModelASTMethodArg> entry : variables.entrySet()) {
entry.getKey().removeSourceLocation();
entry.getValue().removeSourceLocation();
}
}

public Map<ModelASTKey, ModelASTMethodArg> getVariables() {
return variables;
}

public void setVariables(Map<ModelASTKey, ModelASTMethodArg> variables) {
this.variables = variables;
}

public boolean containsKey(String k) {
for (ModelASTKey key : variables.keySet()) {
if (key.getKey().equals(k)) {
return true;
}
}

return false;
}

@Override
public String toString() {
return "ModelASTClosureMap{" +
"variables=" + variables +
"}";
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}

ModelASTClosureMap that = (ModelASTClosureMap) o;

return getVariables() != null ? getVariables().equals(that.getVariables()) : that.getVariables() == null;

}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + (getVariables() != null ? getVariables().hashCode() : 0);
return result;
}
}
@@ -31,6 +31,7 @@
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildConditionsContainer;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameter;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTBuildParameters;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTClosureMap;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTEnvironment;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOptions;
import org.jenkinsci.plugins.pipeline.modeldefinition.ast.ModelASTOption;

0 comments on commit 528818f

Please sign in to comment.
You can’t perform that action at this time.