use of hudson.model.AbstractProject in project promoted-builds-plugin by jenkinsci.
the class DownstreamPassCondition method isMet.
@Override
public PromotionBadge isMet(PromotionProcess promotionProcess, AbstractBuild<?, ?> build) {
Badge badge = new Badge();
PseudoDownstreamBuilds pdb = build.getAction(PseudoDownstreamBuilds.class);
EnvVars buildEnvironment = new EnvVars(build.getBuildVariables());
OUTER: for (AbstractProject<?, ?> j : getJobList(build.getProject().getParent(), buildEnvironment)) {
for (AbstractBuild<?, ?> b : build.getDownstreamBuilds(j)) {
if (!b.isBuilding()) {
Result r = b.getResult();
if ((r == Result.SUCCESS) || (evenIfUnstable && r == Result.UNSTABLE)) {
badge.add(b);
continue OUTER;
}
}
}
if (pdb != null) {
// if fingerprint doesn't have any, try the pseudo-downstream
for (AbstractBuild<?, ?> b : pdb.listBuilds(j)) {
if (!b.isBuilding()) {
Result r = b.getResult();
if ((r == Result.SUCCESS) || (evenIfUnstable && r == Result.UNSTABLE)) {
badge.add(b);
continue OUTER;
}
}
}
}
// none of the builds of this job passed.
return null;
}
return badge;
}
Aggregations