-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Changes about Version/IndexVersion as part of removing occurrences of @UpdateForV9 (ES-9378) #119101
base: main
Are you sure you want to change the base?
Conversation
…removing all occurrences of the Java annotation @UpdateForV9 (ES-9378)
} | ||
return "7.17.0"; | ||
return BuildVersion.fromVersionId(Version.CURRENT.minimumCompatibilityVersion().id); |
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.
Is it ok to use Version here?
In previous PR: #117992 (comment)
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.
We should add this to BuildVersion to avoid inferring build versions from version ids.
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.
Done
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
A few nits
} | ||
return "7.17.0"; | ||
return BuildVersion.fromVersionId(Version.CURRENT.minimumCompatibilityVersion().id); |
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.
We should add this to BuildVersion to avoid inferring build versions from version ids.
assertThat(nodeMetadata.nodeId(), equalTo("y6VUVMSaStO4Tz-B5BxcOw")); | ||
assertThat(nodeMetadata.nodeVersion(), equalTo(BuildVersion.fromVersionId(0))); | ||
|
||
ElasticsearchException ex = assertThrows( |
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.
assertThrows comes from junit and is a bit wonky in my experience. We use expectThrows
in other parts of the codebase (which is our own, and existed before junit added a method for this). Let's prefer using that.
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.
Done
public void testUpgradeMarksPreviousVersion() { | ||
final String nodeId = randomAlphaOfLength(10); | ||
final Version version = VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(), Version.V_8_0_0); | ||
final Version version = VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(), Version.V_9_0_0); |
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.
Can this test be rewritten to be built on BuildVersion and IndexVersion? We seem to be still using Version
, but NodeMetadata no longer uses that class.
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.
I don't see how to do it without big refactoring - BuildVersion currently is essentially a wrapper around Version, so it doesn't seem possible to create it without having a version id within a valid range
No description provided.