Skip to content

Commit dfd65be

Browse files
author
Hendrik Muhs
authored
[Transform] fix version check for beta transforms (#78364)
fix the version check for deprecated beta transforms, this was introduced in #77565, but contained a typo (7.15 instead of 7.5)
1 parent 2d6f6b6 commit dfd65be

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,14 @@ public List<DeprecationIssue> checkForDeprecations(NamedXContentRegistry namedXC
371371

372372
List<DeprecationIssue> deprecations = new ArrayList<>();
373373

374-
// V_8_0_0 deprecate beta transforms
375-
if (getVersion() == null || getVersion().before(Version.V_7_15_0)) {
374+
// deprecate beta transforms
375+
if (getVersion() == null || getVersion().before(Version.V_7_5_0)) {
376376
deprecations.add(
377377
new DeprecationIssue(
378-
Level.CRITICAL, // change to WARNING for 7.x
378+
Level.CRITICAL,
379379
"Transform [" + id + "] is too old",
380380
TransformDeprecations.BREAKING_CHANGES_BASE_URL,
381-
"The configuration uses an old format, you can use [_update] or [_upgrade] to update to configuration",
381+
"The configuration uses an old format, you can use [_update] or [_upgrade] to update",
382382
false,
383383
null
384384
)

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfigTests.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,28 @@ public void testCheckForDeprecations() {
724724
)
725725
);
726726

727+
deprecatedConfig = randomTransformConfigWithDeprecatedFields(id, Version.V_7_10_0);
728+
729+
// check _and_ clear warnings
730+
assertWarnings("[max_page_search_size] is deprecated inside pivot please use settings instead");
731+
732+
// important: checkForDeprecations does _not_ create new deprecation warnings
733+
assertThat(
734+
deprecatedConfig.checkForDeprecations(xContentRegistry()),
735+
equalTo(
736+
List.of(
737+
new DeprecationIssue(
738+
Level.WARNING,
739+
"Transform [" + id + "] uses deprecated max_page_search_size",
740+
"https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html",
741+
"[max_page_search_size] is deprecated inside pivot please use settings instead",
742+
false,
743+
null
744+
)
745+
)
746+
)
747+
);
748+
727749
deprecatedConfig = randomTransformConfigWithDeprecatedFields(id, Version.V_7_4_0);
728750

729751
// check _and_ clear warnings
@@ -738,7 +760,7 @@ public void testCheckForDeprecations() {
738760
Level.CRITICAL,
739761
"Transform [" + id + "] is too old",
740762
"https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html",
741-
"The configuration uses an old format, you can use [_update] or [_upgrade] to update to configuration",
763+
"The configuration uses an old format, you can use [_update] or [_upgrade] to update",
742764
false,
743765
null
744766
),

0 commit comments

Comments
 (0)