@Override
 public Fingerprint.RangeSet getDownstreamRelationship(AbstractProject that) {
   Fingerprint.RangeSet rs = super.getDownstreamRelationship(that);
   for (List<IvyBuild> builds : getModuleBuilds().values())
     for (IvyBuild b : builds) rs.add(b.getDownstreamRelationship(that));
   return rs;
 }
Example #2
0
  /**
   * Gets the dependency relationship from this build (as the sink) and that project (as the
   * source.)
   *
   * @return Build number of the upstream build that feed into this build, or -1 if no record is
   *     available.
   */
  public int getUpstreamRelationship(AbstractProject that) {
    FingerprintAction f = getAction(FingerprintAction.class);
    if (f == null) return -1;

    int n = -1;

    // look for fingerprints that point to the given project as the source, and merge them all
    for (Fingerprint e : f.getFingerprints().values()) {
      if (upstreamCulprits) {
        // With upstreamCulprits, we allow upstream relationships
        // from intermediate jobs
        Fingerprint.RangeSet rangeset = e.getRangeSet(that);
        if (!rangeset.isEmpty()) {
          n = Math.max(n, rangeset.listNumbersReverse().iterator().next());
        }
      } else {
        BuildPtr o = e.getOriginal();
        if (o != null && o.belongsTo(that)) n = Math.max(n, o.getNumber());
      }
    }

    return n;
  }