Skip to content

Commit 74539ed

Browse files
authored
[Transform] Improve transform deprecation messages. (#81848)
1 parent 471459c commit 74539ed

File tree

4 files changed

+19
-27
lines changed

4 files changed

+19
-27
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ public class TransformDeprecations {
1515

1616
public static final String AGGS_BREAKING_CHANGES_URL = "https://ela.st/es-deprecation-8-transform-aggregation-options";
1717

18-
public static final String ACTION_UPGRADE_TRANSFORMS_API = "Use the upgrade transforms API to fix your transforms.";
18+
public static final String ACTION_UPGRADE_TRANSFORMS_API =
19+
"This transform configuration uses obsolete syntax which will be unsupported after the next upgrade. "
20+
+ "Use [/_transform/_upgrade] to upgrade all transforms to the latest format.";
1921

2022
public static final String ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED =
21-
"[max_page_search_size] is deprecated inside pivot. Use settings instead.";
23+
"Remove [max_page_search_size] from the pivot and configure [max_page_search_size] in the transform settings. "
24+
+ "Alternatively use [/_transform/_upgrade] to upgrade all transforms to the latest format.";
2225

2326
public static final String MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL = "https://ela.st/es-deprecation-7-transform-max-page-search-size";
2427

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public List<DeprecationIssue> checkForDeprecations(NamedXContentRegistry namedXC
408408
Level.CRITICAL,
409409
"Transform [" + id + "] uses an obsolete configuration format",
410410
TransformDeprecations.UPGRADE_TRANSFORM_URL,
411-
"Use [_update] or [_upgrade] to update the configuration of [" + id + "].",
411+
TransformDeprecations.ACTION_UPGRADE_TRANSFORMS_API,
412412
false,
413413
null
414414
)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,9 @@ public void checkForDeprecations(String id, NamedXContentRegistry namedXContentR
185185
// max_page_search_size got deprecated in 7.8, still accepted for 8.x, to be removed in 9.x
186186
new DeprecationIssue(
187187
Level.WARNING,
188-
"Setting [max_page_search_size] in a pivot is deprecated",
189-
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
190-
"Remove [max_page_search_size] from the pivot in ["
191-
+ id
192-
+ "]. Configure [max_page_search_size] in the transform settings.",
188+
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
189+
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
190+
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
193191
false,
194192
null
195193
)

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

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,9 @@ public void testCheckForDeprecations() {
750750
Collections.singletonList(
751751
new DeprecationIssue(
752752
Level.WARNING,
753-
"Setting [max_page_search_size] in a pivot is deprecated",
754-
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
755-
"Remove [max_page_search_size] from the pivot in ["
756-
+ id
757-
+ "]. Configure [max_page_search_size] in the "
758-
+ "transform settings.",
753+
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
754+
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
755+
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
759756
false,
760757
null
761758
)
@@ -775,12 +772,9 @@ public void testCheckForDeprecations() {
775772
org.elasticsearch.core.List.of(
776773
new DeprecationIssue(
777774
Level.WARNING,
778-
"Setting [max_page_search_size] in a pivot is deprecated",
779-
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
780-
"Remove [max_page_search_size] from the pivot in ["
781-
+ id
782-
+ "]. Configure [max_page_search_size] in the "
783-
+ "transform settings.",
775+
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
776+
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
777+
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
784778
false,
785779
null
786780
)
@@ -802,18 +796,15 @@ public void testCheckForDeprecations() {
802796
Level.CRITICAL,
803797
"Transform [" + id + "] uses an obsolete configuration format",
804798
TransformDeprecations.UPGRADE_TRANSFORM_URL,
805-
"Use [_update] or [_upgrade] to update the configuration of [" + id + "].",
799+
TransformDeprecations.ACTION_UPGRADE_TRANSFORMS_API,
806800
false,
807801
null
808802
),
809803
new DeprecationIssue(
810804
Level.WARNING,
811-
"Setting [max_page_search_size] in a pivot is deprecated",
812-
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
813-
"Remove [max_page_search_size] from the pivot in ["
814-
+ id
815-
+ "]. Configure [max_page_search_size] in the "
816-
+ "transform settings.",
805+
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
806+
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
807+
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
817808
false,
818809
null
819810
)

0 commit comments

Comments
 (0)