Skip to content

Commit

Permalink
Use the root build rather that the current build for checking cause
Browse files Browse the repository at this point in the history
[FIXED JENKINS-14438]
Updates to minimum Jenkins version 1.424 for this.
  • Loading branch information
cjo9900 committed Jul 17, 2012
1 parent 69b09d0 commit 1918a2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -30,7 +30,7 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<!-- tried 1.409 to get to latest before LTS, but has mvn 3 dependency :-( -->
<version>1.408</version>
<version>1.424</version>
</parent>

<artifactId>run-condition</artifactId>
Expand Down
Expand Up @@ -81,7 +81,7 @@ public boolean isCausedBy(String className) {

/**
* Constructor to build causes the cause class is NOT available at build time.
*
*
* @param causeClassName
* @param displayName
*/
Expand All @@ -92,7 +92,7 @@ private BuildCause(String causeClassName, String displayName) {

/**
* allow enum definition to overwrite
*
*
* @param className
* @return true if this cause is meant by the given className
*/
Expand All @@ -102,7 +102,7 @@ boolean isCausedBy(String className) {

/**
* Constructor to build causes the cause class is available at build time.
*
*
* @param clazz
* cause class
* @param displayName
Expand Down Expand Up @@ -133,7 +133,7 @@ public boolean isExclusiveCause() {

@Override
public boolean runPerform(final AbstractBuild<?, ?> build, final BuildListener listener) {
final List<Cause> causes = build.getCauses();
final List<Cause> causes = build.getRootBuild().getCauses();
if (buildCause != null) {
if (isExclusiveCause()) {
return causes.size() == 1 && buildCause.isCausedBy(causes.get(0).getClass().getName());
Expand Down

0 comments on commit 1918a2b

Please sign in to comment.