From 7cd57534e87dc466fe9a6c98bda843038d79c76f Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 15 Jan 2018 18:34:38 +0100 Subject: [PATCH] Ignore the `-snapshot` suffix when comparing the Lucene version in the build and the docs. (#27927) Currently if the Lucene version is `X.Y.Z-snapshot-{gitrev}`, then we will expect the docs to have `X.Y.Z-snapshot` as a Lucene version. I would like to change it to `X.Y.Z` so that this doesn't need changing when we move from a snapshot to a final release. --- qa/verify-version-constants/build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qa/verify-version-constants/build.gradle b/qa/verify-version-constants/build.gradle index 111c4ccf20e50..1d31db6898b7b 100644 --- a/qa/verify-version-constants/build.gradle +++ b/qa/verify-version-constants/build.gradle @@ -76,10 +76,8 @@ task verifyDocsLuceneVersion { throw new GradleException('Could not find lucene version in docs version file') } String expectedLuceneVersion = VersionProperties.lucene - if (expectedLuceneVersion.contains('-snapshot-')) { - expectedLuceneVersion = expectedLuceneVersion.substring(0, expectedLuceneVersion.lastIndexOf('-')) - expectedLuceneVersion = expectedLuceneVersion.toUpperCase(Locale.ROOT) - } + // remove potential -snapshot-{gitrev} suffix + expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/ if (docsLuceneVersion != expectedLuceneVersion) { throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]") }