New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIXED JENKINS-40921][FIXED JENKINS-33020] Only display triggers that make sense for a folder computation #89
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 @@ public abstract class ComputedFolder<I extends TopLevelItem> extends AbstractFol | |
* 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 @@ public Map<TriggerDescriptor,Trigger<?>> getTriggers() { | |
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arguably better done using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am assuming that core will add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not to |
||
} | ||
result.add(d); | ||
} | ||
return result; | ||
} | ||
|
||
public void addTrigger(Trigger trigger) { | ||
Trigger old = triggers.get(trigger.getDescriptor()); | ||
if (old != null) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this only actually works by accident in Either way, you need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually it works because it is seriously old-school binding! |
||
<f:section title="${%Orphaned Item Strategy}"> | ||
<j:set var="orphanedItemStrategyDescriptors" value="${instance.orphanedItemStrategyDescriptors}"/> | ||
<f:block> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.