Skip to content
Permalink
Browse files
Use proper build number formatting
Reviewed-by: ehelin
  • Loading branch information
rwestberg committed Oct 30, 2020
1 parent e261f30 commit 07742a0cf82b375c9fef2e94a99ca3783ade54d3
@@ -343,7 +343,7 @@ public void onNewOpenJDKTagCommits(HostedRepository repository, Repository local

// Check if the build name should be updated
var oldBuild = issue.properties().getOrDefault("customfield_10006", JSON.of());
var newBuild = "b" + tag.buildNum();
var newBuild = "b" + String.format("%02d", tag.buildNum());
if (BuildCompare.shouldReplace(newBuild, oldBuild.asString())) {
issue.setProperty("customfield_10006", JSON.of(newBuild));
} else {
@@ -556,13 +556,32 @@ void testIssueBuildAfterTag(TestInfo testInfo) throws IOException {
assertEquals(List.of(issueProject.issueTracker().currentUser()), updatedIssue.assignees());

// Tag it
localRepo.tag(editHash, "jdk-16+10", "Second tag", "duke", "duke@openjdk.org");
localRepo.tag(editHash, "jdk-16+110", "Second tag", "duke", "duke@openjdk.org");
localRepo.push(new Branch(repo.url().toString()), "--tags", false);
TestBotRunner.runPeriodicItems(notifyBot);

// The build should now be updated
updatedIssue = issueProject.issue(issue.id()).orElseThrow();
assertEquals("b110", updatedIssue.properties().get("customfield_10006").asString());

// Tag it again
localRepo.tag(editHash, "jdk-16+10", "Third tag", "duke", "duke@openjdk.org");
localRepo.push(new Branch(repo.url().toString()), "--tags", false);
TestBotRunner.runPeriodicItems(notifyBot);

// The build should now be updated
updatedIssue = issueProject.issue(issue.id()).orElseThrow();
assertEquals("b10", updatedIssue.properties().get("customfield_10006").asString());

// Tag it once again
localRepo.tag(editHash, "jdk-16+8", "Fourth tag", "duke", "duke@openjdk.org");
localRepo.push(new Branch(repo.url().toString()), "--tags", false);
TestBotRunner.runPeriodicItems(notifyBot);

// The build should now be updated
updatedIssue = issueProject.issue(issue.id()).orElseThrow();
assertEquals("b08", updatedIssue.properties().get("customfield_10006").asString());

}
}

1 comment on commit 07742a0

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 07742a0 Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.