From 9ae01c1da6fdcaa032741ce3e8084140dfebf81c Mon Sep 17 00:00:00 2001 From: Ricardo Pescuma Domenecci Date: Wed, 13 Jul 2016 22:34:26 -0300 Subject: [PATCH] Ignore if upstream projects appear as a trigger too --- .../plugins/extracolumns/BuildTriggersColumn.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/jenkins/plugins/extracolumns/BuildTriggersColumn.java b/src/main/java/jenkins/plugins/extracolumns/BuildTriggersColumn.java index c642646..eb459b6 100644 --- a/src/main/java/jenkins/plugins/extracolumns/BuildTriggersColumn.java +++ b/src/main/java/jenkins/plugins/extracolumns/BuildTriggersColumn.java @@ -33,13 +33,14 @@ 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 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 upstreamProjects = getUpstreamProjects(job); + if (upstreamProjects != null && !upstreamProjects.isEmpty()) { + result.append(escape(upstreamTriggerName)).append(": "); + append(result, upstreamProjects); } Map> triggers = getTriggers(job); @@ -47,6 +48,9 @@ public String getBuildTriggers(@SuppressWarnings("rawtypes") Job job) { boolean hasSourceCodeManagement = hasSourceCodeManagement(job); for (Map.Entry> trigger : triggers.entrySet()) { + if (upstreamTriggerName.equals(trigger.getKey().getDisplayName())) + continue; + if (result.length() > 0) result.append("
");