So consider the thread running as soon as we create it. This allows the UI to show the progressive log icon right away without the user reloading back later
dependency graph. This functionality is enabled through a feature flag,
hudson.tasks.Fingerprinter.enableFingerprintsInDependencyGraph, which is off
by default.
- Rebuild the dependency graph as part of each fingerprint action.
Fingerprinter.buildDependencyGraph adds information to the dependency graph
for projects found in fingerprint records. Since the dependency graph is
based on project, once a relationship is established between two projects,
we can skip scanning subsequent builds of the projects. Entries in the
graph added by the fingerprinter action will never automatically trigger
downstream builds.
core/src/main/java/hudson/tasks/Fingerprinter.java
- When reporting dependency changes, don't consider builds that no longer
exist. This handles issues when projects are renamed, and new projects are
created using the same name, causing the change to point to incorrect
builds.
core/src/main/java/hudson/model/AbstractBuild.java
- Tests.
test/src/test/java/hudson/tasks/FingerprinterTest.java
Max Spring discovered a stack overflow in http://jenkins.361315.n4.nabble.com/channel-example-and-plugin-classes-gives-ClassNotFoundException-td3756092.html that pointed this call into thread context classloader (TCL) as the culprit. Independently, Paul Sandoz discovered the same issue in our products. If TCL is another classloader that delegates to UberClassLoader (UCL), this code causes infinite recursion.
And moreover, given the goal of UCL, it seems wrong that this class is changing behaviour based on contextual information like TCL.
In looking at 4de81f1eb3, the change was introduced to make sure XStream unmarshalling invoked from Plugin.start() would see the classes in that plugin. This was an issue back then when plugins are prepared and loaded one by one, as UCL didn't have visibility into plugins being prepared. But in the current Jenkins, classloaders for all the plugins are prepared, before any plugin gets started, so by the time Plugin.start() runs, UCL is fully functioning.
Therefore, there's no need to consult TCL for the purpose of resolving its own classes. I could have also removed the code that sets TCL, but because some libraries often depend on TCL and doesn't properly look at caller class, I'm leaving it in, even though it's generally a bad practice to rely on TCL in multi-classloader apps like Jenkins
Remove the shadow copy of buildOn from MavenBuild.java and move the setter to
AbstractBuild to allow MavenModuleSetBuild.java to continue to set the
build node.
- Added a RenameListener to Fingerprint. When the listener is invoked for
renamed projects, it will iterate over all the builds of the project looking
for fingerprint actions. If the build was the originator of the fingerprint,
the buildPtr is updated; (had to make the name non-final to allow for this).
If the build is the consumer of a fingerprint, the usages are updated.
core/src/main/java/hudson/model/Fingerprint.java
- Expose the fingerprint data inline with the build data in the remote API.
The renaming code also uses this method as a convenient way to get the
fingerprints for a build.
core/src/main/java/hudson/model/AbstractBuild.java
- Test.
test/src/test/java/hudson/tasks/FingerprinterTest.java
happen.
This happens because the version number isn't computed yet, but we try
to put that into HTTP header.
Fixing this by making <st:header/> tolerate null in value or name.