Skip to content

Commit

Permalink
JENKINS-48155: gerrit-trigger-plugin does not repsect dynamicTriggerC…
Browse files Browse the repository at this point in the history
…onfiguration flag

If user does not want to use dynamic configuration anymore, let's assign
the list of projects to empty list to avoid possible race conditions.
  • Loading branch information
Jimilian committed Dec 5, 2017
1 parent 7a5f54b commit 756a09e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -1388,6 +1388,10 @@ public boolean isDynamicTriggerConfiguration() {
*/
@DataBoundSetter
public void setDynamicTriggerConfiguration(boolean dynamicTriggerConfiguration) {
if (!dynamicTriggerConfiguration) {
dynamicGerritProjects = Collections.emptyList();
}

this.dynamicTriggerConfiguration = dynamicTriggerConfiguration;
}

Expand Down
Expand Up @@ -29,6 +29,7 @@
import javax.annotation.Nonnull;

import jenkins.model.Jenkins;
import org.apache.commons.lang.StringUtils;

/**
* TimerTasks that are created from a GerritTrigger and periodically calls
Expand Down Expand Up @@ -59,6 +60,9 @@ public void run() {
if (trigger == null) {
return;
}
if (StringUtils.isEmpty(trigger.getTriggerConfigURL())) {
return;
}
trigger.updateTriggerConfigURL();
}

Expand Down

0 comments on commit 756a09e

Please sign in to comment.