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