Class PeepholePermalink
PermalinkProjectAction.Permalink
s that satisfy
certain properties.
For a permalink to be able to use this, it has to satisfy the following:
Given a job J, permalink is a function F that computes a build B. A peephole permalink is a subset of this function that can be deduced to the "peep-hole" function G(B)→bool:F(J) = { newest B | G(B)==true }
Intuitively speaking, a peep-hole permalink resolves to the latest build that satisfies a certain characteristics that can be determined solely by looking at the build and nothing else (most commonly its build result.)
This base class provides a file-based caching mechanism that avoids walking the long build history.
The implementation transparently tolerates G(B) that goes from true to false over time
(it simply scans the history till find the new matching build.) To tolerate G(B)
that goes from false to true, you need to be able to intercept whenever G(B) changes
from false to true, then call resolve(Job)
to check the current permalink target
is up to date, then call updateCache(Job, Run)
if it needs updating.
- Since:
- 1.507
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Persistable cache of peephole permalink targets.static final class
Default cache based on apermalinks
file in the build directory.static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PermalinkProjectAction.Permalink
static final PermalinkProjectAction.Permalink
static final PermalinkProjectAction.Permalink
static final PermalinkProjectAction.Permalink
static final PermalinkProjectAction.Permalink
static final PermalinkProjectAction.Permalink
Fields inherited from class hudson.model.PermalinkProjectAction.Permalink
BUILTIN, LAST_BUILD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Checks if the given build satisfies the peep-hole criteria.protected File
getPermalinkFile
(Job<?, ?> job) Deprecated.No longer used.static void
Run<?,
?> Resolves the permalink by using the cache if possible.boolean
protected void
updateCache
(Job<?, ?> job, Run<?, ?> b) Remembers the value 'n' in the cache for futureresolve(Job)
.Methods inherited from class hudson.model.PermalinkProjectAction.Permalink
getDisplayName, getId
-
Field Details
-
LAST_STABLE_BUILD
- Since:
- 2.436
-
LAST_SUCCESSFUL_BUILD
- Since:
- 2.436
-
LAST_FAILED_BUILD
- Since:
- 2.436
-
LAST_UNSTABLE_BUILD
- Since:
- 2.436
-
LAST_UNSUCCESSFUL_BUILD
- Since:
- 2.436
-
LAST_COMPLETED_BUILD
- Since:
- 2.436
-
-
Constructor Details
-
PeepholePermalink
public PeepholePermalink()
-
-
Method Details
-
apply
Checks if the given build satisfies the peep-hole criteria. This is the "G(B)" as described in the class javadoc. -
test
-
getPermalinkFile
Deprecated.No longer used. -
resolve
Resolves the permalink by using the cache if possible.- Specified by:
resolve
in classPermalinkProjectAction.Permalink
- Returns:
- null if the target of the permalink doesn't exist.
-
updateCache
Remembers the value 'n' in the cache for futureresolve(Job)
. -
initialized
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void initialized()
-