opensearch-project / alerting

📟 Get notified when your data meets certain conditions by setting up monitors, alerts, and notifications
https://opensearch.org/docs/latest/monitoring-plugins/alerting/index/
Apache License 2.0
58 stars 99 forks source link

Added input validation, and fixed bug for cross cluster monitors. #1510

Closed AWSHurneyt closed 2 months ago

AWSHurneyt commented 2 months ago

Issue #, if available:

Description of changes:

  1. Added input validation for GetRemoteIndexes API, and added related unit and integration tests.
  2. Fixed issue where InputService wouldn't wait for cluster metrics monitor to finish executing against all clusters.

Related PRs

https://github.com/opensearch-project/common-utils/pull/633 https://github.com/opensearch-project/alerting-dashboards-plugin/pull/933

CheckList:

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.

AWSHurneyt commented 2 months ago

Security tests are failing for unrelated reasons. E.g., https://github.com/opensearch-project/alerting/actions/runs/8549717854/job/23425483546?pr=1503

AWSHurneyt commented 2 months ago

The regexes used in this PR have been moved to common utils in PR https://github.com/opensearch-project/common-utils/pull/633.

The tests in this PR will continue to fail until that PR is merged; however, the tests passed before the regexes were moved. https://github.com/opensearch-project/alerting/pull/1510/checks?check_run_id=23722927270

As mentioned above, the security tests are failing due to a pre-existing problem, and will be fixed in a separate PR.

opensearch-trigger-bot[bot] commented 2 months ago

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.x
# Create a new branch
git switch --create backport-1510-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 71d03648b8d39f15f64922cb3b3ff9e18d16ed35
# Push it to GitHub
git push --set-upstream origin backport-1510-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport-1510-to-2.x.

opensearch-trigger-bot[bot] commented 2 months ago

The backport to 2.12 failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.12 2.12
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.12
# Create a new branch
git switch --create backport-1510-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 71d03648b8d39f15f64922cb3b3ff9e18d16ed35
# Push it to GitHub
git push --set-upstream origin backport-1510-to-2.12
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.12

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

opensearch-trigger-bot[bot] commented 2 months ago

The backport to 2.13 failed:

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

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.13 2.13
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.13
# Create a new branch
git switch --create backport-1510-to-2.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 71d03648b8d39f15f64922cb3b3ff9e18d16ed35
# Push it to GitHub
git push --set-upstream origin backport-1510-to-2.13
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.13

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