Skip to content

Commit

Permalink
Ignore if upstream projects appear as a trigger too
Browse files Browse the repository at this point in the history
  • Loading branch information
pescuma committed Aug 26, 2018
1 parent 707ba42 commit d4154bb
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@ public BuildTriggersColumn() {
}

public String getBuildTriggers(@SuppressWarnings("rawtypes") Job job) {
String upstreamTriggerName = jenkins.triggers.Messages.ReverseBuildTrigger_build_after_other_projects_are_built();

StringBuilder result = new StringBuilder();

List<AbstractProject> upstream = getUpstreamProjects(job);
if (upstream != null && !upstream.isEmpty()) {
result.append(escape(jenkins.triggers.Messages.ReverseBuildTrigger_build_after_other_projects_are_built()))
.append(": ");
append(result, upstream);
List<AbstractProject> upstreamProjects = getUpstreamProjects(job);
if (upstreamProjects != null && !upstreamProjects.isEmpty()) {
result.append(escape(upstreamTriggerName)).append(": ");
append(result, upstreamProjects);
}

Map<TriggerDescriptor, Trigger<?>> triggers = getTriggers(job);
if (triggers != null) {
boolean hasSourceCodeManagement = hasSourceCodeManagement(job);

for (Map.Entry<TriggerDescriptor, Trigger<?>> trigger : triggers.entrySet()) {
if (upstreamTriggerName.equals(trigger.getKey().getDisplayName()))
continue;

if (result.length() > 0)
result.append("<br>");

Expand Down

0 comments on commit d4154bb

Please sign in to comment.