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

DescribableHelper does not handle wildcards well

      org.jenkinsci.plugins.credentialsbinding.impl.BindingStep notes that while List<MultiBinding> bindings works fine, List<? extends MultiBinding<?>> does not, nor does List<MultiBinding<?>>.

          [JENKINS-26535] DescribableHelper does not handle wildcards well

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java
          http://jenkins-ci.org/commit/workflow-plugin/b5302ebc2e2479f03c538060460e43d0c1c0b47a
          Log:
          JENKINS-26535 can be worked around using a collection of raw types.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java http://jenkins-ci.org/commit/workflow-plugin/b5302ebc2e2479f03c538060460e43d0c1c0b47a Log: JENKINS-26535 can be worked around using a collection of raw types.

          I have, as a final pipeline step, the following:

          step([$class: 'JUnitResultArchiver', allowEmptyResults: true, keepLongStdio: true, testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: 'test-results.xml'])
          

          If I comment out that last step, the build completes as it should, successfully, however, if that step is present:

          [Pipeline] } //withEnv
          [Pipeline] Set environment variables : End
          [Pipeline] step
          [Pipeline] } //timeout
          [Pipeline] Enforce time limit : End
          [Pipeline] } //parallel
          [Pipeline] Execute sub-workflows in parallel : End
          [Pipeline] } //wrap
          [Pipeline] General Build Wrapper : End
          [Pipeline] } //wrap
          [Pipeline] General Build Wrapper : End
          [Pipeline] } //node
          [Pipeline] Allocate node : End
          [Pipeline] End of Pipeline
          org.jenkinsci.plugins.workflow.cps.steps.ParallelStepException: Parallel step unit failed
          	at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.checkAllDone(ParallelStep.java:153)
          	at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.onFailure(ParallelStep.java:119)
          	at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:294)
          	at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)
          	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          	at com.cloudbees.groovy.cps.Next.step(Next.java:58)
          	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
          	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
          	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:277)
          	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
          	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
          	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
          	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
          	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          	at java.lang.Thread.run(Thread.java:745)
          Caused by: java.lang.UnsupportedOperationException: JENKINS-26535: do not know how to handle ? extends hudson.tasks.junit.TestDataPublisher
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:574)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.mapList(DescribableHelper.java:603)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:588)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.injectSetters(DescribableHelper.java:663)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:98)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:576)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524)
          	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:96)
          	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
          	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
          	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112)
          	at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1144)
          	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1038)
          	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
          	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:723)
          	at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
          	at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1144)
          	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1038)
          	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
          	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
          	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
          	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
          	at WorkflowScript.run(WorkflowScript:63)
          	at ___cps.transform___(Native Method)
          	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55)
          	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
          	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79)
          	at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:606)
          	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          	at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          	at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:606)
          	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          	... 17 more
          Finished: FAILURE
          

          Pedro Algarvio added a comment - I have, as a final pipeline step, the following: step([$class: 'JUnitResultArchiver' , allowEmptyResults: true , keepLongStdio: true , testDataPublishers: [[$class: 'StabilityTestDataPublisher' ]], testResults: 'test-results.xml' ]) If I comment out that last step, the build completes as it should, successfully, however, if that step is present: [Pipeline] } //withEnv [Pipeline] Set environment variables : End [Pipeline] step [Pipeline] } //timeout [Pipeline] Enforce time limit : End [Pipeline] } //parallel [Pipeline] Execute sub-workflows in parallel : End [Pipeline] } //wrap [Pipeline] General Build Wrapper : End [Pipeline] } //wrap [Pipeline] General Build Wrapper : End [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] End of Pipeline org.jenkinsci.plugins.workflow.cps.steps.ParallelStepException: Parallel step unit failed at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.checkAllDone(ParallelStep.java:153) at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.onFailure(ParallelStep.java:119) at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:294) at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:277) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:745) Caused by: java.lang.UnsupportedOperationException: JENKINS-26535: do not know how to handle ? extends hudson.tasks.junit.TestDataPublisher at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:574) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.mapList(DescribableHelper.java:603) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:588) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.injectSetters(DescribableHelper.java:663) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:98) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:576) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:524) at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:96) at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1144) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1038) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:723) at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1144) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1038) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15) at WorkflowScript.run(WorkflowScript:63) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:55) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79) at sun.reflect.GeneratedMethodAccessor466.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55) at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45) at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) ... 17 more Finished: FAILURE

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          plugin/src/main/java/org/jenkinsci/plugins/symbol/describable/DescribableModel.java
          http://jenkins-ci.org/commit/symbol-plugin/f467a821c1139b55cc74f4b8a11e81393bb71cef
          Log:
          JENKINS-26535 tiger-types to the rescue

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: plugin/src/main/java/org/jenkinsci/plugins/symbol/describable/DescribableModel.java http://jenkins-ci.org/commit/symbol-plugin/f467a821c1139b55cc74f4b8a11e81393bb71cef Log: JENKINS-26535 tiger-types to the rescue

          Alex Ouzounis added a comment - - edited

          trying to use properties in a MultiBranch Pipeline like so:

          properties( [ $class: 'GithubProjectProperty', displayName: '', projectUrlStr: 'https://github.com/xxx/yyy' ] )
          

          but I get:

          java.lang.UnsupportedOperationException: JENKINS-26535: do not know how to handle java.util.List<hudson.model.JobProperty>
          

          My understanding from http://stackoverflow.com/questions/35370810/how-do-i-use-jenkins-pipeline-properties-step#35471196 was that the properties syntax was working but maybe i am wrong.


          Jenkins LTS 1.642.2 , Pipeline Branch 1.15

          Alex Ouzounis added a comment - - edited trying to use properties in a MultiBranch Pipeline like so: properties( [ $class: 'GithubProjectProperty' , displayName: '', projectUrlStr: ' https: //github.com/xxx/yyy' ] ) but I get: java.lang.UnsupportedOperationException: JENKINS-26535: do not know how to handle java.util.List<hudson.model.JobProperty> My understanding from http://stackoverflow.com/questions/35370810/how-do-i-use-jenkins-pipeline-properties-step#35471196 was that the properties syntax was working but maybe i am wrong. Jenkins LTS 1.642.2 , Pipeline Branch 1.15

          Code changed in jenkins
          User: Jesse Glick
          Path:
          multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java
          multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java
          http://jenkins-ci.org/commit/workflow-multibranch-plugin/06ba83c54aec8e8cacd34737d16667469383b5d7
          Log:
          JENKINS-26535 can be worked around using a collection of raw types.
          Originally-Committed-As: b5302ebc2e2479f03c538060460e43d0c1c0b47a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/main/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStep.java multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/JobPropertyStepTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/06ba83c54aec8e8cacd34737d16667469383b5d7 Log: JENKINS-26535 can be worked around using a collection of raw types. Originally-Committed-As: b5302ebc2e2479f03c538060460e43d0c1c0b47a

          Andrew Bayer added a comment -

          jglick - so does that mean we'd need to do something similar in junit to handle the TestDataPublisher use case?

          Andrew Bayer added a comment - jglick - so does that mean we'd need to do something similar in junit to handle the TestDataPublisher use case?

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - PR up for junit-plugin - https://github.com/jenkinsci/junit-plugin/pull/48

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
          src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorTraitsTest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/745dfbfe4f8002b085386e8da8a9416a964472d2
          Log:
          added a workaround for JENKINS-26535

          [FIXES JENKINS-45860]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorTraitsTest.java http://jenkins-ci.org/commit/github-branch-source-plugin/745dfbfe4f8002b085386e8da8a9416a964472d2 Log: added a workaround for JENKINS-26535 [FIXES JENKINS-45860]

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
          src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorTraitsTest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/2aaa13771c05c784bfff060856ed6c4d055bf6f1
          Log:
          Merge pull request #174 from daspilker/JENKINS-45860

          JENKINS-45860 added a workaround for JENKINS-26535

          Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/66373c2859f1...2aaa13771c05

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigatorTraitsTest.java http://jenkins-ci.org/commit/github-branch-source-plugin/2aaa13771c05c784bfff060856ed6c4d055bf6f1 Log: Merge pull request #174 from daspilker/ JENKINS-45860 JENKINS-45860 added a workaround for JENKINS-26535 Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/66373c2859f1...2aaa13771c05

          PR that will improve support for parameterized types:
          https://github.com/jenkinsci/structs-plugin/pull/52

          Daniel Spilker added a comment - PR that will improve support for parameterized types: https://github.com/jenkinsci/structs-plugin/pull/52

          Günter Grodotzki added a comment - Related:  https://issues.jenkins-ci.org/browse/JENKINS-60155  (see:  https://github.com/jenkinsci/bitbucket-branch-source-plugin/issues/258#issuecomment-553405822 )

          Jesse Glick added a comment -

          lifeofguenter please use the Link system in JIRA to keep track of these things.

          Jesse Glick added a comment - lifeofguenter please use the Link system in JIRA to keep track of these things.

          We have an issue which depends on this in a few ways. Without it being fixed, we are stuck with a Jenkins that keeps rerunning a whole bunch of jobs every day for no reason besides it being a bug.

          Daniel Steiert added a comment - We have an issue which depends on this in a few ways. Without it being fixed, we are stuck with a Jenkins that keeps rerunning a whole bunch of jobs every day for no reason besides it being a bug.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            15 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated: