Skip to content

Commit

Permalink
Removed delayed approval feature JENKINS-11409
Browse files Browse the repository at this point in the history
It is a bit too risky to have enabled in large installations
and the dependency feature provides a similar functionality.
Since delayed approval has so far only been in a beta release
we can remove it without much consequence.

Change-Id: I2cf2efc7b1f45be7db3ae69dde6cb8cdc88b405f
  • Loading branch information
rsandell committed Jun 30, 2014
1 parent 21df17b commit 4831169
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 368 deletions.
4 changes: 2 additions & 2 deletions build-config/swe_checkstyle.xml
Expand Up @@ -127,9 +127,9 @@
</module>
</module>
<module name="NewlineAtEndOfFile"/>
<module name="Translation">
<!--<module name="Translation">
<property name="severity" value="info"/>
</module>
</module> Translations are lagging behind anyways-->
<!-- Ignore generated code -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="This file was auto-generated from WSDL"/>
Expand Down
Expand Up @@ -93,12 +93,12 @@ public synchronized void onCompleted(AbstractBuild r, TaskListener listener) {
GerritCause cause = getCause(r);
logger.debug("Completed. Build: {} Cause: {}", r, cause);
if (cause != null) {
GerritTrigger trigger = GerritTrigger.getTrigger(r.getProject());
cleanUpGerritCauses(cause, r);
GerritTriggeredEvent event = cause.getEvent();
GerritTrigger trigger = GerritTrigger.getTrigger(r.getProject());
if (trigger != null) {
// There won't be a trigger if this job was run through a unit test
GerritTrigger.getTrigger(r.getProject()).notifyBuildEnded(event);
trigger.notifyBuildEnded(event);
}
if (event instanceof GerritEventLifecycle) {
((GerritEventLifecycle)event).fireBuildCompleted(r);
Expand All @@ -124,31 +124,11 @@ public synchronized void onCompleted(AbstractBuild r, TaskListener listener) {
}

updateTriggerContexts(r);
if (hasDelayedApproval(trigger)) {
logger.info("Delayed approval set. Waiting for delayed approval for cause [{}]. Status: \n{}",
cause, memory.getStatusReport(event));
} else {
allBuildsCompleted(event, cause, listener);
}
allBuildsCompleted(event, cause, listener);
}
}
}

/**
* Whether the trigger has a delayed approval.
*
* @param trigger the trigger to look in.
* @return True only if the trigger is non null and has a delayed approval.
*/
private boolean hasDelayedApproval(GerritTrigger trigger) {
if (trigger != null) {
if (trigger.isDelayedApproval()) {
return true;
}
}
return false;
}

/**
* Manages the end of a Gerrit Event. Should be called after each build related to an event completes if that build
* should report back to Gerrit.
Expand Down

This file was deleted.

Expand Up @@ -141,7 +141,6 @@ public class GerritTrigger extends Trigger<AbstractProject> implements GerritEve
private Integer gerritBuildNotBuiltCodeReviewValue;
private boolean silentMode;
private String notificationLevel;
private boolean delayedApproval;
private boolean escapeQuotes;
private boolean noNameAndEmailParameters;
private String dependencyJobsNames;
Expand Down Expand Up @@ -201,7 +200,6 @@ public class GerritTrigger extends Trigger<AbstractProject> implements GerritEve
* Job specific Gerrit code review vote when a build is not built, null means
* that the global value should be used.
* @param silentMode Silent Mode on or off.
* @param delayedApproval Delayed Approval on or off.
* @param escapeQuotes EscapeQuotes on or off.
* @param noNameAndEmailParameters Whether to create parameters containing name and email
* @param readableMessage Human readable message or not.
Expand Down Expand Up @@ -238,7 +236,6 @@ public GerritTrigger(
Integer gerritBuildNotBuiltVerifiedValue,
Integer gerritBuildNotBuiltCodeReviewValue,
boolean silentMode,
boolean delayedApproval,
boolean escapeQuotes,
boolean noNameAndEmailParameters,
boolean readableMessage,
Expand Down Expand Up @@ -270,7 +267,6 @@ public GerritTrigger(
this.gerritBuildNotBuiltVerifiedValue = gerritBuildNotBuiltVerifiedValue;
this.gerritBuildNotBuiltCodeReviewValue = gerritBuildNotBuiltCodeReviewValue;
this.silentMode = silentMode;
this.delayedApproval = delayedApproval;
this.escapeQuotes = escapeQuotes;
this.noNameAndEmailParameters = noNameAndEmailParameters;
this.readableMessage = readableMessage;
Expand Down Expand Up @@ -1312,16 +1308,6 @@ public String getNotificationLevel() {
return notificationLevel;
}

/**
* If delayed approval is on or off. When delayed approval is on there will be no automatic result of the build
* sent back to Gerrit. This will have to be sent using a different mechanism. Default is false.
*
* @return true if delayed approval is on.
*/
public boolean isDelayedApproval() {
return delayedApproval;
}

/**
* if escapeQuotes is on or off. When escapeQuotes is on this plugin will escape quotes in Gerrit event parameter
* string Default is true
Expand Down Expand Up @@ -1459,16 +1445,6 @@ public void setNotificationLevel(String notificationLevel) {
this.notificationLevel = notificationLevel;
}

/**
* Sets delayed approval to on or off. When delayed approval is on there will be no automatic result of the
* build sent back to Gerrit. This will have to be sent using a different mechanism. Default is false.
*
* @param delayedApproval true if delayed approval should be on.
*/
public void setDelayedApproval(boolean delayedApproval) {
this.delayedApproval = delayedApproval;
}

/**
* URL to send in comment to Gerrit.
*
Expand Down

This file was deleted.

Expand Up @@ -24,10 +24,6 @@
help="/plugin/gerrit-trigger/trigger/help-NoNameAndEmailParameters.html">
<f:checkbox name="noNameAndEmailParameters" default="false" checked="${it.noNameAndEmailParameters}"/>
</f:entry>
<f:entry title="${%Delayed Approval}" field="delayedApproval"
help="/plugin/gerrit-trigger/trigger/help-DelayedApproval.html">
<f:checkbox name="delayedApproval" default="false" checked="${it.delayedApproval}"/>
</f:entry>
<f:entry field="dependencyJobsNames" title="${%Other jobs on which this job depends}"
help="/plugin/gerrit-trigger/trigger/help-DependencyJobs.html">
<f:textbox autoCompleteDelimChar=","/>
Expand Down

0 comments on commit 4831169

Please sign in to comment.