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

String is appended in the report url generated by HTML Publisher plugin

      The HTML Publisher Plugin is generating an incorrect URL for the published HTML reports. Instead of using the actual file name from the Index page[s] pattern, it creates a directory with a modified name, leading to broken links.

      Steps to Reproduce:

      1. Install Jenkins: Install and configure a Jenkins instance.
      2. Install HTML Publisher Plugin: Install the HTML Publisher Plugin from the Jenkins Plugin Manager.
      3. Create a Job: Create a new freestyle job in Jenkins.
      4. Configure Build Steps: Add build steps to generate HTML reports (e.g., run a test suite that produces HTML output). Ensure the generated reports are placed in a directory named "report" within the build artifacts. In this example, the report file is named "byteblower_20250123_054647.html" and is located in job/<job name>/<build_no>/artifact/report/byteblower_20250123_054647.html.
      5. Configure HTML Publisher:
        • In the "Publish HTML reports" section, configure the following:
          • HTML directory to archive: report/
          • Index page[s]: byteblower_*.html
          • Index page title[s] (Optional): Byteblower Report
          • Report title: Byteblower Report
      6. Run the Job: Trigger the job to run.
      7. Verify Results:
        • Go to the job's build page and navigate to the "Published Reports" section.
        • Observe the generated URL for the HTML report. It should be in the format: http://<jenkins-server>/job/<job-name>/<build-number>/report/
        • However, the url generated by the plugin is "http://localhost:8080/job/<job-name>/<build number>/Byteblower_20Report/"

      Question: Why is the string "Byteblower_20Report" appended? is this configurable? 

      We are trying to perform automation, so need to check whether this is a bug or an expected behavior.

      Logs of Archiving reports:

      Archiving artifacts
      [htmlpublisher] Archiving HTML reports...
      [htmlpublisher] Archiving at BUILD level /var/jenkins_home/jobs/ByteBlowerExecution1/workspace/report to /var/jenkins_home/jobs/ByteBlowerExecution1/builds/384/htmlreports/Byteblower_20Report
      [htmlpublisher] Copying recursive using current thread
      ERROR: Directory '/var/jenkins_home/jobs/ByteBlowerExecution1/workspace/report' exists but failed copying to '/var/jenkins_home/jobs/ByteBlowerExecution1/builds/384/htmlreports/Byteblower_20Report'.
      ERROR: This is especially strange since your build otherwise succeeded.
      Build step 'Publish HTML reports' changed build result to FAILURE
      Finished: FAILURE

          [JENKINS-75180] String is appended in the report url generated by HTML Publisher plugin

          There are no comments yet on this issue.

            r2b2_nz Richard Bywater
            nidhinrv Nidhin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: