From 2b426f70036c0b3bce4f60958fd0b09443ca716d Mon Sep 17 00:00:00 2001 From: Mark Vieira Date: Wed, 11 Sep 2024 14:50:06 -0700 Subject: [PATCH] Fix verifyVersions task (#112765) --- .../java/org/elasticsearch/gradle/internal/BwcVersions.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java index 720c159f75552..7b1bc14fda8af 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java @@ -223,7 +223,10 @@ public void compareToAuthoritative(List authoritativeReleasedVersions) } private List getReleased() { - return versions.stream().filter(v -> unreleased.containsKey(v) == false).toList(); + return versions.stream() + .filter(v -> v.getMajor() >= currentVersion.getMajor() - 1) + .filter(v -> unreleased.containsKey(v) == false) + .toList(); } /**