Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ public static class DeprecationIssue {
}

public enum Level {
NONE,
INFO,
WARNING,
CRITICAL
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import java.util.List;
import java.util.Map;

import static org.elasticsearch.client.migration.DeprecationInfoResponse.DeprecationIssue.Level.CRITICAL;
import static org.elasticsearch.client.migration.DeprecationInfoResponse.DeprecationIssue.Level.WARNING;
import static org.elasticsearch.test.AbstractXContentTestCase.xContentTester;

public class DeprecationInfoResponseTests extends ESTestCase {
Expand Down Expand Up @@ -94,7 +96,7 @@ private List<DeprecationInfoResponse.DeprecationIssue> createRandomIssues(boolea
// of elements for this list.
int startingRandomNumber = canBeEmpty ? 0: 1;
for (int i =0; i < randomIntBetween(startingRandomNumber, 2); i++) {
list.add(new DeprecationInfoResponse.DeprecationIssue(DeprecationInfoResponse.DeprecationIssue.Level.INFO,
list.add(new DeprecationInfoResponse.DeprecationIssue(randomFrom(WARNING, CRITICAL),
randomAlphaOfLength(5),
randomAlphaOfLength(5),
randomBoolean() ? randomAlphaOfLength(5) : null));
Expand Down
24 changes: 11 additions & 13 deletions docs/reference/migration/apis/deprecation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ Example response:
{
"cluster_settings" : [
{
"level" : "info",
"message" : "Network settings changes",
"url" : "{ref-60}/breaking_60_indices_changes.html#_index_templates_use_literal_index_patterns_literal_instead_of_literal_template_literal",
"details" : "templates using `template` field: watches,.monitoring-alerts,.watch-history-6,.ml-notifications,security-index-template,triggered_watches,.monitoring-es,.ml-meta,.ml-state,.monitoring-logstash,.ml-anomalies-,.monitoring-kibana"
"level" : "critical",
"message" : "Cluster name cannot contain ':'",
"url" : "{ref}/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_cluster_name",
"details" : "This cluster is named [mycompany:logging], which contains the illegal character ':'."
}
],
"node_settings" : [ ],
"index_settings" : {
".monitoring-es-6-2017.07.21" : [
"logs:apache" : [
{
"level" : "info",
"message" : "Coercion of boolean fields",
"url" : "{ref-60}/breaking_60_mappings_changes.html#_coercion_of_boolean_fields",
"details" : "[[type: doc, field: spins], [type: doc, field: mlockall], [type: doc, field: node_master], [type: doc, field: primary]]"
"level" : "warning",
"message" : "Index name cannot contain ':'",
"url" : "{ref}/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_index_name",
"details" : "This index is named [logs:apache], which contains the illegal character ':'."
}
]
}
Expand All @@ -79,7 +79,7 @@ The following is an example deprecation warning:
["source","js",subs="attributes,callouts,macros"]
--------------------------------------------------
{
"level" : "info",
"level" : "warning",
"message" : "This is the generic descriptive message of the breaking change",
"url" : "{ref-60}/breaking_60_indices_changes.html",
"details" : "more information, like which nodes, indices, or settings are to blame"
Expand All @@ -91,10 +91,8 @@ As is shown, there is a `level` property that describes the significance of the
issue.

|=======
|none | Everything is good.
|info | An advisory note that something has changed. No action needed.
|warning | You can upgrade directly, but you are using deprecated functionality
which will not be available in the next major version.
which will not be available or behave differently in the next major version.
|critical | You cannot upgrade without fixing this problem.
|=======

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@
public class DeprecationIssue implements Writeable, ToXContentObject {

public enum Level implements Writeable {
NONE,
INFO,
/**
* Resolving this issue is advised but not required to upgrade. There may be undesired changes in behavior unless this issue is
* resolved before upgrading.
*/
WARNING,
/**
* This issue must be resolved to upgrade. Failures will occur unless this is resolved before upgrading.
*/
CRITICAL
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ private DeprecationChecks() {
static List<Function<IndexMetaData, DeprecationIssue>> INDEX_SETTINGS_CHECKS =
Collections.unmodifiableList(Arrays.asList(
IndexDeprecationChecks::baseSimilarityDefinedCheck,
IndexDeprecationChecks::coercionCheck,
IndexDeprecationChecks::dynamicTemplateWithMatchMappingTypeCheck,
IndexDeprecationChecks::indexSharedFileSystemCheck,
IndexDeprecationChecks::indexStoreTypeCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ private static List<String> findInPropertiesRecursively(String type, Map<String,
return issues;
}

static DeprecationIssue coercionCheck(IndexMetaData indexMetaData) {
if (indexMetaData.getCreationVersion().before(Version.V_6_0_0_alpha1)) {
List<String> issues = new ArrayList<>();
fieldLevelMappingIssue(indexMetaData, (mappingMetaData, sourceAsMap) -> {
issues.addAll(findInPropertiesRecursively(mappingMetaData.type(), sourceAsMap,
property -> "boolean".equals(property.get("type"))));
});
if (issues.size() > 0) {
return new DeprecationIssue(DeprecationIssue.Level.INFO, "Coercion of boolean fields",
"https://www.elastic.co/guide/en/elasticsearch/reference/master/" +
"breaking_60_mappings_changes.html#_coercion_of_boolean_fields",
issues.toString());
}
}
return null;
}

static DeprecationIssue dynamicTemplateWithMatchMappingTypeCheck(IndexMetaData indexMetaData) {
if (indexMetaData.getCreationVersion().before(Version.V_6_0_0_alpha1)) {
List<String> issues = new ArrayList<>();
Expand Down