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

HTML publisher step cannot be edited in the pipeline editor

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            r2b2_nz Richard Bywater added a comment -

            James Dumay - 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?

            Show
            r2b2_nz Richard Bywater added a comment - James Dumay - 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?
            Hide
            jamesdumay James Dumay added a comment -

            Richard Bywater we use the same method as the Pipeline snippitiser.

            Keith Zantow could you advise here please?

            Show
            jamesdumay James Dumay added a comment - Richard Bywater we use the same method as the Pipeline snippitiser. Keith Zantow could you advise here please?
            Hide
            kzantow 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"
                      ])
                    }
            
            Show
            kzantow 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" ]) }
            Hide
            r2b2_nz 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.

            Show
            r2b2_nz 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.

              People

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

                Dates

                • Created:
                  Updated: