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

Declarative Pipeline serialization errors when XStreamPickle is used

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      While this block works on my local Jenkins it doesn't work on my company's internal Jenkins

      stage('Push to S3') {
        when {
          expression {
            def branch = env.BRANCH_NAME
            return branch == 'master' || branch == 'develop'
          }
        }
        steps {
          // Push to S3
        }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            Ok, I think I have a fix, now I need to come up with a test.

            Show
            abayer Andrew Bayer added a comment - Ok, I think I have a fix, now I need to come up with a test.
            Show
            abayer Andrew Bayer added a comment - PR up at  https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/131
            Hide
            abayer Andrew Bayer added a comment -

            After initial review, I tried an alternate approach, which is up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/132

            Show
            abayer Andrew Bayer added a comment - After initial review, I tried an alternate approach, which is up at  https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/132
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/SerializationTest.java
            pipeline-model-definition/src/test/resources/serializationAgentGString.groovy
            pipeline-model-definition/src/test/resources/serializationAgentNestedGString.groovy
            pipeline-model-definition/src/test/resources/serializationEnvGString.groovy
            pipeline-model-definition/src/test/resources/serializationJobPropsGString.groovy
            pipeline-model-definition/src/test/resources/serializationLibrariesGString.groovy
            pipeline-model-definition/src/test/resources/serializationParametersGString.groovy
            pipeline-model-definition/src/test/resources/serializationTriggersGString.groovy
            pipeline-model-definition/src/test/resources/serializationWhenBranchGString.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/0a0b0d7a8a74f3a14ce2bbdbffe0e755708c168b
            Log:
            JENKINS-42498 Failure test for JENKINS-42498 serialization

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/SerializationTest.java pipeline-model-definition/src/test/resources/serializationAgentGString.groovy pipeline-model-definition/src/test/resources/serializationAgentNestedGString.groovy pipeline-model-definition/src/test/resources/serializationEnvGString.groovy pipeline-model-definition/src/test/resources/serializationJobPropsGString.groovy pipeline-model-definition/src/test/resources/serializationLibrariesGString.groovy pipeline-model-definition/src/test/resources/serializationParametersGString.groovy pipeline-model-definition/src/test/resources/serializationTriggersGString.groovy pipeline-model-definition/src/test/resources/serializationWhenBranchGString.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/0a0b0d7a8a74f3a14ce2bbdbffe0e755708c168b Log: JENKINS-42498 Failure test for JENKINS-42498 serialization
            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/ast/AbstractModelASTCodeBlock.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTArgumentList.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNamedArgumentList.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPositionalArgumentList.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTSingleArgument.java
            pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWhenContent.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/StageConditionals.groovy
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditional.java
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditional.java
            pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/ExpressionConditional.java
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditionalScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditionalScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/ExpressionConditionalScript.groovy
            pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/SerializationTest.java
            pipeline-model-definition/src/test/resources/serializationWhenEnvGString.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5cd7237782bf16c24ba4939cf4a8d3013f883ccc
            Log:
            [FIXED JENKINS-42498] Stop evaluating when conditions at runtime

            Pull the when conditions in by translating them from the AST model,
            which does require some evaluation of strings here and there, but
            avoids having any Closures in the Describables.

            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/ast/AbstractModelASTCodeBlock.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTArgumentList.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNamedArgumentList.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPositionalArgumentList.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTSingleArgument.java pipeline-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTWhenContent.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/StageConditionals.groovy pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/validator/ModelValidatorImpl.groovy pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditional.java pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditional.java pipeline-model-definition/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/ExpressionConditional.java pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ClosureModelTranslator.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/BranchConditionalScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/EnvironmentConditionalScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/when/impl/ExpressionConditionalScript.groovy pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/SerializationTest.java pipeline-model-definition/src/test/resources/serializationWhenEnvGString.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5cd7237782bf16c24ba4939cf4a8d3013f883ccc Log: [FIXED JENKINS-42498] Stop evaluating when conditions at runtime Pull the when conditions in by translating them from the AST model, which does require some evaluation of strings here and there, but avoids having any Closures in the Describables.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                mmccaskill Michael McCaskill
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: