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
[Transform] add method to collect deprecations from a transform configuration #77565
[Transform] add method to collect deprecations from a transform configuration #77565
Conversation
2030a64
to
2d280f3
Compare
Pinging @elastic/ml-core (Team:ML) |
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 am fine with the integration into the deprecation API to be in a follow PR, especially since this PR has a larger refactor with moving things around.
Would be good to jake or another es/data-managment team member to bless this PR.
deprecationLogger.getDeprecations().forEach(deprecationMessage -> { | ||
onDeprecation.accept( | ||
new DeprecationIssue( | ||
Level.CRITICAL, | ||
"Transform [" + id + "] uses deprecated query options", | ||
TransformDeprecations.QUERY_BREAKING_CHANGES_URL, | ||
deprecationMessage, | ||
false, | ||
null | ||
) | ||
); | ||
}); |
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.
ok, I like this way better than the way ML is doing it (these list of strings, etc.). Good refactoring I think++
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 4 nits
.../plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformDeprecations.java
Outdated
Show resolved
Hide resolved
.../plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformDeprecations.java
Outdated
Show resolved
Hide resolved
NamedXContentRegistry namedXContentRegistry, | ||
DeprecationHandler deprecationHandler | ||
) throws IOException { | ||
QueryBuilder query = null; |
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 this local variable needed at all?
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.
yes, for lenient parsing we only log the exception and query remains null
. I could also have 2 return's, but I think 1 exit is better than 2.
...src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/AggregationConfig.java
Show resolved
Hide resolved
LoggingDeprecationAccumulationHandler into common namespace
dc1e431
to
6b9f757
Compare
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.
Hendrick asked me to review just the part about moving DeprecationIssue to x-pack core. That makes sense to me.
💔 Backport failed
You can use sqren/backport to manually backport by running |
…guration (elastic#77565) add checkForDeprecations to TransformConfig and implement deprecation checks
…guration (elastic#77565) add checkForDeprecations to TransformConfig and implement deprecation checks
fix the version check for deprecated beta transforms, this was introduced in #77565, but contained a typo (7.15 instead of 7.5)
fix the version check for deprecated beta transforms, this was introduced in elastic#77565, but contained a typo (7.15 instead of 7.5)
add checkForDeprecations to TransformConfig and implement deprecation checks
Notes:
DeprecationIssue
from the deprecations plugin /CC @jakelandisLoggingDeprecationAccumulationHandler
from ML (semantic move inside x-pack core)Approach:
I am using a similar approach to ML,
checkForDeprecations
parses the configuration again, but instead of the ordinary deprecation logger re-uses the collector from ML datafeeds.Todo: