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

HTML publisher step cannot be edited in the pipeline editor

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • Blue Ocean - 1.3.0
      HTML Publisher - 1.14
      Jenkins - 2.86

      Running on Vagrant using the AWS Debian image (jessie 64 bit)
      Java: openjdk-8-jre
      Latest stable version of chrome

      Problem
      HTML publisher step cannot be edited in the pipeline editor

      Original description
      When using the Blue Ocean pipeline editor I cannot make use of the HTML Publisher plugin. I attempt to add a step under a stage by selecting add step and then Publish HTML Reports. I get a field for Target and no matter what I enter in the field I get this error:

       

      • Expecting "class htmlpublisher.HtmlPublisherTarget" but got "<TARGET PARAMS HERE>" of type class java.lang.String instead

      I can temporarily work around this by placing the following code in the Jenkinsfile directly:

       

      publishHTML(target: [
      allowMissing: false,
      alwaysLinkToLastBuild: false,
      keepAll: true,
      reportDir: 'coverage',
      reportFiles: 'index.html',
      reportTitles: "SimpleCov Report",
      reportName: "SimpleCov Report"
      ])

       

      This seems to work but if I modify the pipeline through the UI it will remove the text 'target:' from the parameter yielding:

       

      publishHTML([
      allowMissing: false,
      alwaysLinkToLastBuild: false,
      keepAll: true,
      reportDir: 'coverage',
      reportFiles: 'index.html',
      reportTitles: "SimpleCov Report",
      reportName: "SimpleCov Report"
      ])

       

      Which doesn't work. Once the pipeline runs I get validation errors on the newly generated object from the Blue Ocean UI. Any help would be appriciated.

          [JENKINS-47638] HTML publisher step cannot be edited in the pipeline editor

          jamesdumay - are you able to comment on the possible cause of this or provide a link which provides guidance on how plugins and Blue Ocean interact? The second snippet provided in the description is the correct one (and is the one that is created by the Pipeline Syntax editor) so not sure where the "Target" is coming from?

          Is this actually an issue on the HTML Publisher side or is it one that belongs on the Blue Ocean side?

          Richard Bywater added a comment - jamesdumay - are you able to comment on the possible cause of this or provide a link which provides guidance on how plugins and Blue Ocean interact? The second snippet provided in the description is the correct one (and is the one that is created by the Pipeline Syntax editor) so not sure where the "Target" is coming from? Is this actually an issue on the HTML Publisher side or is it one that belongs on the Blue Ocean side?

          James Dumay added a comment -

          r2b2_nz we use the same method as the Pipeline snippitiser.

          kzantow could you advise here please?

          James Dumay added a comment - r2b2_nz we use the same method as the Pipeline snippitiser. kzantow could you advise here please?

          Keith Zantow added a comment -

          Currently, complex objects aren't supported by the pipeline editor, unfortunately. It looks like the `target` parameter must also be considered a default, so conversion removes it, which should result in a functioning pipeline. You could work around this issue by using the `script` step, e.g. just wrapping the whole publishHTML call like this:

                  script {
                    publishHTML(target: [
                      allowMissing: false,
                      alwaysLinkToLastBuild: false,
                      keepAll: true,
                      reportDir: 'coverage',
                      reportFiles: 'index.html',
                      reportTitles: "SimpleCov Report",
                      reportName: "SimpleCov Report"
                    ])
                  }
          

          Keith Zantow added a comment - Currently, complex objects aren't supported by the pipeline editor, unfortunately. It looks like the `target` parameter must also be considered a default, so conversion removes it, which should result in a functioning pipeline. You could work around this issue by using the `script` step, e.g. just wrapping the whole publishHTML call like this: script { publishHTML(target: [ allowMissing: false , alwaysLinkToLastBuild: false , keepAll: true , reportDir: 'coverage' , reportFiles: 'index.html' , reportTitles: "SimpleCov Report" , reportName: "SimpleCov Report" ]) }

          As this appears to be more related to BlueOcean rather than the HTML publisher plugin itself, will assign to James to prioritise any support in BlueOcean for complex objects.

          Richard Bywater added a comment - As this appears to be more related to BlueOcean rather than the HTML publisher plugin itself, will assign to James to prioritise any support in BlueOcean for complex objects.

            jamesdumay James Dumay
            llacoste Lance Lacoste
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: