Skip to content
Permalink
Browse files

Merge pull request #891 from ndeloof/JENKINS-19034

[FIXED JENKINS-19034] restore missing buildnumber-ID symlink
  • Loading branch information
jglick committed Sep 12, 2013
2 parents 06ccff7 + 2f7520c commit 62ed20ee3f1558dfecb69a82674166ebbb2e7414
@@ -191,6 +191,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="https://issues.jenkins-ci.org/browse/JENKINS-18959">issue 18959</a>)
<li class=bug>
(re)create build number->id symlink if missing when updating permalink.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19034">issue 19034</a>)
<li class=rfe>
Added a new monitor that detects and fixse out-of-order builds records.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18289">issue 18289</a>)
@@ -134,6 +134,11 @@ protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {
cache.getParentFile().mkdirs();

try {
String target = String.valueOf(n);
if (b != null && !new File(job.getBuildDir(), target).exists()) {
// (re)create the build Number->Id symlink
Util.createSymlink(job.getBuildDir(),b.getId(),target,TaskListener.NULL);
}
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))
f.delete()
PeepholePermalink link = p.getPermalinks().find({l -> l instanceof PeepholePermalink})
println(link)
link.updateCache(p, b)
assertTrue("build symlink hasn't been restored", f.exists())
}
}

0 comments on commit 62ed20e

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