Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed search monitor API to return alert counts. #978

Conversation

AWSHurneyt
Copy link
Collaborator

Issue #, if available:

Description of changes:

  1. Fixed a bug in the search monitor API when which prevent alert counts from being returned.
  2. Implemented integ test for frontend use case.

CheckList:

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
@AWSHurneyt
Copy link
Collaborator Author

The main branch may not be stable enough for test workflows to execute as expected in PRs. This dummy PR runs the tests against the 2.8 branch to demonstrate that they succeed AWSHurneyt#11

@@ -52,7 +53,13 @@ class TransportSearchMonitorAction @Inject constructor(
val searchSourceBuilder = searchMonitorRequest.searchRequest.source()
val queryBuilder = if (searchSourceBuilder.query() == null) BoolQueryBuilder()
else QueryBuilders.boolQuery().must(searchSourceBuilder.query())
queryBuilder.filter(QueryBuilders.existsQuery(Monitor.MONITOR_TYPE))

if (searchMonitorRequest.searchRequest.indices().size == 1 &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is confusing.. can we add a comment or simplify this check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment and simplified the check.

@AWSHurneyt AWSHurneyt changed the title Fixed a bug in the search monitor API when which prevent alert counts from being returned. Fixed search monitor API to return alert counts. Jul 6, 2023
@eirsep
Copy link
Member

eirsep commented Jul 6, 2023

can you just run the gradle integTests task for the new test alone and paste the output here?

Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
@AWSHurneyt
Copy link
Collaborator Author

can you just run the gradle integTests task for the new test alone and paste the output here?

@eirsep The build is currently failing on main, but I cherry-picked these changes to a 2.8 branch, and ran the test there.

./gradlew :alerting:integTest -Dtests.method="**test get acknowledged, active, error, and ignored alerts counts"

Starting a Gradle Daemon (subsequent builds will be faster)
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 7.6.1
  OS Info               : Linux 5.4.242-166.350.amzn2int.x86_64 (amd64)
  JDK Version           : 14 (Oracle JDK)
  JAVA_HOME             : /local/home/hurneyt/jdk-14.0.2
  Random Testing Seed   : 11F070E153433A3C
  In FIPS 140 mode      : false
=======================================

> Task :alerting-core:compileKotlin
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt: (11, 44): 'BaseNodeRequest' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/core/src/main/kotlin/org/opensearch/alerting/core/action/node/ScheduledJobsStatsTransportAction.kt: (119, 39): 'BaseNodeRequest' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt: (42, 27): 'convertToMap(BytesReference!, Boolean, XContentType!): Tuple<XContentType!, (Mutable)Map<String!, Any!>!>!' is deprecated. Deprecated in Java

> Task :alerting:compileKotlin
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (221, 101): Unnecessary safe call on a non-null receiver of type AlertError. This expression will have nullable type in future releases
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (339, 13): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (340, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (341, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (393, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (399, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (400, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (430, 111): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (455, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (512, 99): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt: (63, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (74, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (110, 60): Unchecked cast: MutableMap<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (265, 49): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (532, 59): Unnecessary non-null assertion (!!) on a non-null receiver of type ClusterService
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (694, 57): Unchecked cast: Any to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt: (176, 76): Unchecked cast: Map<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt: (29, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (225, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (233, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (280, 60): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (282, 43): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt: (34, 51): No cast needed
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (41, 51): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (51, 48): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (61, 86): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (102, 94): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt: (63, 20): '@JvmOverloads' annotation has no effect for methods without default arguments
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (87, 69): Unchecked cast: Any? to List<String>?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (93, 9): Non exhaustive 'when' statements on enum will be prohibited in 1.7, add 'CLUSTER_METRICS_MONITOR' branch or 'else' branch instead
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (131, 13): Condition 'monitor.dataSources != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (117, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (129, 25): Variable 'response' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (172, 29): Variable 'deleteMonitorWorkflowMetadataResponse' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (322, 17): Variable 'deleteResponse' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt: (570, 37): The expression is unused
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (169, 38): Unchecked cast: Any to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (176, 80): Unchecked cast: Any to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (180, 65): Unchecked cast: Any? to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (213, 16): Unnecessary safe call on a non-null receiver of type List<String>. This expression will have nullable type in future releases
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (219, 29): Unchecked cast: Any? to MutableMap<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (325, 37): Variable 'updateMappingResponse' initializer is redundant
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (344, 25): Name shadowed: updateMappingRequest
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (353, 25): Name shadowed: unwrappedException
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (366, 21): Name shadowed: unwrappedException
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (396, 17): Variable 'updateSettingsResponse' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt: (77, 45): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt: (145, 17): Condition 'delegateRunResult != null' is always 'true'

> Task :alerting:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :alerting:compileTestKotlin
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (547, 52): Unchecked cast: Any? to Map<String, Any>
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (188, 13): Variable 'testDoc' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (523, 13): Variable 'searchResult' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (562, 13): Variable 'searchResult' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (615, 13): Variable 'searchResult' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (676, 13): Variable 'searchResult' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (697, 13): Variable 'testDoc' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (747, 13): Variable 'testDoc' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (72, 8): This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (348, 13): Variable 'mappingsResp' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (938, 38): Variable 'executeMonitorResponse' initializer is redundant
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1027, 13): Variable 'clusterStateResponse' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1356, 13): Condition 'updateMonitorResponse != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1357, 13): The value 'executeMonitor(updateMonitorResponse.monitor, monitorId, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute pre-existing monitor and update`' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1824, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1842, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1850, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1943, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1959, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1967, 27): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2011, 36): Unnecessary safe call on a non-null receiver of type IndexMonitorResponse?. This expression will have nullable type in future releases
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2049, 9): The value 'monitorResponse!!.monitor' assigned to 'var monitor: Monitor defined in org.opensearch.alerting.MonitorDataSourcesIT.`test queryIndex gets increased max fields in mappings`' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2094, 31): Condition 'alerts != null' is always 'true'
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (105, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (165, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (186, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (229, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (273, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (321, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (842, 13): Variable 'alert' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (929, 17): Name shadowed: alerts
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (91, 9): The expression is unused
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (196, 13): Variable 'foundAlias' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (207, 13): Variable 'foundAlias' is never used

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1m 26s
16 actionable tasks: 16 executed

@AWSHurneyt
Copy link
Collaborator Author

In addition, ./gradlew build succeeds on the 2.8 branch.

./gradlew build
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 7.6.1
  OS Info               : Linux 5.4.242-166.350.amzn2int.x86_64 (amd64)
  JDK Version           : 14 (Oracle JDK)
  JAVA_HOME             : /local/home/hurneyt/jdk-14.0.2
  Random Testing Seed   : 240445B6EADA9380
  In FIPS 140 mode      : false
=======================================

> Task :alerting:compileTestKotlin
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (843, 13): Variable 'alert' is never used
w: /local/home/hurneyt/workplace/OpenSearch-Alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (930, 17): Name shadowed: alerts

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 9m 57s
45 actionable tasks: 30 executed, 15 up-to-date

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.4 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.4 2.4
# Navigate to the new working tree
cd .worktrees/backport-2.4
# Create a new branch
git switch --create backport/backport-978-to-2.4
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 641d17b2ee0ec5a5fda5b2a68fc01809e9e759c2
# Push it to GitHub
git push --set-upstream origin backport/backport-978-to-2.4
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.4

Then, create a pull request where the base branch is 2.4 and the compare/head branch is backport/backport-978-to-2.4.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2023
* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 641d17b)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.5 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-978-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 641d17b2ee0ec5a5fda5b2a68fc01809e9e759c2
# Push it to GitHub
git push --set-upstream origin backport/backport-978-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5

Then, create a pull request where the base branch is 2.5 and the compare/head branch is backport/backport-978-to-2.5.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.6 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.6 2.6
# Navigate to the new working tree
cd .worktrees/backport-2.6
# Create a new branch
git switch --create backport/backport-978-to-2.6
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 641d17b2ee0ec5a5fda5b2a68fc01809e9e759c2
# Push it to GitHub
git push --set-upstream origin backport/backport-978-to-2.6
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.6

Then, create a pull request where the base branch is 2.6 and the compare/head branch is backport/backport-978-to-2.6.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2023
* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 641d17b)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2023
* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 641d17b)
AWSHurneyt added a commit to AWSHurneyt/OpenSearch-Alerting that referenced this pull request Jul 11, 2023
)

* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
AWSHurneyt added a commit that referenced this pull request Jul 11, 2023
* Fixed search monitor API to return alert counts. (#978)

* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed string entity call.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
lezzago pushed a commit that referenced this pull request Aug 2, 2023
* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 641d17b)

Co-authored-by: AWSHurneyt <[email protected]>
lezzago pushed a commit that referenced this pull request Aug 2, 2023
* Fixed a bug in the search monitor API when which prevent alert counts from being returned.

Signed-off-by: AWSHurneyt <[email protected]>

* Implemented integration test for frontend use case.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Removed redundant code.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed ktlint errors.

Signed-off-by: AWSHurneyt <[email protected]>

* Added back check for null query.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 641d17b)

Co-authored-by: AWSHurneyt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants