From 68f06ba3e5e859c2a82b3fd669e2af86c567059d Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Fri, 14 Jan 2022 21:45:58 +0000 Subject: [PATCH 1/4] Disables detekt due to missing dependencies Signed-off-by: Robert Downs --- build.gradle | 7 ------- detekt.yml | 12 ------------ 2 files changed, 19 deletions(-) delete mode 100644 detekt.yml diff --git a/build.gradle b/build.gradle index 1330ea99a..c3f9a6d68 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,6 @@ buildscript { classpath "org.opensearch.gradle:build-tools:${opensearch_version}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}" - classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0-RC15" classpath "org.jacoco:org.jacoco.agent:0.8.5" } } @@ -67,7 +66,6 @@ apply plugin: 'idea' apply plugin: 'opensearch.opensearchplugin' apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.rest-test' -apply plugin: 'io.gitlab.arturbosch.detekt' apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'org.jetbrains.kotlin.plugin.allopen' @@ -134,11 +132,6 @@ task ktlintFormat(type: JavaExec, group: "formatting") { args "-F", "src/**/*.kt" } -detekt { - config = files("detekt.yml") - buildUponDefaultConfig = true -} - configurations.testCompile { exclude module: "securemock" } diff --git a/detekt.yml b/detekt.yml deleted file mode 100644 index 491e3648e..000000000 --- a/detekt.yml +++ /dev/null @@ -1,12 +0,0 @@ -failFast: false - -# TODO: Remove this before initial release, only for developmental purposes -exceptions: - TooGenericExceptionCaught: - active: false - -style: - ForbiddenComment: - active: false - MaxLineLength: - maxLineLength: 150 From cd51b559c9e75ccf33464c1e508d56fd4f4410ac Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Tue, 18 Jan 2022 20:03:32 +0000 Subject: [PATCH 2/4] 1.2.4 release notes Signed-off-by: Robert Downs --- .../opensearch-index-management.release-notes-1.2.4.0.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 release-notes/opensearch-index-management.release-notes-1.2.4.0.md diff --git a/release-notes/opensearch-index-management.release-notes-1.2.4.0.md b/release-notes/opensearch-index-management.release-notes-1.2.4.0.md new file mode 100644 index 000000000..5f81774a0 --- /dev/null +++ b/release-notes/opensearch-index-management.release-notes-1.2.4.0.md @@ -0,0 +1,7 @@ +## Version 1.2.4.0 2022-01-18 + +Compatible with OpenSearch 1.2.4 + +### Infrastructure + +* Disables detekt due to missing dependencies ([#250](https://github.com/opensearch-project/index-management/pull/250/files)) \ No newline at end of file From 3b4245aaa3951175d9944c31eac2d5af7938359a Mon Sep 17 00:00:00 2001 From: Robert Downs Date: Thu, 13 Jan 2022 22:10:08 +0000 Subject: [PATCH 3/4] fixes flaky rollup/transform explain IT Signed-off-by: Robert Downs --- .../resthandler/RestExplainRollupActionIT.kt | 22 +++++++++---------- .../RestExplainTransformActionIT.kt | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt index 0daf3c4bc..4baab606d 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestExplainRollupActionIT.kt @@ -89,7 +89,7 @@ class RestExplainRollupActionIT : RollupRestTestCase() { @Throws(Exception::class) fun `test explain rollup for nonexistent id`() { // Creating a rollup so the config index exists - createRollup(rollup = randomRollup(), rollupId = "doesnt_exist_some_other_id") + createRollup(rollup = randomRollup(), rollupId = "doesnt_exist_some_other_rollup_id") val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/doesnt_exist/_explain") assertNull("Nonexistent rollup didn't return null", response.asMap()["doesnt_exist"]) } @@ -97,30 +97,30 @@ class RestExplainRollupActionIT : RollupRestTestCase() { @Throws(Exception::class) fun `test explain rollup for wildcard id`() { // Creating a rollup so the config index exists - createRollup(rollup = randomRollup(), rollupId = "wildcard_some_id") - createRollup(rollup = randomRollup(), rollupId = "wildcard_some_other_id") + createRollup(rollup = randomRollup(), rollupId = "wildcard_some_rollup_id") + createRollup(rollup = randomRollup(), rollupId = "wildcard_some_other_rollup_id") val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/wildcard_some*/_explain") // We don't expect there to always be metadata as we are creating random rollups and the job isn't running // but we do expect the wildcard some* to expand to the two jobs created above and have non-null values (meaning they exist) val map = response.asMap() - assertNotNull("Non null wildcard_some_id value wasn't in the response", map["wildcard_some_id"]) - assertNotNull("Non null wildcard_some_other_id value wasn't in the response", map["wildcard_some_other_id"]) + assertNotNull("Non null wildcard_some_rollup_id value wasn't in the response", map["wildcard_some_rollup_id"]) + assertNotNull("Non null wildcard_some_other_rollup_id value wasn't in the response", map["wildcard_some_other_rollup_id"]) } @Throws(Exception::class) fun `test explain rollup for job that hasnt started`() { - createRollup(rollup = randomRollup().copy(metadataID = null), rollupId = "not_started_some_id") - val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/not_started_some_id/_explain") - val expectedMap = mapOf("not_started_some_id" to mapOf("metadata_id" to null, "rollup_metadata" to null)) + createRollup(rollup = randomRollup().copy(metadataID = null), rollupId = "not_started_some_rollup_id") + val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/not_started_some_rollup_id/_explain") + val expectedMap = mapOf("not_started_some_rollup_id" to mapOf("metadata_id" to null, "rollup_metadata" to null)) assertEquals("The explain response did not match expected", expectedMap, response.asMap()) } @Throws(Exception::class) fun `test explain rollup for metadata_id but no metadata`() { // This is to test the case of a rollup existing with a metadataID but there being no metadata document - createRollup(rollup = randomRollup().copy(metadataID = "some_metadata_id"), rollupId = "no_meta_some_id") - val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/no_meta_some_id/_explain") - val expectedMap = mapOf("no_meta_some_id" to mapOf("metadata_id" to "some_metadata_id", "rollup_metadata" to null)) + createRollup(rollup = randomRollup().copy(metadataID = "some_metadata_id"), rollupId = "no_meta_some_rollup_id") + val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/no_meta_some_rollup_id/_explain") + val expectedMap = mapOf("no_meta_some_rollup_id" to mapOf("metadata_id" to "some_metadata_id", "rollup_metadata" to null)) assertEquals("The explain response did not match expected", expectedMap, response.asMap()) } diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt index 7f00fddc0..be305aae6 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestExplainTransformActionIT.kt @@ -73,7 +73,7 @@ class RestExplainTransformActionIT : TransformRestTestCase() { @Throws(Exception::class) fun `test explain transform for nonexistent id`() { // Creating a transform so the config index exists - createTransform(transform = randomTransform(), transformId = "doesnt_exist_some_other_id") + createTransform(transform = randomTransform(), transformId = "doesnt_exist_some_other_transform_id") val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/doesnt_exist/_explain") assertNull("Nonexistent transform didn't return null", response.asMap()["doesnt_exist"]) } @@ -81,29 +81,29 @@ class RestExplainTransformActionIT : TransformRestTestCase() { @Throws(Exception::class) fun `test explain transform for wildcard id`() { // Creating a transform so the config index exists - createTransform(transform = randomTransform(), transformId = "wildcard_some_id") - createTransform(transform = randomTransform(), transformId = "wildcard_some_other_id") + createTransform(transform = randomTransform(), transformId = "wildcard_some_transform_id") + createTransform(transform = randomTransform(), transformId = "wildcard_some_other_transform_id") val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/wildcard_some*/_explain") // We don't expect there to always be metadata we are creating random transforms and the job isn't running // but we do expect the wildcard some* to expand to the two jobs created above and have non-null values (meaning they exist) val map = response.asMap() - assertNotNull("Non null wildcard_some_id value wasn't in the response", map["wildcard_some_id"]) - assertNotNull("Non null wildcard_some_other_id value wasn't in the response", map["wildcard_some_other_id"]) + assertNotNull("Non null wildcard_some_transform_id value wasn't in the response", map["wildcard_some_transform_id"]) + assertNotNull("Non null wildcard_some_other_transform_id value wasn't in the response", map["wildcard_some_other_transform_id"]) } @Throws(Exception::class) fun `test explain transform for job that hasnt started`() { - createTransform(transform = randomTransform().copy(metadataId = null), transformId = "not_started_some_id") - val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/not_started_some_id/_explain") - val expectedMap = mapOf("not_started_some_id" to mapOf("metadata_id" to null, "transform_metadata" to null)) + createTransform(transform = randomTransform().copy(metadataId = null), transformId = "not_started_some_transform_id") + val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/not_started_some_transform_id/_explain") + val expectedMap = mapOf("not_started_some_transform_id" to mapOf("metadata_id" to null, "transform_metadata" to null)) assertEquals("The explain response did not match expected", expectedMap, response.asMap()) } @Throws(Exception::class) fun `test explain transform for new transform attempted to create with metadata id`() { - createTransform(transform = randomTransform().copy(metadataId = "some_metadata_id"), transformId = "no_meta_some_id") - val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/no_meta_some_id/_explain") - val expectedMap = mapOf("no_meta_some_id" to mapOf("metadata_id" to null, "transform_metadata" to null)) + createTransform(transform = randomTransform().copy(metadataId = "some_metadata_id"), transformId = "no_meta_some_transform_id") + val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/no_meta_some_transform_id/_explain") + val expectedMap = mapOf("no_meta_some_transform_id" to mapOf("metadata_id" to null, "transform_metadata" to null)) assertEquals("The explain response did not match expected", expectedMap, response.asMap()) } From 13a3541f577f6371ce92c3f14c219704a2db5158 Mon Sep 17 00:00:00 2001 From: Clay Downs Date: Thu, 13 Jan 2022 14:54:22 -0800 Subject: [PATCH 4/4] fixes additional duplicate ids Signed-off-by: Clay Downs --- .../transform/resthandler/RestStartTransformActionIT.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt index dea9e27ee..7f62555c7 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/transform/resthandler/RestStartTransformActionIT.kt @@ -84,7 +84,7 @@ class RestStartTransformActionIT : TransformRestTestCase() { @Throws(Exception::class) fun `test starting a failed transform`() { val transform = randomTransform().copy( - id = "restart_failed_rollup", + id = "restart_failed_transform", schemaVersion = 1L, enabled = true, jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES), @@ -150,7 +150,7 @@ class RestStartTransformActionIT : TransformRestTestCase() { generateNYCTaxiData("source_restart_finished_transform") assertIndexExists("source_restart_finished_transform") val transform = randomTransform().copy( - id = "restart_finished_rollup", + id = "restart_finished_transform", schemaVersion = 1L, enabled = true, jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES),