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 Apr 4, 2017
1 parent 32f64bc commit 9ae01c1
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 9ae01c1

Please sign in to comment.