Issue Type: Bug Bug
Assignee: Unassigned
Components: promoted-builds
Created: 09/Sep/12 7:45 AM
Description:

Hi,

we've encountered a problem when working with the promoted builds plugin and copy artifacts to copy via permalink.
the failure is due to copying 0 artifacts while not being optional.

i've debugged and fixed it in a private patch, and the suggested fix appears to be working and is shown below.

details follow.

the promotion plugin apparently introduces a fictitious project type "PromotionProcess" and it's corresponding build element "Promotion".
when you define actions with the "promote this build when ..." checkbox they are actually transformed into build steps of the relevant PromotionProcess instance.
this means that if you choose to Archive Artifacts as the promotion Action, they are stored not in the build of the project, but in the Promotion (build) of the tied PromotionProcess of the actual job.
later on, copy artifact tries to copy via permalink. permalinks always point to builds, and the permalink published by the "promote builds" plugin references the actual job build and not the tied Promotion build. so when you try to copy the artifacts with it, the artifacts are not found - they're not there, it's the wrong build.
the solution is to modify the code in class PromotionProcess in method asPermalink()
replace the "return build;" statement with...

final List<Promotion> promotionBuilds = a.getPromotionBuilds(PromotionProcess.this);
if (!promotionBuilds.isEmpty()) { return promotionBuilds.iterator().next(); }

for example.

thanks,
Nathan.

Environment: jenkins 1.458, promoted builds 2.6.2
Project: Jenkins
Labels: copyartifact promoted-builds permalink
Priority: Major Major
Reporter: nathan grunzweig
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to