Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-13790

Artifact URLs are not properly resolved to the file path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 5.2
    • 5.0, 5.0.1, 5.1.1
    • Artifacts
    • None

    Description

      Steps to reproduce:

      1. Enable manual Clover integration, generate HTML and XML report.
      2. Define Clover artefact named "Clover Report" (do not use the default "Clover Report (System)" name). - this will force Bamboo Clover Plugin to search through existing artefacts (checking is some specific file exists in any of them) in order to find the report.
      3. Run the build. Open Job summary. The Artifacts tab contains "Clover Report" and it shows the content. But the Clover tab does not show it.

      Reason:

      The FileSystemArtifactLinkDataProvider.exists() does not resolve artefact path correctly. It does not strip prefix from the artifact URL and tries to append the whole URL as a path to a file. Example:

      // for one artefact like:
      artifactLink.getUrl() = BASE_URL/browse/BSP-CHA-12/artifact/JOB1/Clover-Report/index.html
      artifactLink.getLabel() = Clover Report
      
      // ArtifactLinkDataProvider returns URLs:
      artifactPath = artifactLinkDataProvider.getUrls() 
           BASE_URL/browse/BSP-CHA-12/artifact/JOB1/Clover-Report/index.html
      
      // if you try to call exists() method on it to check some file in an artefact
      artifactLinkDataProvider.exists(artifactPath, "img", "clover.ico")
      
      // the underlying FileSystemArtifactLinkDataProvider will concatenate 
      // "file + URL + path components" resulting in stuff like:
      
      D:\Data\bamboo-5.1.1-home\artifacts\BSP-CHA\JOB1\build-00012\Clover-Report\index.html
      \BASE_URL\browse\BSP-CHA-12\artifact\JOB1\Clover-Report\index.html
      \img\clover.ico
      

      Suggested fix:

      FileSystemArtifactLinkDataProvider.exists() should recognize path prefix (till the JOB key) and skip it

      or

      FileSystemArtifactLinkDataProvider.exists() should take artifactRoot instead of artifact file

      Attachments

        Activity

          People

            mparfianowicz Marek Parfianowicz
            mparfianowicz Marek Parfianowicz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: