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

ZenTimestamper throws ClassCastException when used in combination with the new Workflow plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Using the new workflow plugin, the ZenTimestamper fails with a class cast exception, since it seems to assume that this cast never fails
      https://github.com/jenkinsci/zentimestamp-plugin/blob/master/src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java#L23

      Running: Allocate node : Start
      Running on master in C:\Jenkins\workspace\Demo workflow
      Running: Allocate node : Body : Start
      Running: Subversion
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowRun cannot be cast to hudson.model.AbstractBuild
      at hudson.plugins.zentimestamp.ZenTimestampEnvironmentContributor.buildEnvironmentFor(ZenTimestampEnvironmentContributor.java:23)
      at hudson.model.Run.getEnvironment(Run.java:2224)
      at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:827)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:70)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:34)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:98)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
      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:2)

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            COMPATIBILITY.md
            http://jenkins-ci.org/commit/workflow-plugin/cd9b86e225c772084c39ebb110275bf076f010ad
            Log:
            JENKINS-26958 Noting.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/workflow-plugin/cd9b86e225c772084c39ebb110275bf076f010ad Log: JENKINS-26958 Noting.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Gregory Boissinot
            Path:
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java
            http://jenkins-ci.org/commit/zentimestamp-plugin/45c34ad485d9d4df334930b90e1f0abcc5707f85
            Log:
            Merge pull request #3 from ydubreuil/fix-JENKINS-26958

            JENKINS-26958: workflow plugin compatibility

            Compare: https://github.com/jenkinsci/zentimestamp-plugin/compare/c5608d759f8c...45c34ad485d9

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java http://jenkins-ci.org/commit/zentimestamp-plugin/45c34ad485d9d4df334930b90e1f0abcc5707f85 Log: Merge pull request #3 from ydubreuil/fix- JENKINS-26958 JENKINS-26958 : workflow plugin compatibility Compare: https://github.com/jenkinsci/zentimestamp-plugin/compare/c5608d759f8c...45c34ad485d9
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Yoann Dubreuil
            Path:
            src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java
            http://jenkins-ci.org/commit/zentimestamp-plugin/12b7e9517e28038b1281d4cdf2f08b6cc9eb0ce1
            Log:
            JENKINS-26958: workflow plugin compatibility

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Yoann Dubreuil Path: src/main/java/hudson/plugins/zentimestamp/ZenTimestampEnvironmentContributor.java http://jenkins-ci.org/commit/zentimestamp-plugin/12b7e9517e28038b1281d4cdf2f08b6cc9eb0ce1 Log: JENKINS-26958 : workflow plugin compatibility
            Hide
            ydubreuil Yoann Dubreuil added a comment -

            I've just proposed a fix in PR-3

            Show
            ydubreuil Yoann Dubreuil added a comment - I've just proposed a fix in PR-3
            Hide
            postman Per Östman added a comment -

            Bumping this.
            We use Zen timestamper, and wish to use workflow plugin, but this bug effectively prevents this.

            Show
            postman Per Östman added a comment - Bumping this. We use Zen timestamper, and wish to use workflow plugin, but this bug effectively prevents this.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            COMPATIBILITY.md
            http://jenkins-ci.org/commit/workflow-plugin/cc81e69cbc58be406c7d206175825d73ee15de5c
            Log:
            JENKINS-26958 Noting.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/workflow-plugin/cc81e69cbc58be406c7d206175825d73ee15de5c Log: JENKINS-26958 Noting.

              People

              • Assignee:
                ydubreuil Yoann Dubreuil
                Reporter:
                janolaveide Jan-Olav Eide
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: