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

declarative pipeline upstream trigger syntax not compiling anymore

    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

            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.
            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.
            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.
            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 =)
            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.
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: