Skip to content

Commit 11931d7

Browse files
authored
Updating deprecation info API to use shortened URLs (#78026)
This commit updates the deprecation info API to use shortened https://ela.st URLs that can be adjusted to point to different documentation URLs without having to modify the source code. Relates #42404
1 parent eb2a64c commit 11931d7

File tree

6 files changed

+140
-174
lines changed

6 files changed

+140
-174
lines changed

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java

+8-11
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static DeprecationIssue checkUserAgentPipelines(ClusterState state) {
6969
if (pipelinesWithDeprecatedEcsConfig.isEmpty() == false) {
7070
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
7171
"User-Agent ingest plugin will always use ECS-formatted output",
72-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/user-agent-processor.html#user-agent-processor",
72+
"https://ela.st/es-deprecation-7-ingest-pipeline-ecs-option",
7373
"Ingest pipelines " + pipelinesWithDeprecatedEcsConfig +
7474
" uses the [ecs] option which needs to be removed to work in 8.0", false, null);
7575
}
@@ -97,8 +97,7 @@ static DeprecationIssue checkTemplatesWithTooManyFields(ClusterState state) {
9797
if (templatesOverLimit.isEmpty() == false) {
9898
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
9999
"Fields in index template exceed automatic field expansion limit",
100-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html" +
101-
"#_limiting_the_number_of_auto_expanded_fields",
100+
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
102101
"Index templates " + templatesOverLimit + " have a number of fields which exceeds the automatic field expansion " +
103102
"limit of [" + maxClauseCount + "] and does not have [" + IndexSettings.DEFAULT_FIELD_SETTING.getKey() + "] set, " +
104103
"which may cause queries which use automatic field expansion, such as query_string, simple_query_string, and " +
@@ -133,7 +132,7 @@ static DeprecationIssue checkTemplatesWithFieldNamesDisabled(ClusterState state)
133132

134133
if (templatesContainingFieldNames.isEmpty() == false) {
135134
return new DeprecationIssue(DeprecationIssue.Level.WARNING, "Index templates contain _field_names settings.",
136-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/mapping-field-names-field.html#disable-field-names",
135+
"https://ela.st/es-deprecation-7-field_names-settings",
137136
"Index templates " + templatesContainingFieldNames + " use the deprecated `enable` setting for the `"
138137
+ FieldNamesFieldMapper.NAME + "` field. Using this setting in new index mappings will throw an error "
139138
+ "in the next major version and needs to be removed from existing mappings and templates.",
@@ -172,8 +171,7 @@ static DeprecationIssue checkPollIntervalTooLow(ClusterState state) {
172171
if (pollInterval.compareTo(TimeValue.timeValueSeconds(1)) < 0) {
173172
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
174173
"Index Lifecycle Management poll interval is set too low",
175-
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html" +
176-
"#ilm-poll-interval-limit",
174+
"https://ela.st/es-deprecation-7-indices-lifecycle-poll-interval-setting",
177175
"The Index Lifecycle Management poll interval setting [" + LIFECYCLE_POLL_INTERVAL_SETTING.getKey() + "] is " +
178176
"currently set to [" + pollIntervalString + "], but must be 1s or greater", false, null);
179177
}
@@ -194,7 +192,7 @@ static DeprecationIssue checkTemplatesWithMultipleTypes(ClusterState state) {
194192
}
195193
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
196194
"Some index templates contain multiple mapping types",
197-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/removal-of-types.html",
195+
"https://ela.st/es-deprecation-7-multiple-types",
198196
"Index templates " + templatesWithMultipleTypes
199197
+ " define multiple types and so will cause errors when used in index creation",
200198
false,
@@ -204,7 +202,7 @@ static DeprecationIssue checkTemplatesWithMultipleTypes(ClusterState state) {
204202
static DeprecationIssue checkClusterRoutingAllocationIncludeRelocationsSetting(final ClusterState clusterState) {
205203
return checkRemovedSetting(clusterState.metadata().settings(),
206204
CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING,
207-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/modules-cluster.html#disk-based-shard-allocation",
205+
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
208206
DeprecationIssue.Level.WARNING
209207
);
210208
}
@@ -273,8 +271,7 @@ static DeprecationIssue checkGeoShapeTemplates(final ClusterState clusterState)
273271
String detailsForIndexTemplates = getDetailsMessageForGeoShapeIndexTemplates(clusterState.getMetadata().getTemplates());
274272
boolean deprecationInComponentTemplates = Strings.isEmpty(detailsForComponentTemplates) == false;
275273
boolean deprecationInIndexTemplates = Strings.isEmpty(detailsForIndexTemplates) == false;
276-
String url = "https://www.elastic.co/guide/en/elasticsearch/reference/6.6/breaking-changes-6.6.html" +
277-
"#_deprecated_literal_geo_shape_literal_parameters";
274+
String url = "https://ela.st/es-deprecation-7-geo-shape-mappings";
278275
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
279276
String message = "component templates and index templates contain deprecated geo_shape properties that must be removed";
280277
String details = detailsForComponentTemplates + "; " + detailsForIndexTemplates;
@@ -365,7 +362,7 @@ static DeprecationIssue checkSparseVectorTemplates(final ClusterState clusterSta
365362
String detailsForIndexTemplates = getDetailsMessageForSparseVectorIndexTemplates(clusterState.getMetadata().getTemplates());
366363
boolean deprecationInComponentTemplates = Strings.isEmpty(detailsForComponentTemplates) == false;
367364
boolean deprecationInIndexTemplates = Strings.isEmpty(detailsForIndexTemplates) == false;
368-
String url = "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_search_changes";
365+
String url = "https://ela.st/es-deprecation-7-sparse-vector";
369366
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
370367
String message = "component templates and index templates contain deprecated sparse_vector fields that must be removed";
371368
String details = detailsForComponentTemplates + "; " + detailsForIndexTemplates;

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java

+13-20
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata) {
113113
if (createdWith.before(Version.V_7_0_0)) {
114114
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
115115
"Index created before 7.0",
116-
"https://www.elastic.co/guide/en/elasticsearch/reference/master/" +
117-
"breaking-changes-8.0.html",
116+
"https://ela.st/es-deprecation-7-reindex",
118117
"This index was created using version: " + createdWith,
119118
false, null);
120119
}
@@ -135,8 +134,7 @@ static DeprecationIssue tooManyFieldsCheck(IndexMetadata indexMetadata) {
135134
if (fieldCount.get() > 1024) {
136135
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
137136
"Number of fields exceeds automatic field expansion limit",
138-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html" +
139-
"#_limiting_the_number_of_auto_expanded_fields",
137+
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
140138
"This index has [" + fieldCount.get() + "] fields, which exceeds the automatic field expansion limit of 1024 " +
141139
"and does not have [" + IndexSettings.DEFAULT_FIELD_SETTING.getKey() + "] set, which may cause queries which use " +
142140
"automatic field expansion, such as query_string, simple_query_string, and multi_match to fail if fields are not " +
@@ -159,7 +157,7 @@ static DeprecationIssue deprecatedDateTimeFormat(IndexMetadata indexMetadata) {
159157
if (fields.size() > 0) {
160158
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
161159
"Date field format uses patterns which has changed meaning in 7.0",
162-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#breaking_70_java_time_changes",
160+
"https://ela.st/es-deprecation-7-java-time",
163161
"This index has date fields with deprecated formats: " + fields + ". "
164162
+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
165163
}
@@ -181,8 +179,7 @@ static DeprecationIssue chainedMultiFieldsCheck(IndexMetadata indexMetadata) {
181179
if (issues.size() > 0) {
182180
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
183181
"Multi-fields within multi-fields",
184-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.3.html" +
185-
"#_defining_multi_fields_within_multi_fields",
182+
"https://ela.st/es-deprecation-7-chained-multi-fields",
186183
"The names of fields that contain chained multi-fields: " + issues, false, null);
187184
}
188185
return null;
@@ -209,7 +206,7 @@ static DeprecationIssue fieldNamesDisabledCheck(IndexMetadata indexMetadata) {
209206
if ((mapping != null) && ClusterDeprecationChecks.mapContainsFieldNamesDisabled(mapping.getSourceAsMap())) {
210207
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
211208
"Index mapping contains explicit `_field_names` enabling settings.",
212-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/mapping-field-names-field.html#disable-field-names",
209+
"https://ela.st/es-deprecation-7-field_names-settings",
213210
"The index mapping contains a deprecated `enabled` setting for `_field_names` that should be removed moving foward.",
214211
false, null);
215212
}
@@ -270,8 +267,7 @@ static DeprecationIssue translogRetentionSettingCheck(IndexMetadata indexMetadat
270267
|| IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING.exists(indexMetadata.getSettings())) {
271268
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
272269
"translog retention settings are ignored",
273-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/index-modules-translog.html" +
274-
"#index-modules-translog-retention",
270+
"https://ela.st/es-deprecation-7-translog-settings",
275271
"translog retention settings [index.translog.retention.size] and [index.translog.retention.age] are ignored " +
276272
"because translog is no longer used in peer recoveries with soft-deletes enabled (default in 7.0 or later)",
277273
false, null);
@@ -284,8 +280,7 @@ static DeprecationIssue checkIndexDataPath(IndexMetadata indexMetadata) {
284280
if (IndexMetadata.INDEX_DATA_PATH_SETTING.exists(indexMetadata.getSettings())) {
285281
final String message = String.format(Locale.ROOT,
286282
"setting [%s] is deprecated and will be removed in a future version", IndexMetadata.INDEX_DATA_PATH_SETTING.getKey());
287-
final String url = "https://www.elastic.co/guide/en/elasticsearch/reference/7.13/" +
288-
"breaking-changes-7.13.html#deprecate-shared-data-path-setting";
283+
final String url = "https://ela.st/es-deprecation-7-shared-path-settings";
289284
final String details = "Found index data path configured. Discontinue use of this setting.";
290285
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
291286
}
@@ -303,8 +298,7 @@ private static DeprecationIssue slowLogSettingCheck(IndexMetadata indexMetadata,
303298
if (setting.exists(indexMetadata.getSettings())) {
304299
final String message = String.format(Locale.ROOT,
305300
"setting [%s] is deprecated and will be removed in a future version", setting.getKey());
306-
final String url = "https://www.elastic.co/guide/en/elasticsearch/reference/7.15/migrating-7.13.html" +
307-
"#breaking_713_infra_core_deprecations";
301+
final String url = "https://ela.st/es-deprecation-7-slowlog-settings";
308302

309303
final String details = String.format(Locale.ROOT, "Found [%s] configured. Discontinue use of this setting. Use thresholds.",
310304
setting.getKey());
@@ -318,7 +312,7 @@ static DeprecationIssue storeTypeSettingCheck(IndexMetadata indexMetadata) {
318312
if (IndexModule.Type.SIMPLEFS.match(storeType)) {
319313
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
320314
"[simplefs] is deprecated and will be removed in future versions",
321-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.15/index-modules-store.html#file-system",
315+
"https://ela.st/es-deprecation-7-simplefs-store-type",
322316
"[simplefs] is deprecated and will be removed in 8.0. Use [niofs] or other file systems instead. " +
323317
"Elasticsearch 7.15 or later uses [niofs] for the [simplefs] store type " +
324318
"as it offers superior or equivalent performance to [simplefs].", false, null);
@@ -345,23 +339,23 @@ static DeprecationIssue checkRemovedSetting(final Settings settings,
345339
static DeprecationIssue checkIndexRoutingRequireSetting(IndexMetadata indexMetadata) {
346340
return checkRemovedSetting(indexMetadata.getSettings(),
347341
INDEX_ROUTING_REQUIRE_SETTING,
348-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.14/data-tier-shard-filtering.html#data-tier-allocation-filters",
342+
"https://ela.st/es-deprecation-7-tier-filtering-settings",
349343
DeprecationIssue.Level.CRITICAL
350344
);
351345
}
352346

353347
static DeprecationIssue checkIndexRoutingIncludeSetting(IndexMetadata indexMetadata) {
354348
return checkRemovedSetting(indexMetadata.getSettings(),
355349
INDEX_ROUTING_INCLUDE_SETTING,
356-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.14/data-tier-shard-filtering.html#data-tier-allocation-filters",
350+
"https://ela.st/es-deprecation-7-tier-filtering-settings",
357351
DeprecationIssue.Level.CRITICAL
358352
);
359353
}
360354

361355
static DeprecationIssue checkIndexRoutingExcludeSetting(IndexMetadata indexMetadata) {
362356
return checkRemovedSetting(indexMetadata.getSettings(),
363357
INDEX_ROUTING_EXCLUDE_SETTING,
364-
"https://www.elastic.co/guide/en/elasticsearch/reference/7.14/data-tier-shard-filtering.html#data-tier-allocation-filters",
358+
"https://ela.st/es-deprecation-7-tier-filtering-settings",
365359
DeprecationIssue.Level.CRITICAL
366360
);
367361
}
@@ -399,8 +393,7 @@ static DeprecationIssue checkGeoShapeMappings(IndexMetadata indexMetadata) {
399393
String details = String.format(Locale.ROOT,
400394
"The following geo_shape parameters must be removed from %s: [%s]", indexMetadata.getIndex().getName(),
401395
messages.stream().collect(Collectors.joining("; ")));
402-
String url = "https://www.elastic.co/guide/en/elasticsearch/reference/6.6/breaking-changes-6.6.html" +
403-
"#_deprecated_literal_geo_shape_literal_parameters";
396+
String url = "https://ela.st/es-deprecation-7-geo-shape-mappings";
404397
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
405398
}
406399
}

0 commit comments

Comments
 (0)