-
Bug
-
Resolution: Unresolved
-
Major
-
jenkins 1.458, promoted builds 2.6.2
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.
- is related to
-
JENKINS-19007 copy artifacts via permalink for promoted builds shows wrong link
- Closed