Ctrl+S in Pipeline Editor shows validation errors from Generic Build Step with $class

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • Environment:

      Jenkinsfile runs step([$class: 'XUnitPublisher', …]) using the syntax from Snippet Generator. Jenkins parses and runs the step OK. The Blue Ocean pipeline editor also loads Jenkinsfile and displays the step as "General Build Step", but if I press Ctrl+S (described in JENKINS-42649), I get an empty text box and these errors:

      • There were validation errors, please check the editor to correct them
      • pipeline/stages/0/branches/0/steps/0/arguments/0/value: Expecting "interface jenkins.tasks.SimpleBuildStep" but got "[$class: 'XUnitPublisher', testTimeMargin: '3000', thresholdMode: 1, thresholds: [ [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''], [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']], tools: [ [$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'TestResults.trx', skipNoTestFiles: true, stopProcessingIfError: true]]]" of type class java.lang.String instead

      I expected it to roundtrip the parameters of the step, perhaps with loss of formatting.

      A simple Jenkinsfile for reproducing the error:

      pipeline {
          agent any
          stages {
              stage('Test') {
                  steps {
                      step([$class: 'XUnitPublisher',
                          testTimeMargin: '3000',
                          thresholdMode: 1,
                          thresholds: [
                              [$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''],
                              [$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']],
                          tools: [
                              [$class: 'MSTestJunitHudsonTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'TestResults.trx', skipNoTestFiles: true, stopProcessingIfError: true]]])
                  }
              }
          }
      }
      

      (This Jenkinsfile contains no step that creates TestResults.trx, but the job succeeds anyhow, due to skipNoTestFiles. This is an extract from a larger Jenkinsfile that also runs the tests.)

            Assignee:
            Unassigned
            Reporter:
            Kalle Niemitalo
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: