From 427ce4497312b58fc7b5d9e43591506759549176 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Jul 2022 14:42:15 -0700 Subject: [PATCH 1/4] Added 2.1 release notes. (#485) (#486) * Added 2.1 release notes. Signed-off-by: AWSHurneyt * Added 2.1 release notes. Signed-off-by: AWSHurneyt (cherry picked from commit 9f3c393d4e652dd16fb89cd176309f75ef528d92) Co-authored-by: AWSHurneyt --- .../opensearch-alerting.release-notes-2.1.0.0.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 release-notes/opensearch-alerting.release-notes-2.1.0.0.md diff --git a/release-notes/opensearch-alerting.release-notes-2.1.0.0.md b/release-notes/opensearch-alerting.release-notes-2.1.0.0.md new file mode 100644 index 000000000..dae6e4800 --- /dev/null +++ b/release-notes/opensearch-alerting.release-notes-2.1.0.0.md @@ -0,0 +1,9 @@ +## Version 2.1.0.0 2022-07-06 + +Compatible with OpenSearch 2.1.0 + +### Maintenance +* Bumped version to 2.1.0, and gradle to 7.4.2. ([#475](https://github.com/opensearch-project/alerting/pull/475])) + +### Documentation +* Added 2.1 release notes. ([#485](https://github.com/opensearch-project/alerting/pull/485)) \ No newline at end of file From 7578ba6ce40a92967eef5beaa6e7c97cb42c8900 Mon Sep 17 00:00:00 2001 From: Sayali Rohidas Gaikawad Date: Wed, 13 Jul 2022 22:11:09 +0000 Subject: [PATCH 2/4] Incremented version to 2.1.1. Signed-off-by: Sayali Rohidas Gaikawad --- alerting/build.gradle | 2 +- build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alerting/build.gradle b/alerting/build.gradle index df76479ff..8a7ac7097 100644 --- a/alerting/build.gradle +++ b/alerting/build.gradle @@ -257,7 +257,7 @@ String bwcRemoteFile = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elastics testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2","2.1.0-SNAPSHOT"] + versions = ["7.10.2","2.1.1-SNAPSHOT"] numberOfNodes = 3 plugin(provider(new Callable(){ @Override diff --git a/build.gradle b/build.gradle index 0e68e8f04..f6bfeaa67 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,10 @@ buildscript { apply from: 'build-tools/repositories.gradle' ext { - opensearch_version = System.getProperty("opensearch.version", "2.1.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "2.1.1-SNAPSHOT") buildVersionQualifier = System.getProperty("build.version_qualifier", "") isSnapshot = "true" == System.getProperty("build.snapshot", "true") - // 2.1.0-SNAPSHOT -> 2.1.0.0-SNAPSHOT + // 2.1.1-SNAPSHOT -> 2.1.1.0-SNAPSHOT version_tokens = opensearch_version.tokenize('-') opensearch_build = version_tokens[0] + '.0' plugin_no_snapshot = opensearch_build From 6fdc8429f272d4517fde6eababd7de5dbe168399 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:08:54 -0700 Subject: [PATCH 3/4] Staging for version increment automation (#489) (#502) * Version increment automation Signed-off-by: pgodithi * Version increment automation: task rename updateVersion Signed-off-by: pgodithi (cherry picked from commit 3b8bfe7c7b2cdc42a4da338af63edf9e1150cbd4) Signed-off-by: prudhvigodithi Co-authored-by: Prudhvi Godithi --- build.gradle | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.gradle b/build.gradle index 0e68e8f04..26695687c 100644 --- a/build.gradle +++ b/build.gradle @@ -93,3 +93,20 @@ allprojects { evaluationDependsOnChildren() check.dependsOn subprojects*.check + +// updateVersion: Task to auto increment to the next development iteration +task updateVersion { + onlyIf { System.getProperty('newVersion') } + doLast { + ext.newVersion = System.getProperty('newVersion') + println "Setting version to ${newVersion}." + // String tokenization to support -SNAPSHOT + ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) { + fileset(dir: projectDir) { + // Include the required files that needs to be updated with new Version + include(name: "alerting/build.gradle") + } + } + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +} \ No newline at end of file From 5477b506bfd9892955245b2905c24ee0cb276945 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 17:59:24 -0700 Subject: [PATCH 4/4] Refactored backwards compatibility tests to point to the OpenSearch 1.1.0.0 zip following deprecation of ODFE. (#510) (#511) Signed-off-by: AWSHurneyt (cherry picked from commit fea6b4a73c6e79d1beccc03db1bcb48ea67886b8) Co-authored-by: AWSHurneyt --- alerting/build.gradle | 12 ++-- .../bwc/AlertingBackwardsCompatibilityIT.kt | 58 +++++++++---------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/alerting/build.gradle b/alerting/build.gradle index df76479ff..2a583f581 100644 --- a/alerting/build.gradle +++ b/alerting/build.gradle @@ -183,7 +183,7 @@ testClusters.integTest { } testClusters.integTest.nodes.each { node -> - node.setting("opendistro.destination.host.deny_list", "[\"10.0.0.0/8\", \"127.0.0.1\"]") + node.setting("plugins.destination.host.deny_list", "[\"10.0.0.0/8\", \"127.0.0.1\"]") } integTest { @@ -247,17 +247,17 @@ task integTestRemote(type: RestIntegTestTask) { } integTestRemote.enabled = System.getProperty("tests.rest.cluster") != null -String bwcVersion = "1.13.1.0" +String bwcVersion = "1.1.0.0" String baseName = "alertingBwcCluster" String bwcFilePath = "src/test/resources/bwc" -String bwcOpenDistroPlugin = "opendistro-alerting-" + bwcVersion + ".zip" -String bwcRemoteFile = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-alerting/' + bwcOpenDistroPlugin +String bwcOpenSearchPlugin = "opensearch-alerting-" + bwcVersion + ".zip" +String bwcRemoteFile = 'https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/' + bwcOpenSearchPlugin 2.times {i -> testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2","2.1.0-SNAPSHOT"] + versions = ["1.1.0", "2.1.0-SNAPSHOT"] numberOfNodes = 3 plugin(provider(new Callable(){ @Override @@ -270,7 +270,7 @@ String bwcRemoteFile = 'https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elastics if (!dir.exists()) { dir.mkdirs() } - File f = new File(dir, bwcOpenDistroPlugin) + File f = new File(dir, bwcOpenSearchPlugin) if (!f.exists()) { new URL(bwcRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }} } diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt index 0346272cd..3f41bd522 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/bwc/AlertingBackwardsCompatibilityIT.kt @@ -9,7 +9,6 @@ import org.apache.http.entity.ContentType.APPLICATION_JSON import org.apache.http.entity.StringEntity import org.opensearch.alerting.ALERTING_BASE_URI import org.opensearch.alerting.AlertingRestTestCase -import org.opensearch.alerting.LEGACY_OPENDISTRO_ALERTING_BASE_URI import org.opensearch.alerting.makeRequest import org.opensearch.alerting.model.Monitor import org.opensearch.common.settings.Settings @@ -53,15 +52,15 @@ class AlertingBackwardsCompatibilityIT : AlertingRestTestCase() { val pluginNames = plugins.map { plugin -> plugin["name"] }.toSet() when (CLUSTER_TYPE) { ClusterType.OLD -> { - assertTrue(pluginNames.contains("opendistro-alerting")) + assertTrue(pluginNames.contains("opensearch-alerting")) createBasicMonitor() } ClusterType.MIXED -> { assertTrue(pluginNames.contains("opensearch-alerting")) - verifyMonitorExists(LEGACY_OPENDISTRO_ALERTING_BASE_URI) + verifyMonitorExists(ALERTING_BASE_URI) // TODO: Need to move the base URI being used here into a constant and rename ALERTING_BASE_URI to // MONITOR_BASE_URI - verifyMonitorStats("/_opendistro/_alerting") + verifyMonitorStats("/_plugins/_alerting") } ClusterType.UPGRADED -> { assertTrue(pluginNames.contains("opensearch-alerting")) @@ -112,7 +111,7 @@ class AlertingBackwardsCompatibilityIT : AlertingRestTestCase() { @Throws(Exception::class) private fun createBasicMonitor() { val indexName = "test_bwc_index" - val legacyMonitorString = """ + val bwcMonitorString = """ { "type": "monitor", "name": "test_bwc_monitor", @@ -123,43 +122,38 @@ class AlertingBackwardsCompatibilityIT : AlertingRestTestCase() { "unit": "MINUTES" } }, - "inputs": [ - { - "search": { - "indices": [ - "$indexName" - ], + "inputs": [{ + "search": { + "indices": ["$indexName"], + "query": { + "size": 0, + "aggregations": {}, "query": { - "size": 0, - "query": { - "match_all": {} - } + "match_all": {} } } } - ], - "triggers": [ - { - "name": "abc", - "severity": "1", - "condition": { - "script": { - "source": "ctx.results[0].hits.total.value > 100000", - "lang": "painless" - } - }, - "actions": [] - } - ] + }], + "triggers": [{ + "name": "abc", + "severity": "1", + "condition": { + "script": { + "source": "ctx.results[0].hits.total.value > 100000", + "lang": "painless" + } + }, + "actions": [] + }] } """.trimIndent() createIndex(indexName, Settings.EMPTY) val createResponse = client().makeRequest( method = "POST", - endpoint = "$LEGACY_OPENDISTRO_ALERTING_BASE_URI?refresh=true", + endpoint = "$ALERTING_BASE_URI?refresh=true", params = emptyMap(), - entity = StringEntity(legacyMonitorString, APPLICATION_JSON) + entity = StringEntity(bwcMonitorString, APPLICATION_JSON) ) assertEquals("Create monitor failed", RestStatus.CREATED, createResponse.restStatus()) @@ -167,7 +161,7 @@ class AlertingBackwardsCompatibilityIT : AlertingRestTestCase() { val createdId = responseBody["_id"] as String val createdVersion = responseBody["_version"] as Int assertNotEquals("Create monitor response is missing id", Monitor.NO_ID, createdId) - assertTrue("Create monitor reponse has incorrect version", createdVersion > 0) + assertTrue("Create monitor response has incorrect version", createdVersion > 0) } @Throws(Exception::class)