Skip to content
Browse files
[FIXED JENKINS-19179] - Prevent the disabling of Matrix Configurations
This change blocks calls, which try to disable matrix configurations.
MatrixConfiguration::isDisabled() always returns the parent's value.

Signed-off-by: Oleg Nenashev <>
  • Loading branch information
oleg-nenashev committed Aug 5, 2014
1 parent f6656ca commit fe786b4b47e8137f538e451a3ed888ace5e85780
Showing with 24 additions and 0 deletions.
  1. +23 −0 src/main/java/hudson/matrix/
  2. +1 −0 src/main/resources/hudson/matrix/
@@ -49,18 +49,22 @@
import hudson.model.SCMedItem;
import hudson.model.Queue.NonBlockingTask;
import hudson.model.Cause.LegacyCodeCause;
import hudson.model.Failure;
import hudson.scm.SCM;
import jenkins.scm.SCMCheckoutStrategy;
import hudson.tasks.BuildWrapper;
import hudson.tasks.Builder;
import hudson.tasks.LogRotator;
import hudson.tasks.Publisher;
import hudson.util.HttpResponses;

import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import org.kohsuke.stapler.HttpResponse;

* One configuration of {@link MatrixProject}.
@@ -105,6 +109,25 @@ public EnvVars getEnvironment(Node node, TaskListener listener) throws IOExcepti
return env;

public final boolean isDisabled() {
// Matrix configurations cannot be disabled independently from the master
return getParent().isDisabled();

public final void makeDisabled(boolean b) throws IOException {
if (/**disable*/ b) {
throw new Error("Matrix configurations cannot be disabled separately. Disable the parent project instead");

public final HttpResponse doDisable() throws IOException, ServletException {
return HttpResponses.errorWithoutStack(405, Messages.MatrixConfiguration_DisableNotAllowed());

protected void updateTransientActions(){
// This method is exactly the same as in {@link #AbstractProject}.
@@ -32,6 +32,7 @@ MatrixBuild.Interrupting=Interrupting {0}
MatrixBuild.Completed={0} completed with result {1}

MatrixConfiguration.DisableNotAllowed=Matrix configurations cannot be disabled separately. Disable the parent project instead

MatrixRun.KeptBecauseOfParent=Kept because {0} is kept

0 comments on commit fe786b4

Please sign in to comment.