From cc2fd0b3808a465427eee80ac7c7d98b3f38fefa Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Thu, 7 Nov 2019 16:03:03 +0100 Subject: [PATCH] Revert "Upgrade jcodings dependency to 1.0.44 (#43334)" This reverts commit 08a3549a1eab3dae3b3994ee09c82fa671b4f1e8 and adds a test that demonstrates that grok with ignore case fails with the new dependency (jcodings 1.0.44 has a breaking change compared to 1.0.12, also requiring an upgrade of joni). --- libs/grok/build.gradle | 2 +- libs/grok/licenses/jcodings-1.0.12.jar.sha1 | 1 + libs/grok/licenses/jcodings-1.0.44.jar.sha1 | 1 - .../ingest/common/GrokProcessorTests.java | 10 ++++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 libs/grok/licenses/jcodings-1.0.12.jar.sha1 delete mode 100644 libs/grok/licenses/jcodings-1.0.44.jar.sha1 diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index 87dc1b8b6184b..25e2a40fc8dbe 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -20,7 +20,7 @@ dependencies { compile 'org.jruby.joni:joni:2.1.6' // joni dependencies: - compile 'org.jruby.jcodings:jcodings:1.0.44' + compile 'org.jruby.jcodings:jcodings:1.0.12' testCompile(project(":test:framework")) { exclude group: 'org.elasticsearch', module: 'elasticsearch-grok' diff --git a/libs/grok/licenses/jcodings-1.0.12.jar.sha1 b/libs/grok/licenses/jcodings-1.0.12.jar.sha1 new file mode 100644 index 0000000000000..b097e32ece493 --- /dev/null +++ b/libs/grok/licenses/jcodings-1.0.12.jar.sha1 @@ -0,0 +1 @@ +6bc17079fcaa8823ea8cd0d4c66516335b558db8 \ No newline at end of file diff --git a/libs/grok/licenses/jcodings-1.0.44.jar.sha1 b/libs/grok/licenses/jcodings-1.0.44.jar.sha1 deleted file mode 100644 index 4449009d3395e..0000000000000 --- a/libs/grok/licenses/jcodings-1.0.44.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -a6884b2fd8fd9a56874db05afaa22435043a2e3e \ No newline at end of file diff --git a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorTests.java b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorTests.java index 68654923ae926..2b4c45a10272f 100644 --- a/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorTests.java +++ b/modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/GrokProcessorTests.java @@ -45,6 +45,16 @@ public void testMatch() throws Exception { assertThat(doc.getFieldValue("one", String.class), equalTo("1")); } + public void testIgnoreCase() throws Exception { + String fieldName = RandomDocumentPicks.randomFieldName(random()); + IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>()); + doc.setFieldValue(fieldName, "A"); + GrokProcessor processor = new GrokProcessor(randomAlphaOfLength(10), Collections.emptyMap(), + Collections.singletonList("(?(?i)A)"), fieldName, false, false, ThreadWatchdog.noop()); + processor.execute(doc); + assertThat(doc.getFieldValue("a", String.class), equalTo("A")); + } + public void testNoMatch() { String fieldName = RandomDocumentPicks.randomFieldName(random()); IngestDocument doc = RandomDocumentPicks.randomIngestDocument(random(), new HashMap<>());