Skip to content

Commit

Permalink
[Transform] Improve transform deprecation messages. (#81853)
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek committed Dec 17, 2021
1 parent ad6b1ec commit 8cfac55
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ public class TransformDeprecations {

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public List<DeprecationIssue> checkForDeprecations(NamedXContentRegistry namedXC
Level.CRITICAL,
"Transform [" + id + "] uses an obsolete configuration format",
TransformDeprecations.UPGRADE_TRANSFORM_URL,
"Use [_update] or [_upgrade] to update the configuration of [" + id + "].",
TransformDeprecations.ACTION_UPGRADE_TRANSFORMS_API,
false,
null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,9 @@ public void checkForDeprecations(String id, NamedXContentRegistry namedXContentR
// max_page_search_size got deprecated in 7.8, still accepted for 8.x, to be removed in 9.x
new DeprecationIssue(
Level.WARNING,
"Setting [max_page_search_size] in a pivot is deprecated",
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
"Remove [max_page_search_size] from the pivot in ["
+ id
+ "]. Configure [max_page_search_size] in the transform settings.",
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
false,
null
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,12 +750,9 @@ public void testCheckForDeprecations() {
Collections.singletonList(
new DeprecationIssue(
Level.WARNING,
"Setting [max_page_search_size] in a pivot is deprecated",
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
"Remove [max_page_search_size] from the pivot in ["
+ id
+ "]. Configure [max_page_search_size] in the "
+ "transform settings.",
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
false,
null
)
Expand All @@ -775,12 +772,9 @@ public void testCheckForDeprecations() {
org.elasticsearch.core.List.of(
new DeprecationIssue(
Level.WARNING,
"Setting [max_page_search_size] in a pivot is deprecated",
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
"Remove [max_page_search_size] from the pivot in ["
+ id
+ "]. Configure [max_page_search_size] in the "
+ "transform settings.",
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
false,
null
)
Expand All @@ -802,18 +796,15 @@ public void testCheckForDeprecations() {
Level.CRITICAL,
"Transform [" + id + "] uses an obsolete configuration format",
TransformDeprecations.UPGRADE_TRANSFORM_URL,
"Use [_update] or [_upgrade] to update the configuration of [" + id + "].",
TransformDeprecations.ACTION_UPGRADE_TRANSFORMS_API,
false,
null
),
new DeprecationIssue(
Level.WARNING,
"Setting [max_page_search_size] in a pivot is deprecated",
"https://ela.st/es-deprecation-7-transform-max-page-search-size",
"Remove [max_page_search_size] from the pivot in ["
+ id
+ "]. Configure [max_page_search_size] in the "
+ "transform settings.",
"Transform [" + id + "] uses the deprecated setting [max_page_search_size]",
TransformDeprecations.MAX_PAGE_SEARCH_SIZE_BREAKING_CHANGES_URL,
TransformDeprecations.ACTION_MAX_PAGE_SEARCH_SIZE_IS_DEPRECATED,
false,
null
)
Expand Down

0 comments on commit 8cfac55

Please sign in to comment.