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

declarative pipeline upstream trigger syntax not compiling anymore

    XMLWordPrintable

    Details

    • Similar Issues:

      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

            Activity

            tumbl3w33d Sir Tumbleweed created issue -
            tumbl3w33d Sir Tumbleweed made changes -
            Field Original Value New Value
            Description Using an upstream trigger in a pipeline causes pipeline a compilation error

            {noformat}
            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")
                                ^
            {noformat}
            and you get an additional error line if you specify the threshold attribute.

            Example pipelines for reproducing:
            {noformat}
            pipeline {
                agent any
                stages {
                    stage("foo") {
                        steps {
                            echo "hi"
                        }
                    }
                }
            }
            {noformat}
            {noformat}
            pipeline {
                agent any
                triggers {
                    upstream(upstreamProjects: "my_test_1")
                }
                stages {
                    stage("bar") {
                        steps {
                            echo "hello"
                        }
                    }
                }
            }
            {noformat}

            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.
            Using an upstream trigger in a pipeline causes pipeline a compilation error

            {noformat}
            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")
                                ^
            {noformat}
            and you get an additional error line if you specify the threshold attribute.

            Example pipelines for reproducing:

            *my_test_1*
            {noformat}
            pipeline {
                agent any
                stages {
                    stage("foo") {
                        steps {
                            echo "hi"
                        }
                    }
                }
            }
            {noformat}
            *my_test_2*
            {noformat}
            pipeline {
                agent any
                triggers {
                    upstream(upstreamProjects: "my_test_1")
                }
                stages {
                    stage("bar") {
                        steps {
                            echo "hello"
                        }
                    }
                }
            }
            {noformat}

            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.
            tumbl3w33d Sir Tumbleweed made changes -
            Description Using an upstream trigger in a pipeline causes pipeline a compilation error

            {noformat}
            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")
                                ^
            {noformat}
            and you get an additional error line if you specify the threshold attribute.

            Example pipelines for reproducing:

            *my_test_1*
            {noformat}
            pipeline {
                agent any
                stages {
                    stage("foo") {
                        steps {
                            echo "hi"
                        }
                    }
                }
            }
            {noformat}
            *my_test_2*
            {noformat}
            pipeline {
                agent any
                triggers {
                    upstream(upstreamProjects: "my_test_1")
                }
                stages {
                    stage("bar") {
                        steps {
                            echo "hello"
                        }
                    }
                }
            }
            {noformat}

            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.
            Using an upstream trigger in a pipeline causes a compilation error
            {noformat}
            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")
                                ^
            {noformat}
            and you get an additional error line if you specify the threshold attribute.

            Example pipelines for reproducing:

            *my_test_1*
            {noformat}
            pipeline {
                agent any
                stages {
                    stage("foo") {
                        steps {
                            echo "hi"
                        }
                    }
                }
            }
            {noformat}
            *my_test_2*
            {noformat}
            pipeline {
                agent any
                triggers {
                    upstream(upstreamProjects: "my_test_1")
                }
                stages {
                    stage("bar") {
                        steps {
                            echo "hello"
                        }
                    }
                }
            }
            {noformat}
            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.
            Hide
            abayer Andrew Bayer added a comment -

            Somehow https://github.com/jenkinsci/copyartifact-plugin/blob/master/src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java#L222 is interfering. For the moment, downgrading to copyartifact-plugin 1.38 should unbreak you while I figure out why that non-trigger is getting used for validation for triggers...

            Show
            abayer Andrew Bayer added a comment - Somehow https://github.com/jenkinsci/copyartifact-plugin/blob/master/src/main/java/hudson/plugins/copyartifact/TriggeredBuildSelector.java#L222 is interfering. For the moment, downgrading to copyartifact-plugin 1.38 should unbreak you while I figure out why that non-trigger is getting used for validation for triggers...
            Hide
            abayer Andrew Bayer added a comment -

            ...or 1.38.1. Basically any version of copyartifact before 1.39. =)

            Show
            abayer Andrew Bayer added a comment - ...or 1.38.1. Basically any version of copyartifact before 1.39. =)
            Hide
            tumbl3w33d Sir Tumbleweed added a comment -

            Thank you so much! Once more you saved us Andrew Bayer

            Feel free to downgrade it from blocker to whatever, now that there is a workaround. Not sure whether you pay attention to this priority at all.

            Show
            tumbl3w33d Sir Tumbleweed added a comment - Thank you so much! Once more you saved us Andrew Bayer Feel free to downgrade it from blocker to whatever, now that there is a workaround. Not sure whether you pay attention to this priority at all.
            abayer Andrew Bayer made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Component/s workflow-cps-plugin [ 21713 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            Hide
            abayer Andrew Bayer added a comment -

            PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/212 that tries to narrow down the model lookup logic.

            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/212 that tries to narrow down the model lookup logic.
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #212 (Web Link)" [ 17979 ]
            Hide
            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/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.

            Show
            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/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.
            Hide
            abayer Andrew Bayer added a comment -

            Releasing 1.2.3 now.

            Show
            abayer Andrew Bayer added a comment - Releasing 1.2.3 now.
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            ikedam ikedam made changes -
            Link This issue is related to JENKINS-47780 [ JENKINS-47780 ]
            abayer Andrew Bayer made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            abayer Andrew Bayer added a comment -

            So that initial change just fixed validation, it didn't actually fix the real problem. Oops. So https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/215 =)

            Show
            abayer Andrew Bayer added a comment - So that initial change just fixed validation, it didn't actually fix the real problem. Oops. So https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/215 =)
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #215 (Web Link)" [ 17995 ]
            abayer Andrew Bayer made changes -
            Status Reopened [ 4 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            abayer Andrew Bayer added a comment -

            Real fix in 1.2.4, coming shortly.

            Show
            abayer Andrew Bayer added a comment - Real fix in 1.2.4, coming shortly.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                tumbl3w33d Sir Tumbleweed
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: