Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
None
-
core 2.87
all plugins latest
Description
Using an upstream trigger in a pipeline causes a compilation error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 4: Invalid parameter "upstreamProjects", did you mean "upstreamFilterStrategy"? @ line 4, column 18. upstream(upstreamProjects: "my_test_1") ^
and you get an additional error line if you specify the threshold attribute.
Example pipelines for reproducing:
my_test_1
pipeline { agent any stages { stage("foo") { steps { echo "hi" } } } }
my_test_2
pipeline { agent any triggers { upstream(upstreamProjects: "my_test_1") } stages { stage("bar") { steps { echo "hello" } } } }
Advice for further debugging or working around this issues is highly appreciated. Currently all our upstream-trigger-dependent projects are broken, i.e., they're not only not triggered, but the entire pipeline cannot run.
Attachments
Issue Links
- is related to
-
JENKINS-47780 copyartifact plugin breaks Jenkinsfile upstream triggers
-
- Closed
-
- links to
Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/DescriptorLookupCache.java
pipeline-model-definition/pom.xml
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/ValidatorTest.java
pipeline-model-definition/src/test/resources/errors/specificDescribableMatch.groovy
pom.xml
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/73326536fc49dfcbb199f6926fd75f96e098b853
Log:
[FIXED JENKINS-47781] Narrow model lookups when appropriate
The original problem here is that if you just look up describables by
the "upstream" symbol, you'll get one from Copy Artifact before you
get `ReverseBuildTrigger`. Which...ok. Except that our syntax checking
treats kicks in for the one from Copy Artifact! So let's narrow our
model lookups when appropriate.
I don't love this solution - it could be smarter and have a better
understanding of context. But this works for now, so I'll go with it.