Skip to content
Permalink
Browse files

Merge pull request #76 from hagzag/master

Fix JENKINS-30906 -> Restore build on scm changes logic
  • Loading branch information
hagzag committed Nov 12, 2015
2 parents 34eeddd + 170e19a commit 0c815f76b66fc532e7585c6a801cd4fcbeb161ce
@@ -20,15 +20,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;
@@ -42,7 +39,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;
@@ -134,7 +130,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
@@ -157,8 +153,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;

1 comment on commit 0c815f7

@Brantone

This comment has been minimized.

Copy link

@Brantone Brantone commented on 0c815f7 Nov 13, 2015

Not sure how, but something is messed up here!
Prior to upgrade, all job phases would run regardless of SCM ... now only would run if SCM change which is NOT the desired action, regardless of checkboxes.

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