Skip to content
Permalink
Browse files

Fix JENKINS-30906 -> Restore build on scm changes logic

  • Loading branch information
Haggai Philip Zagury
Haggai Philip Zagury committed Oct 14, 2015
1 parent 1382428 commit 170e19a30b422cd445334edd29918277da298eb7
@@ -19,15 +19,12 @@
import hudson.model.queue.QueueTaskFuture;
import hudson.scm.ChangeLogSet;
import hudson.scm.ChangeLogSet.Entry;
import hudson.scm.SCM;
import hudson.scm.SCMRevisionState;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
import hudson.model.Executor;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -41,7 +38,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

import net.sf.json.JSONObject;
import jenkins.model.Jenkins;
@@ -133,7 +129,7 @@ public String expandToken(String toExpand, final AbstractBuild<?,?> build, final
* <li>If job is disabled at phase configuration
* then returns <code>{@link StatusJob#IS_DISABLED_AT_PHASECONFIG}</code>.</li>
* <li>If BuildOnlyIfSCMChanges is disabled
* then returns <code>{@link StatusJob#BUILD_ONLY_IF_SCM_CHANGES_DISABLED}</code>.</li>
* then returns <code>{@link StatusJob#BUILD_ON_SCM_CHANGES_ONLY}</code>.</li>
* <li>If 'Build Always' feature is enabled
* then returns <code>{@link StatusJob#BUILD_ALWAYS_IS_ENABLED}</code>.</li>
* <li>If job doesn't contains lastbuild
@@ -156,8 +152,8 @@ private StatusJob getScmChange(AbstractProject subjob,PhaseJobsConfig phaseConfi
if( phaseConfig.isDisableJob() ) {
return StatusJob.IS_DISABLED_AT_PHASECONFIG;
}
if ( !phaseConfig.isBuildOnlyIfSCMChanges() ){
return StatusJob.BUILD_ONLY_IF_SCM_CHANGES_DISABLED;
if ( phaseConfig.isBuildOnlyIfSCMChanges() ){
return StatusJob.BUILD_ON_SCM_CHANGES_ONLY;
}
final boolean buildAlways = Boolean.valueOf((String)(build.getBuildVariables().get(BUILD_ALWAYS_KEY)));

@@ -40,7 +40,7 @@ public boolean isBuildable() {
/**
* The 'Build Only If Scm Changes' feature is disabled.
*/
BUILD_ONLY_IF_SCM_CHANGES_DISABLED("[%s] the 'build only if scm changes' feature is disabled.") {
BUILD_ON_SCM_CHANGES_ONLY("[%s] the 'build only if scm changes' feature is enabled.") {
@Override
public boolean isBuildable() {
return true;

0 comments on commit 170e19a

Please sign in to comment.
You can’t perform that action at this time.