packagedrone icon indicating copy to clipboard operation
packagedrone copied to clipboard

Discard upload of duplicated artifacts

Open nfalco79 opened this issue 8 years ago • 6 comments

I integrate your jenkins plugin with some ours "tycho" jobs. With a promote step I upload the final artifact to pdrone, a zip P2 repository (that contains the structure of p2 repo). If I repeat the promotion I republish the same artifact to pdrone and the channel will contains the same artifacts duplicated in the channel.

Is possible have an option to ignore duplicate artifacts (based on MD5)? So in web channel page we could receive a warning message that resource was skipped instead with REST API have get an HTTP 200 for the first artifact and 204 for the subsequent.

What do you think about this feature?

nfalco79 avatar May 24 '16 08:05 nfalco79

I think it is great and should be already implemented with the 0.13.0 version. The trigger system can be configured that way. The return code might not be 204 though.

ctron avatar May 24 '16 10:05 ctron

Good! I propose the HTTP 204 becase means OK (upload done) no content (channel was not changed).

nfalco79 avatar May 24 '16 11:05 nfalco79

So the 0.14.0 release will have an Upload API V3 which in this case will return "200" and a detailed structure showing the result of the upload. Since it is now also possible to upload multiple artifacts in one call, it can be that the upload request did actually store only half of the artifacts. That result can then be read from the JSON structure which returns two separate lists, one for uploaded and one for rejected artifacts.

ctron avatar Jun 24 '16 08:06 ctron

HTTP 204 not suite this condition,because this is a mvn deploy error. as I think.

lxbzmy avatar Aug 11 '16 06:08 lxbzmy

Is it really an error?

ctron avatar Aug 11 '16 06:08 ctron

Now it deploy the same artifact twice, it's an error. In a maven normal repository artifact it's replaced and you get an error only if you do not have override/delete permission. Here there is only deployer role, so in this case if artifact has the same md5 no work is needed. Instead if has different md5 than....or replace or error.

nfalco79 avatar Aug 11 '16 07:08 nfalco79