diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 050a4a26c..0e968eaa9 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -29,19 +29,20 @@ jobs: with: repository: 'opensearch-project/OpenSearch' path: OpenSearch - ref: '1.0.0-beta1' + ref: '1.x' - name: Build OpenSearch working-directory: ./OpenSearch - run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=beta1 -Dbuild.snapshot=false + run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=rc1 -Dbuild.snapshot=false # This step adds dependency, common-utils - name: Checkout common-utils uses: actions/checkout@v2 with: repository: 'opensearch-project/common-utils' path: common-utils + ref: 'main' - name: Build common-utils working-directory: ./common-utils - run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1 + run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-rc1 # This step uses the checkout Github action: https://github.com/actions/checkout - name: Checkout Branch uses: actions/checkout@v2 @@ -51,4 +52,4 @@ jobs: with: java-version: 14 - name: Run integration tests with multi node config - run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.0.0-beta1 + run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.0.0-rc1 diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 0601ff630..5739e325e 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -35,10 +35,10 @@ jobs: with: repository: 'opensearch-project/OpenSearch' path: OpenSearch - ref: '1.0.0-beta1' + ref: '1.x' - name: Build OpenSearch working-directory: ./OpenSearch - run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=beta1 -Dbuild.snapshot=false + run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=rc1 -Dbuild.snapshot=false # dependencies: common-utils - name: Checkout common-utils @@ -48,10 +48,10 @@ jobs: path: common-utils - name: Build common-utils working-directory: ./common-utils - run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1 + run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-rc1 - name: Build and run with Gradle - run: ./gradlew build -Dopensearch.version=1.0.0-beta1 + run: ./gradlew build -Dopensearch.version=1.0.0-rc1 # - name: Create Artifact Path # run: | @@ -70,4 +70,4 @@ jobs: # path: alerting-artifacts # Publish to local maven - name: Publish to Maven Local - run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-beta1 + run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-rc1 diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt index db2cbc538..2a2c75510 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt @@ -54,6 +54,7 @@ import org.opensearch.alerting.core.model.ScheduledJob import org.opensearch.alerting.core.model.SearchInput import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler import org.opensearch.alerting.core.schedule.JobScheduler +import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSettings import org.opensearch.alerting.core.settings.ScheduledJobSettings import org.opensearch.alerting.model.Monitor import org.opensearch.alerting.resthandler.RestAcknowledgeAlertAction @@ -77,6 +78,8 @@ import org.opensearch.alerting.resthandler.RestSearchMonitorAction import org.opensearch.alerting.script.TriggerScript import org.opensearch.alerting.settings.AlertingSettings import org.opensearch.alerting.settings.DestinationSettings +import org.opensearch.alerting.settings.LegacyOpenDistroAlertingSettings +import org.opensearch.alerting.settings.LegacyOpenDistroDestinationSettings import org.opensearch.alerting.transport.TransportAcknowledgeAlertAction import org.opensearch.alerting.transport.TransportDeleteDestinationAction import org.opensearch.alerting.transport.TransportDeleteEmailAccountAction @@ -253,6 +256,12 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R ScheduledJobSettings.SWEEP_PERIOD, ScheduledJobSettings.SWEEP_PAGE_SIZE, ScheduledJobSettings.SWEEPER_ENABLED, + LegacyOpenDistroScheduledJobSettings.REQUEST_TIMEOUT, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_MILLIS, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT, + LegacyOpenDistroScheduledJobSettings.SWEEP_PERIOD, + LegacyOpenDistroScheduledJobSettings.SWEEP_PAGE_SIZE, + LegacyOpenDistroScheduledJobSettings.SWEEPER_ENABLED, AlertingSettings.INPUT_TIMEOUT, AlertingSettings.INDEX_TIMEOUT, AlertingSettings.BULK_TIMEOUT, @@ -269,10 +278,30 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R AlertingSettings.REQUEST_TIMEOUT, AlertingSettings.MAX_ACTION_THROTTLE_VALUE, AlertingSettings.FILTER_BY_BACKEND_ROLES, + LegacyOpenDistroAlertingSettings.INPUT_TIMEOUT, + LegacyOpenDistroAlertingSettings.INDEX_TIMEOUT, + LegacyOpenDistroAlertingSettings.BULK_TIMEOUT, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ENABLED, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_MAX_DOCS, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_RETENTION_PERIOD, + LegacyOpenDistroAlertingSettings.ALERTING_MAX_MONITORS, + LegacyOpenDistroAlertingSettings.REQUEST_TIMEOUT, + LegacyOpenDistroAlertingSettings.MAX_ACTION_THROTTLE_VALUE, + LegacyOpenDistroAlertingSettings.FILTER_BY_BACKEND_ROLES, DestinationSettings.EMAIL_USERNAME, DestinationSettings.EMAIL_PASSWORD, DestinationSettings.ALLOW_LIST, - DestinationSettings.HOST_DENY_LIST + DestinationSettings.HOST_DENY_LIST, + LegacyOpenDistroDestinationSettings.EMAIL_USERNAME, + LegacyOpenDistroDestinationSettings.EMAIL_PASSWORD, + LegacyOpenDistroDestinationSettings.ALLOW_LIST, + LegacyOpenDistroDestinationSettings.HOST_DENY_LIST ) } diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/AlertingSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/AlertingSettings.kt index ad98d0002..f00a43aa2 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/settings/AlertingSettings.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/AlertingSettings.kt @@ -28,8 +28,6 @@ package org.opensearch.alerting.settings import org.opensearch.alerting.AlertingPlugin import org.opensearch.common.settings.Setting -import org.opensearch.common.unit.TimeValue -import java.util.concurrent.TimeUnit /** * settings specific to [AlertingPlugin]. These settings include things like history index max age, request timeout, etc... @@ -42,99 +40,98 @@ class AlertingSettings { const val MONITOR_MAX_TRIGGERS = 10 val ALERTING_MAX_MONITORS = Setting.intSetting( - "opendistro.alerting.monitor.max_monitors", - 1000, + "plugins.alerting.monitor.max_monitors", + LegacyOpenDistroAlertingSettings.ALERTING_MAX_MONITORS, Setting.Property.NodeScope, Setting.Property.Dynamic ) val INPUT_TIMEOUT = Setting.positiveTimeSetting( - "opendistro.alerting.input_timeout", - TimeValue.timeValueSeconds(30), + "plugins.alerting.input_timeout", + LegacyOpenDistroAlertingSettings.INPUT_TIMEOUT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val INDEX_TIMEOUT = Setting.positiveTimeSetting( - "opendistro.alerting.index_timeout", - TimeValue.timeValueSeconds(60), + "plugins.alerting.index_timeout", + LegacyOpenDistroAlertingSettings.INDEX_TIMEOUT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val BULK_TIMEOUT = Setting.positiveTimeSetting( - "opendistro.alerting.bulk_timeout", - TimeValue.timeValueSeconds(120), + "plugins.alerting.bulk_timeout", + LegacyOpenDistroAlertingSettings.BULK_TIMEOUT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_BACKOFF_MILLIS = Setting.positiveTimeSetting( - "opendistro.alerting.alert_backoff_millis", - TimeValue.timeValueMillis(50), + "plugins.alerting.alert_backoff_millis", + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_MILLIS, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_BACKOFF_COUNT = Setting.intSetting( - "opendistro.alerting.alert_backoff_count", - 2, + "plugins.alerting.alert_backoff_count", + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_COUNT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val MOVE_ALERTS_BACKOFF_MILLIS = Setting.positiveTimeSetting( - "opendistro.alerting.move_alerts_backoff_millis", - TimeValue.timeValueMillis(250), + "plugins.alerting.move_alerts_backoff_millis", + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS, Setting.Property.NodeScope, Setting.Property.Dynamic ) val MOVE_ALERTS_BACKOFF_COUNT = Setting.intSetting( - "opendistro.alerting.move_alerts_backoff_count", - 3, + "plugins.alerting.move_alerts_backoff_count", + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_HISTORY_ENABLED = Setting.boolSetting( - "opendistro.alerting.alert_history_enabled", - true, + "plugins.alerting.alert_history_enabled", + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ENABLED, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_HISTORY_ROLLOVER_PERIOD = Setting.positiveTimeSetting( - "opendistro.alerting.alert_history_rollover_period", - TimeValue.timeValueHours(12), + "plugins.alerting.alert_history_rollover_period", + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_HISTORY_INDEX_MAX_AGE = Setting.positiveTimeSetting( - "opendistro.alerting.alert_history_max_age", - TimeValue(30, TimeUnit.DAYS), + "plugins.alerting.alert_history_max_age", + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_HISTORY_MAX_DOCS = Setting.longSetting( - "opendistro.alerting.alert_history_max_docs", - 1000L, - 0L, + "plugins.alerting.alert_history_max_docs", + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_MAX_DOCS, Setting.Property.NodeScope, Setting.Property.Dynamic ) val ALERT_HISTORY_RETENTION_PERIOD = Setting.positiveTimeSetting( - "opendistro.alerting.alert_history_retention_period", - TimeValue(60, TimeUnit.DAYS), + "plugins.alerting.alert_history_retention_period", + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_RETENTION_PERIOD, Setting.Property.NodeScope, Setting.Property.Dynamic ) val REQUEST_TIMEOUT = Setting.positiveTimeSetting( - "opendistro.alerting.request_timeout", - TimeValue.timeValueSeconds(10), + "plugins.alerting.request_timeout", + LegacyOpenDistroAlertingSettings.REQUEST_TIMEOUT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val MAX_ACTION_THROTTLE_VALUE = Setting.positiveTimeSetting( - "opendistro.alerting.action_throttle_max_value", - TimeValue.timeValueHours(24), + "plugins.alerting.action_throttle_max_value", + LegacyOpenDistroAlertingSettings.MAX_ACTION_THROTTLE_VALUE, Setting.Property.NodeScope, Setting.Property.Dynamic ) val FILTER_BY_BACKEND_ROLES = Setting.boolSetting( - "opendistro.alerting.filter_by_backend_roles", - false, + "plugins.alerting.filter_by_backend_roles", + LegacyOpenDistroAlertingSettings.FILTER_BY_BACKEND_ROLES, Setting.Property.NodeScope, Setting.Property.Dynamic ) } diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt index d1f571a92..8533d75b5 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/DestinationSettings.kt @@ -26,7 +26,6 @@ package org.opensearch.alerting.settings -import org.opensearch.alerting.util.DestinationType import org.opensearch.common.settings.SecureSetting import org.opensearch.common.settings.SecureString import org.opensearch.common.settings.Setting @@ -38,17 +37,14 @@ import java.util.function.Function * types require SecureSettings and need additional logic for retrieving and loading them. */ class DestinationSettings { - companion object { - const val DESTINATION_SETTING_PREFIX = "opendistro.alerting.destination." + const val DESTINATION_SETTING_PREFIX = "plugins.alerting.destination." const val EMAIL_DESTINATION_SETTING_PREFIX = DESTINATION_SETTING_PREFIX + "email." - val ALLOW_LIST_ALL = DestinationType.values().toList().map { it.value } - val ALLOW_LIST_NONE = emptyList() val ALLOW_LIST: Setting> = Setting.listSetting( DESTINATION_SETTING_PREFIX + "allow_list", - ALLOW_LIST_ALL, + LegacyOpenDistroDestinationSettings.ALLOW_LIST, Function.identity(), Setting.Property.NodeScope, Setting.Property.Dynamic @@ -58,19 +54,19 @@ class DestinationSettings { EMAIL_DESTINATION_SETTING_PREFIX, "username", // Needed to coerce lambda to Function type for some reason to avoid argument mismatch compile error - Function { key: String -> SecureSetting.secureString(key, null) } + Function { key: String -> SecureSetting.secureString(key, LegacyOpenDistroDestinationSettings.EMAIL_USERNAME) } ) val EMAIL_PASSWORD: Setting.AffixSetting = Setting.affixKeySetting( EMAIL_DESTINATION_SETTING_PREFIX, "password", // Needed to coerce lambda to Function type for some reason to avoid argument mismatch compile error - Function { key: String -> SecureSetting.secureString(key, null) } + Function { key: String -> SecureSetting.secureString(key, LegacyOpenDistroDestinationSettings.EMAIL_PASSWORD) } ) val HOST_DENY_LIST: Setting> = Setting.listSetting( - "opendistro.destination.host.deny_list", - emptyList(), + "plugins.destination.host.deny_list", + LegacyOpenDistroDestinationSettings.HOST_DENY_LIST, Function.identity(), Setting.Property.NodeScope, Setting.Property.Final diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroAlertingSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroAlertingSettings.kt new file mode 100644 index 000000000..d8ba78753 --- /dev/null +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroAlertingSettings.kt @@ -0,0 +1,126 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.alerting.settings + +import org.opensearch.common.settings.Setting +import org.opensearch.common.unit.TimeValue +import java.util.concurrent.TimeUnit + +/** + * Legacy Opendistro settings specific to [AlertingPlugin]. These settings include things like history index max age, request timeout, etc... + */ + +class LegacyOpenDistroAlertingSettings { + + companion object { + + const val MONITOR_MAX_INPUTS = 1 + const val MONITOR_MAX_TRIGGERS = 10 + + val ALERTING_MAX_MONITORS = Setting.intSetting( + "opendistro.alerting.monitor.max_monitors", + 1000, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val INPUT_TIMEOUT = Setting.positiveTimeSetting( + "opendistro.alerting.input_timeout", + TimeValue.timeValueSeconds(30), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val INDEX_TIMEOUT = Setting.positiveTimeSetting( + "opendistro.alerting.index_timeout", + TimeValue.timeValueSeconds(60), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val BULK_TIMEOUT = Setting.positiveTimeSetting( + "opendistro.alerting.bulk_timeout", + TimeValue.timeValueSeconds(120), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_BACKOFF_MILLIS = Setting.positiveTimeSetting( + "opendistro.alerting.alert_backoff_millis", + TimeValue.timeValueMillis(50), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_BACKOFF_COUNT = Setting.intSetting( + "opendistro.alerting.alert_backoff_count", + 2, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val MOVE_ALERTS_BACKOFF_MILLIS = Setting.positiveTimeSetting( + "opendistro.alerting.move_alerts_backoff_millis", + TimeValue.timeValueMillis(250), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val MOVE_ALERTS_BACKOFF_COUNT = Setting.intSetting( + "opendistro.alerting.move_alerts_backoff_count", + 3, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_HISTORY_ENABLED = Setting.boolSetting( + "opendistro.alerting.alert_history_enabled", + true, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_HISTORY_ROLLOVER_PERIOD = Setting.positiveTimeSetting( + "opendistro.alerting.alert_history_rollover_period", + TimeValue.timeValueHours(12), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_HISTORY_INDEX_MAX_AGE = Setting.positiveTimeSetting( + "opendistro.alerting.alert_history_max_age", + TimeValue(30, TimeUnit.DAYS), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_HISTORY_MAX_DOCS = Setting.longSetting( + "opendistro.alerting.alert_history_max_docs", + 1000L, + 0L, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val ALERT_HISTORY_RETENTION_PERIOD = Setting.positiveTimeSetting( + "opendistro.alerting.alert_history_retention_period", + TimeValue(60, TimeUnit.DAYS), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val REQUEST_TIMEOUT = Setting.positiveTimeSetting( + "opendistro.alerting.request_timeout", + TimeValue.timeValueSeconds(10), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val MAX_ACTION_THROTTLE_VALUE = Setting.positiveTimeSetting( + "opendistro.alerting.action_throttle_max_value", + TimeValue.timeValueHours(24), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val FILTER_BY_BACKEND_ROLES = Setting.boolSetting( + "opendistro.alerting.filter_by_backend_roles", + false, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + } +} diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt new file mode 100644 index 000000000..2f21284b4 --- /dev/null +++ b/alerting/src/main/kotlin/org/opensearch/alerting/settings/LegacyOpenDistroDestinationSettings.kt @@ -0,0 +1,105 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.alerting.settings + +import org.opensearch.alerting.util.DestinationType +import org.opensearch.common.settings.SecureSetting +import org.opensearch.common.settings.SecureString +import org.opensearch.common.settings.Setting +import org.opensearch.common.settings.Settings +import java.util.function.Function + +/** + * Settings specific to Destinations. This class is separated from the general AlertingSettings since some Destination + * types require SecureSettings and need additional logic for retrieving and loading them. + */ +class LegacyOpenDistroDestinationSettings { + + companion object { + + const val DESTINATION_SETTING_PREFIX = "opendistro.alerting.destination." + const val EMAIL_DESTINATION_SETTING_PREFIX = DESTINATION_SETTING_PREFIX + "email." + val ALLOW_LIST_ALL = DestinationType.values().toList().map { it.value } + val ALLOW_LIST_NONE = emptyList() + + val ALLOW_LIST: Setting> = Setting.listSetting( + DESTINATION_SETTING_PREFIX + "allow_list", + ALLOW_LIST_ALL, + Function.identity(), + Setting.Property.NodeScope, + Setting.Property.Dynamic, + Setting.Property.Deprecated + ) + + val EMAIL_USERNAME: Setting.AffixSetting = Setting.affixKeySetting( + EMAIL_DESTINATION_SETTING_PREFIX, + "username", + // Needed to coerce lambda to Function type for some reason to avoid argument mismatch compile error + Function { key: String -> SecureSetting.secureString(key, null) } + ) + + val EMAIL_PASSWORD: Setting.AffixSetting = Setting.affixKeySetting( + EMAIL_DESTINATION_SETTING_PREFIX, + "password", + // Needed to coerce lambda to Function type for some reason to avoid argument mismatch compile error + Function { key: String -> SecureSetting.secureString(key, null) } + ) + + val HOST_DENY_LIST: Setting> = Setting.listSetting( + "opendistro.destination.host.deny_list", + emptyList(), + Function.identity(), + Setting.Property.NodeScope, + Setting.Property.Final, + Setting.Property.Deprecated + ) + + fun loadLegacyDestinationSettings(settings: Settings): Map { + // Only loading Email Destination settings for now since those are the only secure settings needed. + // If this logic needs to be expanded to support other Destinations, different groups can be retrieved similar + // to emailAccountNames based on the setting namespace and SecureDestinationSettings should be expanded to support + // these new settings. + val emailAccountNames: Set = settings.getGroups(EMAIL_DESTINATION_SETTING_PREFIX).keys + val emailAccounts: MutableMap = mutableMapOf() + for (emailAccountName in emailAccountNames) { + // Only adding the settings if they exist + getLegacySecureDestinationSettings(settings, emailAccountName)?.let { + emailAccounts[emailAccountName] = it + } + } + + return emailAccounts + } + + private fun getLegacySecureDestinationSettings(settings: Settings, emailAccountName: String): SecureDestinationSettings? { + // Using 'use' to emulate Java's try-with-resources on multiple closeable resources. + // Values are cloned so that we maintain a SecureString, the original SecureStrings will be closed after + // they have left the scope of this function. + return getLegacyEmailSettingValue(settings, emailAccountName, EMAIL_USERNAME)?.use { emailUsername -> + getLegacyEmailSettingValue(settings, emailAccountName, EMAIL_PASSWORD)?.use { emailPassword -> + SecureDestinationSettings(emailUsername = emailUsername.clone(), emailPassword = emailPassword.clone()) + } + } + } + + private fun getLegacyEmailSettingValue( + settings: Settings, + emailAccountName: String, + emailSetting: Setting.AffixSetting + ): T? { + val concreteSetting = emailSetting.getConcreteSettingForNamespace(emailAccountName) + return concreteSetting.get(settings) + } + + data class SecureDestinationSettings(val emailUsername: SecureString, val emailPassword: SecureString) + } +} diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt index 7417bdf44..d17518e2e 100644 --- a/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt @@ -147,7 +147,7 @@ class MonitorRestApiIT : AlertingRestTestCase() { } fun `test creating a monitor with updating action threshold`() { - adminClient().updateSettings("opendistro.alerting.action_throttle_max_value", TimeValue.timeValueHours(1)) + adminClient().updateSettings("plugins.alerting.action_throttle_max_value", TimeValue.timeValueHours(1)) val monitor = randomMonitorWithThrottle(2, ChronoUnit.HOURS) @@ -156,7 +156,7 @@ class MonitorRestApiIT : AlertingRestTestCase() { } catch (e: ResponseException) { assertEquals("Unexpected status", RestStatus.BAD_REQUEST, e.response.restStatus()) } - adminClient().updateSettings("opendistro.alerting.action_throttle_max_value", TimeValue.timeValueHours(24)) + adminClient().updateSettings("plugins.alerting.action_throttle_max_value", TimeValue.timeValueHours(24)) } fun `test creating a monitor with PUT fails`() { diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/settings/AlertingSettingsTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/settings/AlertingSettingsTests.kt new file mode 100644 index 000000000..713bd1345 --- /dev/null +++ b/alerting/src/test/kotlin/org/opensearch/alerting/settings/AlertingSettingsTests.kt @@ -0,0 +1,184 @@ +package org.opensearch.alerting.settings + +import org.junit.Before +import org.opensearch.alerting.AlertingPlugin +import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSettings +import org.opensearch.alerting.core.settings.ScheduledJobSettings +import org.opensearch.common.settings.Settings +import org.opensearch.common.unit.TimeValue +import org.opensearch.test.OpenSearchTestCase +import java.util.concurrent.TimeUnit + +class AlertingSettingsTests : OpenSearchTestCase() { + + private lateinit var plugin: AlertingPlugin + + @Before + fun setup() { + plugin = AlertingPlugin() + } + + fun `test all opendistro settings returned`() { + val settings = plugin.settings + assertTrue( + "Legacy Settings are not returned", + settings.containsAll( + listOf( + LegacyOpenDistroAlertingSettings.ALERTING_MAX_MONITORS, + LegacyOpenDistroAlertingSettings.INPUT_TIMEOUT, + LegacyOpenDistroAlertingSettings.INDEX_TIMEOUT, + LegacyOpenDistroAlertingSettings.BULK_TIMEOUT, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ENABLED, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_MAX_DOCS, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_RETENTION_PERIOD, + LegacyOpenDistroAlertingSettings.REQUEST_TIMEOUT, + LegacyOpenDistroAlertingSettings.MAX_ACTION_THROTTLE_VALUE, + LegacyOpenDistroAlertingSettings.FILTER_BY_BACKEND_ROLES, + LegacyOpenDistroScheduledJobSettings.SWEEP_PERIOD, + LegacyOpenDistroScheduledJobSettings.SWEEP_PAGE_SIZE, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_MILLIS, + LegacyOpenDistroScheduledJobSettings.SWEEPER_ENABLED, + LegacyOpenDistroScheduledJobSettings.REQUEST_TIMEOUT + ) + ) + ) + } + + fun `test all opensearch settings returned`() { + val settings = plugin.settings + assertTrue( + "Opensearch settings not returned", + settings.containsAll( + listOf( + DestinationSettings.ALLOW_LIST, + DestinationSettings.HOST_DENY_LIST, + AlertingSettings.ALERTING_MAX_MONITORS, + AlertingSettings.INPUT_TIMEOUT, + AlertingSettings.INDEX_TIMEOUT, + AlertingSettings.BULK_TIMEOUT, + AlertingSettings.ALERT_BACKOFF_MILLIS, + AlertingSettings.ALERT_BACKOFF_COUNT, + AlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS, + AlertingSettings.MOVE_ALERTS_BACKOFF_COUNT, + AlertingSettings.ALERT_HISTORY_ENABLED, + AlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD, + AlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE, + AlertingSettings.ALERT_HISTORY_MAX_DOCS, + AlertingSettings.ALERT_HISTORY_RETENTION_PERIOD, + AlertingSettings.REQUEST_TIMEOUT, + AlertingSettings.MAX_ACTION_THROTTLE_VALUE, + AlertingSettings.FILTER_BY_BACKEND_ROLES, + ScheduledJobSettings.SWEEP_PERIOD, + ScheduledJobSettings.SWEEP_PAGE_SIZE, + ScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT, + ScheduledJobSettings.SWEEP_BACKOFF_MILLIS, + ScheduledJobSettings.SWEEPER_ENABLED, + ScheduledJobSettings.REQUEST_TIMEOUT + ) + ) + ) + } + + fun `test opendistro settings fallback`() { + assertEquals( + AlertingSettings.MOVE_ALERTS_BACKOFF_COUNT.get(Settings.EMPTY), + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT.get(Settings.EMPTY) + ) + assertEquals( + ScheduledJobSettings.REQUEST_TIMEOUT.get(Settings.EMPTY), + LegacyOpenDistroScheduledJobSettings.REQUEST_TIMEOUT.get(Settings.EMPTY) + ) + } + + fun `test settings get Value`() { + val settings = Settings.builder().put("plugins.alerting.move_alerts_backoff_count", 1).build() + assertEquals(AlertingSettings.MOVE_ALERTS_BACKOFF_COUNT.get(settings), 1) + assertEquals(LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT.get(settings), 3) + val scheduledJobSettings = Settings.builder().put("plugins.scheduled_jobs.enabled", false).build() + assertEquals(ScheduledJobSettings.SWEEPER_ENABLED.get(scheduledJobSettings), false) + assertEquals(LegacyOpenDistroScheduledJobSettings.SWEEPER_ENABLED.get(scheduledJobSettings), true) + } + + fun `test settings get value with legacy Fallback`() { + val settings = Settings.builder() + .put("opendistro.alerting.monitor.max_monitors", 1000) + .put("opendistro.alerting.input_timeout", TimeValue.timeValueSeconds(30)) + .put("opendistro.alerting.index_timeout", TimeValue.timeValueSeconds(60)) + .put("opendistro.alerting.bulk_timeout", TimeValue.timeValueSeconds(120)) + .put("opendistro.alerting.alert_backoff_millis", TimeValue.timeValueMillis(50)) + .put("opendistro.alerting.alert_backoff_count", 2) + .put("opendistro.alerting.move_alerts_backoff_millis", TimeValue.timeValueMillis(250)) + .put("opendistro.alerting.move_alerts_backoff_count", 3) + .put("opendistro.alerting.alert_history_enabled", true) + .put("opendistro.alerting.alert_history_rollover_period", TimeValue.timeValueHours(12)) + .put("opendistro.alerting.alert_history_max_age", TimeValue(30, TimeUnit.DAYS)) + .put("opendistro.alerting.alert_history_max_docs", 1000L) + .put("opendistro.alerting.alert_history_retention_period", TimeValue(60, TimeUnit.DAYS)) + .put("opendistro.alerting.request_timeout", TimeValue.timeValueSeconds(10)) + .put("opendistro.alerting.action_throttle_max_value", TimeValue.timeValueHours(24)) + .put("opendistro.alerting.filter_by_backend_roles", false) + .put("opendistro.scheduled_jobs.enabled", false) + .put("opendistro.scheduled_jobs.request_timeout", TimeValue.timeValueSeconds(10)) + .put("opendistro.scheduled_jobs.sweeper.backoff_millis", TimeValue.timeValueMillis(50)) + .put("opendistro.scheduled_jobs.retry_count", 3) + .put("opendistro.scheduled_jobs.sweeper.period", TimeValue.timeValueMinutes(5)) + .put("opendistro.scheduled_jobs.sweeper.page_size", 100).build() + + assertEquals(AlertingSettings.ALERTING_MAX_MONITORS.get(settings), 1000) + assertEquals(AlertingSettings.INPUT_TIMEOUT.get(settings), TimeValue.timeValueSeconds(30)) + assertEquals(AlertingSettings.INDEX_TIMEOUT.get(settings), TimeValue.timeValueSeconds(60)) + assertEquals(AlertingSettings.BULK_TIMEOUT.get(settings), TimeValue.timeValueSeconds(120)) + assertEquals(AlertingSettings.ALERT_BACKOFF_MILLIS.get(settings), TimeValue.timeValueMillis(50)) + assertEquals(AlertingSettings.ALERT_BACKOFF_COUNT.get(settings), 2) + assertEquals(AlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS.get(settings), TimeValue.timeValueMillis(250)) + assertEquals(AlertingSettings.MOVE_ALERTS_BACKOFF_COUNT.get(settings), 3) + assertEquals(AlertingSettings.ALERT_HISTORY_ENABLED.get(settings), true) + assertEquals(AlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD.get(settings), TimeValue.timeValueHours(12)) + assertEquals(AlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE.get(settings), TimeValue(30, TimeUnit.DAYS)) + assertEquals(AlertingSettings.ALERT_HISTORY_MAX_DOCS.get(settings), 1000L) + assertEquals(AlertingSettings.ALERT_HISTORY_RETENTION_PERIOD.get(settings), TimeValue(60, TimeUnit.DAYS)) + assertEquals(AlertingSettings.REQUEST_TIMEOUT.get(settings), TimeValue.timeValueSeconds(10)) + assertEquals(AlertingSettings.MAX_ACTION_THROTTLE_VALUE.get(settings), TimeValue.timeValueHours(24)) + assertEquals(AlertingSettings.FILTER_BY_BACKEND_ROLES.get(settings), false) + assertEquals(ScheduledJobSettings.SWEEPER_ENABLED.get(settings), false) + assertEquals(ScheduledJobSettings.REQUEST_TIMEOUT.get(settings), TimeValue.timeValueSeconds(10)) + assertEquals(ScheduledJobSettings.SWEEP_BACKOFF_MILLIS.get(settings), TimeValue.timeValueMillis(50)) + assertEquals(ScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT.get(settings), 3) + assertEquals(ScheduledJobSettings.SWEEP_PERIOD.get(settings), TimeValue.timeValueMinutes(5)) + assertEquals(ScheduledJobSettings.SWEEP_PAGE_SIZE.get(settings), 100) + + assertSettingDeprecationsAndWarnings( + arrayOf( + LegacyOpenDistroAlertingSettings.ALERTING_MAX_MONITORS, + LegacyOpenDistroAlertingSettings.INPUT_TIMEOUT, + LegacyOpenDistroAlertingSettings.INDEX_TIMEOUT, + LegacyOpenDistroAlertingSettings.BULK_TIMEOUT, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.ALERT_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_MILLIS, + LegacyOpenDistroAlertingSettings.MOVE_ALERTS_BACKOFF_COUNT, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ENABLED, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_ROLLOVER_PERIOD, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_INDEX_MAX_AGE, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_MAX_DOCS, + LegacyOpenDistroAlertingSettings.ALERT_HISTORY_RETENTION_PERIOD, + LegacyOpenDistroAlertingSettings.REQUEST_TIMEOUT, + LegacyOpenDistroAlertingSettings.MAX_ACTION_THROTTLE_VALUE, + LegacyOpenDistroAlertingSettings.FILTER_BY_BACKEND_ROLES, + LegacyOpenDistroScheduledJobSettings.SWEEPER_ENABLED, + LegacyOpenDistroScheduledJobSettings.REQUEST_TIMEOUT, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_MILLIS, + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT, + LegacyOpenDistroScheduledJobSettings.SWEEP_PAGE_SIZE, + LegacyOpenDistroScheduledJobSettings.SWEEP_PERIOD + ) + ) + } +} diff --git a/alerting/src/test/kotlin/org/opensearch/alerting/settings/DestinationSettingsTests.kt b/alerting/src/test/kotlin/org/opensearch/alerting/settings/DestinationSettingsTests.kt new file mode 100644 index 000000000..0fdec1337 --- /dev/null +++ b/alerting/src/test/kotlin/org/opensearch/alerting/settings/DestinationSettingsTests.kt @@ -0,0 +1,53 @@ +package org.opensearch.alerting.settings + +import org.junit.Before +import org.opensearch.alerting.AlertingPlugin +import org.opensearch.common.settings.Settings +import org.opensearch.test.OpenSearchTestCase + +class DestinationSettingsTests : OpenSearchTestCase() { + private lateinit var plugin: AlertingPlugin + + @Before + fun setup() { + plugin = AlertingPlugin() + } + + fun `test all opendistro destination settings returned`() { + val settings = plugin.settings + assertTrue( + "Legacy Settings are not returned", + settings.containsAll( + listOf( + LegacyOpenDistroDestinationSettings.ALLOW_LIST, + LegacyOpenDistroDestinationSettings.HOST_DENY_LIST + ) + ) + ) + } + + fun `test all opensearch destination settings returned`() { + val settings = plugin.settings + assertTrue( + "Opensearch settings not returned", + settings.containsAll( + listOf( + DestinationSettings.ALLOW_LIST, + DestinationSettings.HOST_DENY_LIST + ) + ) + ) + } + + fun `test opendistro settings fallback`() { + assertEquals( + DestinationSettings.ALLOW_LIST.get(Settings.EMPTY), + LegacyOpenDistroDestinationSettings.ALLOW_LIST.get(Settings.EMPTY) + ) + } + + fun `test settings get Value`() { + val settings = Settings.builder().put("plugins.alerting.destination.allow_list", "1").build() + assertNotNull(DestinationSettings.ALLOW_LIST.get(settings)) + } +} diff --git a/build.gradle b/build.gradle index 875c1b73e..c7d077699 100644 --- a/build.gradle +++ b/build.gradle @@ -45,6 +45,7 @@ buildscript { } } + plugins { id 'nebula.ospackage' version "8.3.0" apply false id "com.dorongold.task-tree" version "1.5" diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/settings/LegacyOpenDistroScheduledJobSettings.kt b/core/src/main/kotlin/org/opensearch/alerting/core/settings/LegacyOpenDistroScheduledJobSettings.kt new file mode 100644 index 000000000..3a37ff97f --- /dev/null +++ b/core/src/main/kotlin/org/opensearch/alerting/core/settings/LegacyOpenDistroScheduledJobSettings.kt @@ -0,0 +1,49 @@ +package org.opensearch.alerting.core.settings + +import org.opensearch.common.settings.Setting +import org.opensearch.common.unit.TimeValue + +/** + * Legacy Opendistro settings used for [ScheduledJob]'s. These include back off settings, retry counts, timeouts etc... + */ + +class LegacyOpenDistroScheduledJobSettings { + + companion object { + val SWEEPER_ENABLED = Setting.boolSetting( + "opendistro.scheduled_jobs.enabled", + true, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val REQUEST_TIMEOUT = Setting.positiveTimeSetting( + "opendistro.scheduled_jobs.request_timeout", + TimeValue.timeValueSeconds(10), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val SWEEP_BACKOFF_MILLIS = Setting.positiveTimeSetting( + "opendistro.scheduled_jobs.sweeper.backoff_millis", + TimeValue.timeValueMillis(50), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val SWEEP_BACKOFF_RETRY_COUNT = Setting.intSetting( + "opendistro.scheduled_jobs.retry_count", + 3, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val SWEEP_PERIOD = Setting.positiveTimeSetting( + "opendistro.scheduled_jobs.sweeper.period", + TimeValue.timeValueMinutes(5), + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + + val SWEEP_PAGE_SIZE = Setting.intSetting( + "opendistro.scheduled_jobs.sweeper.page_size", + 100, + Setting.Property.NodeScope, Setting.Property.Dynamic, Setting.Property.Deprecated + ) + } +} diff --git a/core/src/main/kotlin/org/opensearch/alerting/core/settings/ScheduledJobSettings.kt b/core/src/main/kotlin/org/opensearch/alerting/core/settings/ScheduledJobSettings.kt index 94a199818..4ae1cf25f 100644 --- a/core/src/main/kotlin/org/opensearch/alerting/core/settings/ScheduledJobSettings.kt +++ b/core/src/main/kotlin/org/opensearch/alerting/core/settings/ScheduledJobSettings.kt @@ -28,7 +28,6 @@ package org.opensearch.alerting.core.settings import org.opensearch.alerting.core.model.ScheduledJob import org.opensearch.common.settings.Setting -import org.opensearch.common.unit.TimeValue /** * settings used for [ScheduledJob]'s. These include back off settings, retry counts, timeouts etc... @@ -37,37 +36,37 @@ class ScheduledJobSettings { companion object { val SWEEPER_ENABLED = Setting.boolSetting( - "opendistro.scheduled_jobs.enabled", - true, + "plugins.scheduled_jobs.enabled", + LegacyOpenDistroScheduledJobSettings.SWEEPER_ENABLED, Setting.Property.NodeScope, Setting.Property.Dynamic ) val REQUEST_TIMEOUT = Setting.positiveTimeSetting( - "opendistro.scheduled_jobs.request_timeout", - TimeValue.timeValueSeconds(10), + "plugins.scheduled_jobs.request_timeout", + LegacyOpenDistroScheduledJobSettings.REQUEST_TIMEOUT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val SWEEP_BACKOFF_MILLIS = Setting.positiveTimeSetting( - "opendistro.scheduled_jobs.sweeper.backoff_millis", - TimeValue.timeValueMillis(50), + "plugins.scheduled_jobs.sweeper.backoff_millis", + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_MILLIS, Setting.Property.NodeScope, Setting.Property.Dynamic ) val SWEEP_BACKOFF_RETRY_COUNT = Setting.intSetting( - "opendistro.scheduled_jobs.retry_count", - 3, + "plugins.scheduled_jobs.retry_count", + LegacyOpenDistroScheduledJobSettings.SWEEP_BACKOFF_RETRY_COUNT, Setting.Property.NodeScope, Setting.Property.Dynamic ) val SWEEP_PERIOD = Setting.positiveTimeSetting( - "opendistro.scheduled_jobs.sweeper.period", - TimeValue.timeValueMinutes(5), + "plugins.scheduled_jobs.sweeper.period", + LegacyOpenDistroScheduledJobSettings.SWEEP_PERIOD, Setting.Property.NodeScope, Setting.Property.Dynamic ) val SWEEP_PAGE_SIZE = Setting.intSetting( - "opendistro.scheduled_jobs.sweeper.page_size", - 100, + "plugins.scheduled_jobs.sweeper.page_size", + LegacyOpenDistroScheduledJobSettings.SWEEP_PAGE_SIZE, Setting.Property.NodeScope, Setting.Property.Dynamic ) } diff --git a/notification/build.gradle b/notification/build.gradle index 6d2ed60c4..5fb42ccaf 100644 --- a/notification/build.gradle +++ b/notification/build.gradle @@ -33,7 +33,7 @@ apply plugin: 'signing' dependencies { compileOnly "org.opensearch:opensearch:${opensearch_version}" compile "org.apache.httpcomponents:httpcore:4.4.5" - compile "org.apache.httpcomponents:httpclient:4.5.10" + compile "org.apache.httpcomponents:httpclient:4.5.13" compile "com.sun.mail:javax.mail:1.6.2" testImplementation "org.opensearch.test:framework:${opensearch_version}" diff --git a/settings.gradle b/settings.gradle index 3520c95f3..dee4094a3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,7 +9,7 @@ * GitHub history for details. */ -rootProject.name = 'opendistro-for-elasticsearch-alerting' +rootProject.name = 'opensearch-alerting' include 'alerting' include 'core' include 'notification'