-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Teach the build about betas and rcs #26066
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dff04f4
Teach build about version suffixes like beta and rc
nik9000 8dd3e82
Update version test
nik9000 bbeb7b7
Merge branch 'master' into build_knows_alpha_beta
nik9000 d9055b3
Merge branch 'master' into build_knows_alpha_beta
nik9000 5df0430
Cleanup alphas and betas
nik9000 0254466
Merge branch 'master' into build_knows_alpha_beta
nik9000 e109d86
Assert that replaced version is beta or rc or something like that
nik9000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,10 +64,10 @@ configure(subprojects.findAll { it.projectDir.toPath().startsWith(rootPath) }) { | |
|
|
||
| /* Introspect all versions of ES that may be tested agains for backwards | ||
| * compatibility. It is *super* important that this logic is the same as the | ||
| * logic in VersionUtils.java, modulo alphas, betas, and rcs which are ignored | ||
| * in gradle because they don't have any backwards compatibility guarantees | ||
| * but are not ignored in VersionUtils.java because the tests expect them not | ||
| * to be. */ | ||
| * logic in VersionUtils.java, throwing out alphas because they don't have any | ||
| * backwards compatibility guarantees and only keeping the latest beta or rc | ||
| * in a branch if there are only betas and rcs in the branch so we have | ||
| * *something* to test against. */ | ||
| Version currentVersion = Version.fromString(VersionProperties.elasticsearch.minus('-SNAPSHOT')) | ||
| int prevMajor = currentVersion.major - 1 | ||
| File versionFile = file('core/src/main/java/org/elasticsearch/Version.java') | ||
|
|
@@ -84,11 +84,20 @@ for (String line : versionLines) { | |
| int major = Integer.parseInt(match.group(1)) | ||
| int minor = Integer.parseInt(match.group(2)) | ||
| int bugfix = Integer.parseInt(match.group(3)) | ||
| Version foundVersion = new Version(major, minor, bugfix, false) | ||
| String suffix = (match.group(4) ?: '').replace('_', '-') | ||
| Version foundVersion = new Version(major, minor, bugfix, suffix, false) | ||
| if (currentVersion != foundVersion | ||
| && (major == prevMajor || major == currentVersion.major) | ||
| && (versions.isEmpty() || versions.last() != foundVersion)) { | ||
| versions.add(foundVersion) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was keeping |
||
| && (major == prevMajor || major == currentVersion.major)) { | ||
| if (versions.isEmpty() || versions.last() != foundVersion) { | ||
| versions.add(foundVersion) | ||
| } else { | ||
| // Replace the earlier betas with later ones | ||
| Version last = versions.set(versions.size() - 1, foundVersion) | ||
| if (last.suffix == '') { | ||
| throw new InvalidUserDataException("Found two equal versions but" | ||
| + " the first one [$last] wasn't a beta.") | ||
| } | ||
| } | ||
| if (major == prevMajor && minor > lastPrevMinor) { | ||
| prevMinorIndex = versions.size() - 1 | ||
| lastPrevMinor = minor | ||
|
|
@@ -106,10 +115,10 @@ if (currentVersion.bugfix == 0) { | |
| // unreleased version of closest branch. So for those cases, the version includes -SNAPSHOT, | ||
| // and the bwc distribution will checkout and build that version. | ||
| Version last = versions[-1] | ||
| versions[-1] = new Version(last.major, last.minor, last.bugfix, true) | ||
| versions[-1] = new Version(last.major, last.minor, last.bugfix, last.suffix, true) | ||
| if (last.bugfix == 0) { | ||
| versions[-2] = new Version( | ||
| versions[-2].major, versions[-2].minor, versions[-2].bugfix, true) | ||
| versions[-2].major, versions[-2].minor, versions[-2].bugfix, versions[-2].suffix, true) | ||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was out of date.