Skip to content

Commit efd2b99

Browse files
committedMar 28, 2014
[FIXED JENKINS-22397] Allow a Trigger to be a DependencyDeclarer.
1 parent 606d84c commit efd2b99

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed
 

‎changelog.html

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
<li class=bug>
6262
<code>NoSuchMethodError: hudson.model.BuildAuthorizationToken.checkPermission(…)</code> from Build Token Root plugin since 1.556.
6363
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22382">issue 22382</a>)
64+
<li class=rfe>
65+
Allow a <code>Trigger</code> to be a <code>DependencyDeclarer</code>.
66+
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22397">issue 22397</a>)
6467
<li class=bug>
6568
Fixed a slow down in resource loading caused by fix to JENKINS-18677.
6669
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21579">issue 21579</a>)

‎core/src/main/java/hudson/matrix/MatrixProject.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,8 @@ public boolean isFingerprintConfigured() {
802802
return false;
803803
}
804804

805-
protected void buildDependencyGraph(DependencyGraph graph) {
805+
@Override protected void buildDependencyGraph(DependencyGraph graph) {
806+
super.buildDependencyGraph(graph);
806807
publishers.buildDependencyGraph(this,graph);
807808
builders.buildDependencyGraph(this,graph);
808809
buildWrappers.buildDependencyGraph(this,graph);

‎core/src/main/java/hudson/model/AbstractProject.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1712,9 +1712,11 @@ private void checkAndRecord(AbstractProject that, TreeMap<Integer, RangeSet> r,
17121712

17131713
/**
17141714
* Builds the dependency graph.
1715-
* @see DependencyGraph
1715+
* Since 1.558, not abstract and by default includes dependencies contributed by {@link #triggers()}.
17161716
*/
1717-
protected abstract void buildDependencyGraph(DependencyGraph graph);
1717+
protected void buildDependencyGraph(DependencyGraph graph) {
1718+
triggers().buildDependencyGraph(this, graph);
1719+
}
17181720

17191721
@Override
17201722
protected SearchIndexBuilder makeSearchIndex() {

‎core/src/main/java/hudson/model/Project.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ public Publisher getPublisher(Descriptor<Publisher> descriptor) {
175175
return null;
176176
}
177177

178-
protected void buildDependencyGraph(DependencyGraph graph) {
178+
@Override protected void buildDependencyGraph(DependencyGraph graph) {
179+
super.buildDependencyGraph(graph);
179180
getPublishersList().buildDependencyGraph(this,graph);
180181
getBuildersList().buildDependencyGraph(this,graph);
181182
getBuildWrappersList().buildDependencyGraph(this,graph);

‎core/src/main/java/jenkins/model/DependencyDeclarer.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,20 @@
2525

2626
import hudson.model.AbstractProject;
2727
import hudson.model.DependencyGraph;
28-
import hudson.tasks.BuildStep;
28+
import hudson.tasks.BuildWrapper;
2929
import hudson.tasks.Builder;
3030
import hudson.tasks.Publisher;
31+
import hudson.triggers.Trigger;
32+
import hudson.util.DescribableList;
3133

3234
/**
33-
* Marker interface for those {@link BuildStep}s that can participate
35+
* Marker interface for project-associated objects that can participate
3436
* in the dependency graph computation process.
3537
*
3638
* <p>
37-
* {@link Publisher}s, {@link Builder}s, and {@link hudson.model.JobProperty}s
38-
* can additional implement this method to add additional edges
39-
* to the dependency graph computation.
39+
* {@link Publisher}s, {@link Builder}s, {@link BuildWrapper}s, and {@link Trigger}s
40+
* (or whatever {@link DescribableList#buildDependencyGraph} is called on, by {@link AbstractProject#buildDependencyGraph})
41+
* can implement this interface to add additional edges to the dependency graph.
4042
*
4143
* @author Nicolas Lalevee
4244
* @author Martin Ficker

0 commit comments

Comments
 (0)