Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1125: OpenJDK 7 backports incorrectly tagged with hgupdate-sync #1215

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -39,7 +39,7 @@ public class JdkVersion implements Comparable<JdkVersion> {
private final static Pattern fxVersionPattern = Pattern.compile("(openjfx[1-9][0-9]?)(u([0-9]{1,3}))?$");

// Match a version string symbolizing some future, but yet undefined, update of a major version
private final static Pattern futureUpdatePattern = Pattern.compile("([1-9][0-9]*u)(-([a-z0-9]+))?$");
private final static Pattern futureUpdatePattern = Pattern.compile("((openjdk)?[1-9][0-9]*u)(-([a-z0-9]+))?$");
erikj79 marked this conversation as resolved.
Show resolved Hide resolved

private final static Pattern prefixPattern = Pattern.compile("([a-z]+)([0-9.]+)$");

@@ -65,10 +65,10 @@ private static List<String> splitComponents(String raw) {
var matcher = futureUpdatePattern.matcher(raw);
if (matcher.matches()) {
finalComponents.add(matcher.group(1));
// Group 3 is the opt field
if (matcher.group(3) != null) {
// Group 4 is the opt field
if (matcher.group(4) != null) {
finalComponents.add(null);
finalComponents.add(matcher.group(3));
finalComponents.add(matcher.group(4));
}
}
}
@@ -805,4 +805,15 @@ void uCpu(TestInfo testInfo) throws IOException {
backports.assertLabeled("16.0.2", "17");
}
}

@Test
void openjdk7u(TestInfo testInfo) throws IOException {
try (var credentials = new HostCredentials(testInfo)) {
var backports = new BackportManager(credentials, "17");
backports.assertLabeled();

backports.addBackports("openjdk7u", "7u321", "openjdk8u302", "openjdk8u312");
backports.assertLabeled("openjdk8u312");
}
}
}
@@ -78,6 +78,7 @@ void futureUpdates() {
var jdk16uCpu = from("16u-cpu");
assertEquals(List.of("16u"), jdk16uCpu.components());
assertEquals("cpu", jdk16uCpu.opt().orElseThrow());
assertEquals(List.of("openjdk7u"), from("openjdk7u").components());
}

@Test
@@ -112,5 +113,6 @@ void cpuOrder() {
void nonConforming() {
assertEquals(Optional.empty(), JdkVersion.parse("bla"));
assertEquals(Optional.empty(), JdkVersion.parse(""));
assertEquals(Optional.empty(), JdkVersion.parse("foobar7u"));
}
}