Skip to content
Permalink
Browse files

[FIXED JENKINS-40921][FIXED JENKINS-33020] Only display triggers that…

… make sense for a folder computation
  • Loading branch information...
stephenc committed Mar 1, 2017
1 parent 359ae1f commit 9c378bea8901a0fddd0bdcea0783b98dae7d1078
@@ -49,6 +49,7 @@
import hudson.model.queue.CauseOfBlockage;
import hudson.model.queue.SubTask;
import hudson.security.ACL;
import hudson.triggers.TimerTrigger;
import hudson.triggers.Trigger;
import hudson.triggers.TriggerDescriptor;
import hudson.util.DescribableList;
@@ -110,7 +111,6 @@
* Our {@link Trigger}s.
*/
private DescribableList<Trigger<?>,TriggerDescriptor> triggers;
// TODO p:config-triggers also expects there to be a BuildAuthorizationToken authToken option. Do we want one?

/**
* Our {@link FolderComputation}.
@@ -342,6 +342,17 @@ protected final String getSuccessfulDestination() {
return triggers.toMap();
}

public List<TriggerDescriptor> getTriggerDescriptors() {
List<TriggerDescriptor> result = new ArrayList<TriggerDescriptor>();
for (TriggerDescriptor d: Trigger.for_(this)) {
if (d instanceof TimerTrigger.DescriptorImpl) {
continue;
}
result.add(d);
}
return result;
}

public void addTrigger(Trigger trigger) {
Trigger old = triggers.get(trigger.getDescriptor());
if (old != null) {
@@ -26,7 +26,9 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:p="/lib/hudson/project">
<st:include page="configure-entries" optional="true"/>
<p:config-trigger/>
<f:descriptorList title="${%triggers(it.computation.displayName)}"
descriptors="${it.triggerDescriptors}"
instances="${it.triggers}"/>
<f:section title="${%Orphaned Item Strategy}">
<j:set var="orphanedItemStrategyDescriptors" value="${instance.orphanedItemStrategyDescriptors}"/>
<f:block>
@@ -0,0 +1,24 @@
#
# The MIT License
#
# Copyright (c) 2017, CloudBees, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
triggers={0} Triggers
@@ -1,4 +1,4 @@
ComputedFolder.already_computing=Already computing
FolderComputation.DisplayName=Folder Computation
ThrottleComputationQueueTaskDispatcher.MaxConcurrentIndexing=At maximum indexing capacity
PeriodicFolderTrigger.DisplayName=Periodically if not otherwise run
PeriodicFolderTrigger.DisplayName=Periodically if not otherwise run

0 comments on commit 9c378be

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