This reverts commit 36049b6528.
3f0fff9 failed to make Run.java compilable; and this commit introduced a rawtypes warning in ArtifactManager.
Provisionally switching back to originally type signatures which at least were accepted by the compiler, if not optimal.
DirectoryBrowserSupport is a bit of weirdo, in that its a very intelligent HttpResponse object that creates a whole hierarchy. But most of the time, complex structures are created by a series of POJOs referencing each other. Defining a signature to return HttpResponse prevents this common design pattern.
In contrast, as I wrote in the revised javadoc, one can force a certain HttpResponse during the object traversal by throwing an HttpResponse.
So this new signature can accommodate both cases, so I recommend this over the original signature
Most such plugins just need to store or load individual artifacts, and could easily be made to accept an InputStream, and this is easy to support in various implementations, so do that.
A few really expect to get a java.io.File directory that they can play with, but these are the exceptions.
Such plugins will just not work when used on builds with nondefault storage, unless they are rewritten.
Report 100 recent builds in the JSON API, including in-progress builds.
Not reporting all the builds since this would nullify the lazy loading
effect. Will introduce a pagenation API that supports retrieval.
- ID_FORMATTER is time zone sensitive, so comparing against # of
milliseconds since the epoch won't be portable.
- resolveSymlink can return a relative path.
Based on comments from Jesse, revising the fix.
I'm now putting permlinks inside the builds/ directory to avoid the computing hassle involved in the split $JENKINS_HOME.
What we historically had in $JENKINS_HOME/jobs/JOB/lastSuccessfulBuild is also now subsumed by this feature. I initially attempted to create these permalinks in the buidl root directory, but turns out those symlinks aren't the same name as the ID of permalinks, so it doesn't mesh well.
And finally, a test!
Remember the permalink target as symlink (or simple text file) so that
looking that up doesn't cause the walk of the build history.
I think this is more in line with our general preference of making
$JENKINS_HOME useful (than trying to persist cache into a blackbox.)
Having a general purpose in-memory cache could be useful, so I'll see if
I can add that, too, in a way that allows someone to plug different
backend.