Skip to content
Browse files

[FIXED JENKINS-19034] restore missing buildnumber-ID symlink when upd…

…ating permalink
  • Loading branch information
ndeloof committed Aug 23, 2013
1 parent 964d9a0 commit 2f7520c3d455ec8f24632f7307363fc6b383dc87
@@ -140,6 +140,9 @@ <h3><a name=v1.526>What's new in 1.526</a> (2013/08/05)</h3>
<li class=bug>
Ensuring <code>/log/all</code> shows only <code>INFO</code> and above messages, even if custom loggers display <code>FINE</code> or below.
(<a href="">issue 18959</a>)
<li class=bug>
(re)create build number->id symlink if missing when updating permalink.
(<a href="">issue 19034</a>)
<li class=rfe>
Added a new monitor that detects and fixse out-of-order builds records.
(<a href="">issue 18289</a>)
@@ -134,6 +134,11 @@ protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {

try {
String target = String.valueOf(n);
if (b != null && !new File(job.getBuildDir(), target).exists()) {
// (re)create the build Number->Id symlink
writeSymlink(cache, String.valueOf(n));
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to update "+job+" "+getId()+" permalink for " + b, e);
@@ -72,4 +72,16 @@ class PeepholePermalinkTest extends HudsonTestCase {
assert new File(p.rootDir,"$n/build.xml").length() == new File(b1.rootDir,"build.xml").length()

void testRebuildBuildNumberPermalinks() {
def p = createFreeStyleProject()
def b = assertBuildStatusSuccess(p.scheduleBuild2(0))
File f = new File(p.getBuildDir(), "1")
// assertTrue(Util.isSymlink(f))
PeepholePermalink link = p.getPermalinks().find({l -> l instanceof PeepholePermalink})
link.updateCache(p, b)
assertTrue("build symlink hasn't been restored", f.exists())

0 comments on commit 2f7520c

Please sign in to comment.
You can’t perform that action at this time.