pycontribs / jenkinsapi

A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
http://pypi.python.org/pypi/jenkinsapi
MIT License
859 stars 485 forks source link

Artifact.save() fails with ArtifactBroken exception if different artifacts on different builds have the same content #664

Closed mandrije closed 5 years ago

mandrije commented 6 years ago
ISSUE TYPE
EXPECTED RESULTS

It would be best if no exception would be thrown at all in this case, as the file was downloaded correctly, its MD5 hash matches the one on Jenkins and the file is valid (i.e. it's not a broken artifact). It would also be acceptable if I'd get a different exception type that would be specific to this case, so I could decide what to do.

ACTUAL RESULTS

As explained in the description part, I'm getting a misleading ArtifactBroken just because the artifact content matches with some other artifact content from the past build.

USEFUL INFORMATION

All the details provided in the description, but please feel free to reach out for details.

Traceback (most recent call last):
  File "C:/my_example.py", line 20, in example_method
    artifact.save_to_dir(dest)
  File "C:\Python27\lib\site-packages\jenkinsapi\artifact.py", line 130, in save_to_dir
    return self.save(outputfilepath, strict_validation)
  File "C:\Python27\lib\site-packages\jenkinsapi\artifact.py", line 63, in save
    self._verify_download(filepath, strict_validation)
  File "C:\Python27\lib\site-packages\jenkinsapi\artifact.py", line 104, in _verify_download
    % (local_md5, baseurl)
ArtifactBroken: Artifact <artifact_md5> seems to be broken, check <my_jenkins_url>
thefifo commented 5 years ago

+1 Having artifacts with the same content but different names is not that unlikely and should be supported. At least an option to ignore non-matching file names would be nice.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

Closed due to inactivity