Skip to content

Commit 05e851f

Browse files
authored
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.
1 parent 77a7e24 commit 05e851f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

qa/verify-version-constants/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ task verifyDocsLuceneVersion {
7676
throw new GradleException('Could not find lucene version in docs version file')
7777
}
7878
String expectedLuceneVersion = VersionProperties.lucene
79-
if (expectedLuceneVersion.contains('-snapshot-')) {
80-
expectedLuceneVersion = expectedLuceneVersion.substring(0, expectedLuceneVersion.lastIndexOf('-'))
81-
expectedLuceneVersion = expectedLuceneVersion.toUpperCase(Locale.ROOT)
82-
}
79+
// remove potential -snapshot-{gitrev} suffix
80+
expectedLuceneVersion -= ~/-snapshot-[0-9a-f]+$/
8381
if (docsLuceneVersion != expectedLuceneVersion) {
8482
throw new GradleException("Lucene version in docs [${docsLuceneVersion}] does not match version.properties [${expectedLuceneVersion}]")
8583
}

0 commit comments

Comments
 (0)