jenkinsapi icon indicating copy to clipboard operation
jenkinsapi copied to clipboard

Fixes #430: Validate an artifact using "hash" rather than "fileName"

Open plastikos opened this issue 1 year ago • 3 comments

Jenkins only stores one version of an artifact by its hash and by the original filename. Subsequent stores of an artifact with an identical hash but different filename will point to the original artifact. If a duplicate artifact (identical hash) has a different filename than the original filename then that new filename will be stored as a name in the build artifacts but will not change the fileName of the original artifact. This makes it problematic to compare against the original fileName when validating a build artifact that has been saved.

Since the md5sum hash is computed for the local, saved artifact it can be compared against the Jenkins artifact ID (viz hash) for validation. This avoids the problem of identical artifacts having additional filenames. Using the hash is also a better way of validating data integrity rather than using the fileName even when the filename matches.

plastikos avatar Dec 12 '23 10:12 plastikos

I see lots of failures with the checks but I can't find any logs that indicate what failed. Are the checks broken?

plastikos avatar Dec 12 '23 16:12 plastikos

What's up with the pre-commit.ci changing the P.R.?

plastikos avatar Dec 12 '23 16:12 plastikos

This P.R. will close #709 as well as #430.

plastikos avatar Dec 14 '23 19:12 plastikos