• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • htmlpublisher-plugin
    • Jenkins 2.319.2, htmlpublisher 1.28

      The log show the publish is successful, but there is no side bar or even can't be access with link directly; same code is working well on Jenkins 2.289.2 and htmlpublisher 1.25

      [Pipeline] publishHTML
      11:01:03 [htmlpublisher] Archiving HTML reports...
      11:01:03 [htmlpublisher] Archiving at PROJECT level /home/jenkins/agent/workspace/DevOps/pipeline-html-report/trivy to /var/jenkins_home/jobs/DevOps/jobs/pipeline-html-report/htmlreports/Vulnerability_20Report

          [JENKINS-67646] htmlpublisher does not working with 2.319.2

          Sergey Oplavin added a comment - - edited

          I have the same issue, but it appears only when I run it with pipeline.

          It appeared on Jenkins 2.289.2 and htmlpublisher 1.25.
          I tried to install the latest Jenkins LTS version (2.319.2) and htmlpublisher 1.29

          Here is my pipeline config:

          pipeline {
              agent {
                  label "docker" 
              }    stages {
                 stage('Build') {
                    steps {
                       echo '********BUILD STEP**********'
                       git branch: 'master', url: 'https://github.com/xxxxxx.git'
                       withDockerContainer('markhobson/maven-chrome:jdk-8') {
                            sh 'mvn test'
                      }
                    }
                    post {
                  always {
                      publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'target', reportFiles: 'test-report.html', reportName: 'Report', reportTitles: ''])
                  }
                  }
                   
              }
              }
             
          }
          

          Log output:

          [htmlpublisher] Archiving HTML reports...
          [htmlpublisher] Archiving at PROJECT level /home/ec2-user/jenkins/workspace/Cucumber_test/target to /var/lib/jenkins/jobs/Cucumber_test/htmlreports/Report

          Edit: I've also tried to pass "alwaysLinkToLastBuild:true" but it had no effect

          Sergey Oplavin added a comment - - edited I have the same issue, but it appears only when I run it with pipeline. It appeared on Jenkins 2.289.2 and htmlpublisher 1.25. I tried to install the latest Jenkins LTS version (2.319.2) and htmlpublisher 1.29 Here is my pipeline config: pipeline { agent { label "docker" } stages { stage( 'Build' ) { steps { echo '********BUILD STEP**********' git branch: 'master' , url: 'https: //github.com/xxxxxx.git' withDockerContainer( 'markhobson/maven-chrome:jdk-8' ) { sh 'mvn test' } } post { always { publishHTML([allowMissing: false , alwaysLinkToLastBuild: false , keepAll: false , reportDir: 'target' , reportFiles: 'test-report.html' , reportName: 'Report' , reportTitles: '']) } } } } } Log output: [htmlpublisher] Archiving HTML reports... [htmlpublisher] Archiving at PROJECT level /home/ec2-user/jenkins/workspace/Cucumber_test/target to /var/lib/jenkins/jobs/Cucumber_test/htmlreports/Report Edit: I've also tried to pass "alwaysLinkToLastBuild:true" but it had no effect

          Sergey Oplavin added a comment - - edited

          It looks I figured out the probable reason - it actually publishes the report for success builds only.

          See also https://issues.jenkins.io/browse/JENKINS-46722 for workarounds

          Is this by design?

          Sergey Oplavin added a comment - - edited It looks I figured out the probable reason - it actually publishes the report for success builds only. See also https://issues.jenkins.io/browse/JENKINS-46722  for workarounds Is this by design?

          I have updated the Priority to "Major" as it does not allow to use the plugin 'normally'

          Sergey Oplavin added a comment - I have updated the Priority to "Major" as it does not allow to use the plugin 'normally'

          I eventually made it work by providing both  `alwaysLinkToLastBuild: true` and `keepAll: true` - maybe the documentation should be adjusted a bit, because now it's not obvious that `keepAll` flag should be used.

          Sergey Oplavin added a comment - I eventually made it work by providing both  `alwaysLinkToLastBuild: true` and `keepAll: true` - maybe the documentation should be adjusted a bit, because now it's not obvious that `keepAll` flag should be used.

          Joe Lee added a comment -

          sergey_oplavin your solution works, thanks.

          But can one new option alwaysPublish: true be added to publish report which ignore build result instead of combining alwaysLinkToLastBuild: true and keepAll: true  ?

          Joe Lee added a comment - sergey_oplavin your solution works, thanks. But can one new option alwaysPublish: true be added to publish report which ignore build result instead of combining alwaysLinkToLastBuild: true and keepAll: true   ?

          joelee, unfortunately I'm not a developer of this plugin, I cannot add it there. And I still think there is some bug in it which causes such behavior, I think for freestyle jobs it's working fine.

          Sergey Oplavin added a comment - joelee , unfortunately I'm not a developer of this plugin, I cannot add it there. And I still think there is some bug in it which causes such behavior, I think for freestyle jobs it's working fine.

            r2b2_nz Richard Bywater
            joelee Joe Lee
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: