Skip to content
Permalink
Browse files
[FIXED JENKINS-13554] Delete configurations from MatrixBuild#delete
  • Loading branch information
olivergondza committed Jan 2, 2015
1 parent 5b4dedb commit 4e22a02287c358260fde84f6b3c5d33f480601e0
Showing 22 changed files with 88 additions and 384 deletions.
@@ -90,35 +90,33 @@ public Object readResolve() {
return this;
}

/**
* Delete build and its child builds.
*
* Child builds can be skipped if they have to be kept.
*
* @since TODO
*/
@Override
public void delete() throws IOException {
super.delete();

for(MatrixRun run : getExactRuns()) {
if (run.getWhyKeepLog() != null) continue;
run.delete();
}
}

/**
* Deletes the build and all matrix configurations in this build when the button is pressed.
*
* @deprecated since TODO, kept not to break REST clients.
*/
@RequirePOST
@Deprecated
public void doDoDeleteAll( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
checkPermission(DELETE);

// We should not simply delete the build if it has been explicitly
// marked to be preserved, or if the build should not be deleted
// due to dependencies!
String why = getWhyKeepLog();
if (why!=null) {
sendError(hudson.model.Messages.Run_UnableToDelete(getFullDisplayName(), why), req, rsp);
return;
}

List<MatrixRun> runs = getExactRuns();
for(MatrixRun run : runs){
why = run.getWhyKeepLog();
if (why!=null) {
sendError(hudson.model.Messages.Run_UnableToDelete(getFullDisplayName(), why), req, rsp);
return;
}
run.delete();
}
delete();
rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
doDoDelete(req, rsp);
}


/**
* Used by view to render a ball for {@link MatrixRun}.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 4e22a02

Please sign in to comment.