Make sure that BWC tests run successfully, even with types deprecation messages.#36511
Merged
jtibshirani merged 3 commits intoelastic:masterfrom Dec 12, 2018
Merged
Make sure that BWC tests run successfully, even with types deprecation messages.#36511jtibshirani merged 3 commits intoelastic:masterfrom
jtibshirani merged 3 commits intoelastic:masterfrom
Conversation
Collaborator
|
Pinging @elastic/es-core-infra |
90ffa39 to
6795b87
Compare
markharwood
reviewed
Dec 12, 2018
| * Creates request options designed to be used when calling a deprecated 'typed' API. The | ||
| * options will ensure that the given warnings are returned if all nodes are on 7.x, and will | ||
| * allow (but not require) the warnings if any node is running 6.x. | ||
| * |
Contributor
There was a problem hiding this comment.
Maybe change the javadoc to talk about Version.CURRENT otherwise the comment won't age well when we move to 8 and beyond
| * @param warnings The expected types removal warnings. | ||
| * @return A {@link RequestOptions} instance for use with a deprecated 'typed' request. | ||
| */ | ||
| public static RequestOptions expectTypesWarnings(String... warnings) { |
Contributor
There was a problem hiding this comment.
This function looks to be general and not specifically for types. I wonder if it is worth calling it something like requireWarningsNodesSameVersion?
Contributor
There was a problem hiding this comment.
Technically speaking it would be requireWarningsIfNodesSameVersionAndAllowWarningsIfMixedVersions
That's obviously a bit of a mouthful so maybe just expectWarnings?
Contributor
Author
There was a problem hiding this comment.
👍 I'll update to expectWarnings and generalize the javadoc.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When deprecating types in get requests in #35930, I updated several REST tests to use the type name
_docto avoid deprecation warnings. However, some of these tests are run as part of our BWC tests, and can incorporate nodes from early 6.x versions where types were not allowed to begin with underscores. To fix the BWC tests, this PR makes the following changes:VersionSensitiveWarningsHandlerto check for specific warning messages.Addresses #36468.