From 80bbc85703ea364f8923a93c77da2c9a1752d68d Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 20 Feb 2019 18:04:57 -0600 Subject: [PATCH 1/5] minor updates for user-agent ecs for 6.7 PR #38757 changed 7.0 user-agent behavior for the ecs flag to more closely resemble 6.7. This commit updates the forward looking comments and deprecation notices to be more accurate now that this flag will not be removed until 8.0 related #38757 --- .../ingest/useragent/UserAgentProcessor.java | 8 ++++---- .../xpack/deprecation/ClusterDeprecationChecks.java | 3 +-- .../xpack/deprecation/ClusterDeprecationChecksTests.java | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java index 11c8d356bf2e2..8fcc113ca952f 100644 --- a/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java +++ b/modules/ingest-user-agent/src/main/java/org/elasticsearch/ingest/useragent/UserAgentProcessor.java @@ -150,7 +150,7 @@ public IngestDocument execute(IngestDocument ingestDocument) { } } } else { - // Deprecated format, removed in 7.0 + // Deprecated format, removed in 8.0 for (Property property : this.properties) { switch (property) { case NAME: @@ -316,7 +316,7 @@ public UserAgentProcessor create(Map factories, Strin if (useECS == false) { deprecationLogger.deprecated("setting [ecs] to false for non-common schema " + - "format is deprecated and will be removed in 7.0, set to true to use the non-deprecated format"); + "format is deprecated and will be removed in 8.0, set to true to use the non-deprecated format"); } return new UserAgentProcessor(processorTag, field, targetField, parser, properties, ignoreMissing, useECS); @@ -326,12 +326,12 @@ public UserAgentProcessor create(Map factories, Strin enum Property { NAME, - // Deprecated in 6.7 (superceded by VERSION), to be removed in 7.0 + // Deprecated in 6.7 (superceded by VERSION), to be removed in 8.0 @Deprecated MAJOR, @Deprecated MINOR, @Deprecated PATCH, OS, - // Deprecated in 6.7 (superceded by just using OS), to be removed in 7.0 + // Deprecated in 6.7 (superceded by just using OS), to be removed in 8.0 @Deprecated OS_NAME, @Deprecated OS_MAJOR, @Deprecated OS_MINOR, diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java index 8142622b1f0ba..c3d0a7a1b3b9d 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java @@ -78,8 +78,7 @@ static DeprecationIssue checkUserAgentPipelines(ClusterState state) { .filter(Objects::nonNull) .filter(processor -> processor.containsKey("user_agent")) .map(processor -> processor.get("user_agent")) - .anyMatch(processorConfig -> - false == ConfigurationUtils.readBooleanProperty(null, null, processorConfig, "ecs", false)); + .anyMatch(processorConfig -> processorConfig.containsKey("ecs") == false); }) .map(PipelineConfiguration::getId) .sorted() // Make the warning consistent for testing purposes diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java index 007c3edd0a85e..7341a1d29b14a 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java @@ -157,7 +157,7 @@ public void testUserAgentEcsCheck() { "User-Agent ingest plugin will use ECS-formatted output", "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" + "#ingest-user-agent-ecs-always", - "Ingest pipelines [ecs_false, ecs_null] will change to using ECS output format in 7.0"); + "Ingest pipelines [ecs_null] will change to using ECS output format in 7.0"); assertEquals(singletonList(expected), issues); } } From 4ef63499cf923e1074d2109bf89aae0ab0f7a9df Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Wed, 20 Feb 2019 18:40:56 -0600 Subject: [PATCH 2/5] Update x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java Co-Authored-By: jakelandis --- .../xpack/deprecation/ClusterDeprecationChecksTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java index 7341a1d29b14a..53d541725afb2 100644 --- a/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java +++ b/x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecksTests.java @@ -157,7 +157,7 @@ public void testUserAgentEcsCheck() { "User-Agent ingest plugin will use ECS-formatted output", "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" + "#ingest-user-agent-ecs-always", - "Ingest pipelines [ecs_null] will change to using ECS output format in 7.0"); + "Ingest pipelines [ecs_null] will change to using ECS output format by default in 7.0"); assertEquals(singletonList(expected), issues); } } From c07299fc62c41995b913a6cb54f24da5718bd63a Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 21 Feb 2019 08:32:26 -0600 Subject: [PATCH 3/5] fix checkstyle --- .../xpack/deprecation/ClusterDeprecationChecks.java | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java index c3d0a7a1b3b9d..eb3178b9ec740 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java @@ -8,7 +8,6 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.MetaData; -import org.elasticsearch.ingest.ConfigurationUtils; import org.elasticsearch.ingest.IngestService; import org.elasticsearch.ingest.PipelineConfiguration; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; From f08c263db830c90f714bd5f1c344f732f14f7e1a Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 21 Feb 2019 09:23:32 -0600 Subject: [PATCH 4/5] ensure deprecation wording matches tests (added by default) --- .../xpack/deprecation/ClusterDeprecationChecks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java index eb3178b9ec740..dd2f5ad53f529 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/ClusterDeprecationChecks.java @@ -87,7 +87,7 @@ static DeprecationIssue checkUserAgentPipelines(ClusterState state) { "User-Agent ingest plugin will use ECS-formatted output", "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" + "#ingest-user-agent-ecs-always", - "Ingest pipelines " + pipelinesWithDeprecatedEcsConfig + " will change to using ECS output format in 7.0"); + "Ingest pipelines " + pipelinesWithDeprecatedEcsConfig + " will change to using ECS output format by default in 7.0"); } return null; From 4abb6cc0c88fb13c5b2045bc152a842a1063f54b Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 21 Feb 2019 13:04:33 -0600 Subject: [PATCH 5/5] fix the test for the updated wording of the deprecration --- .../test/ingest-useragent/20_useragent_processor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/20_useragent_processor.yml b/modules/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/20_useragent_processor.yml index c5539a8ccc6d4..718ba0cea02fd 100644 --- a/modules/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/20_useragent_processor.yml +++ b/modules/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/20_useragent_processor.yml @@ -90,7 +90,7 @@ - do: warnings: - - "setting [ecs] to false for non-common schema format is deprecated and will be removed in 7.0, set to true to use the non-deprecated format" + - "setting [ecs] to false for non-common schema format is deprecated and will be removed in 8.0, set to true to use the non-deprecated format" - "the [os_major] property is deprecated for the user-agent processor" ingest.put_pipeline: id: "my_pipeline"