-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Abstract version features checking to work with non-semantic versions #137199
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
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
…sticsearch into fix-version-features-nonsem
mosche
left a 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.
lgtm, just a minor comment regarding visibility of ESRestTestFeatureService
test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java
Outdated
Show resolved
Hide resolved
| if (semanticNodeVersions.isEmpty()) { | ||
| // Nodes do not have a semantic version (e.g. serverless). | ||
| // We assume the cluster is on the "latest version", and all is supported. | ||
| return ((featureVersion, any) -> true); |
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.
👍
| } | ||
|
|
||
| return checkCollection(nodeVersions, v -> v.onOrAfter(extractedVersion), any); | ||
| return versionFeaturesPredicate.test(extractedVersion, any); |
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.
optional nit... it took me a bit to recall what any was, maybe we should rename to anyMatch, matchAny, isAnySufficient ...
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.
Same :)
At least is consistent all the way, but I'll try and come up with a better name for it
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.
Renamed.
I'm not entirely happy yet, I think I might do a followup that either splits the functions or uses an enum for better clarity (here but mainly in TestFeatureService#clusterHasFeature)
When I resumed work on #105641 (now #136853), I had some serverless tests failures.
When we moved away from Version in ESRestTest, we added fallbacks for non-sematic versions, which applied the concept "not a semantic version? We assume everything is "current" and supported", which played well for e.g. serverless.
Down the road we acquired the concept of "version features", but we lost this concept; now tests with e.g.
skip: gte_v720are failing on serverless because it does not have a "7.2.0" node (*)This PR fixes the problem by re-introducing the
non-semver == current versionequivalency via a version features predicate.(*) after applying #136853