-
Notifications
You must be signed in to change notification settings - Fork 96
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
Added validation for the new clusters field. #633
Added validation for the new clusters field. #633
Conversation
…ut validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]>
Whitesource finding will be fixed in a separate PR. |
src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: AWSHurneyt <[email protected]>
src/main/kotlin/org/opensearch/commons/alerting/model/ClusterMetricsInput.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/commons/alerting/util/IndexUtils.kt
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #633 +/- ##
============================================
- Coverage 73.90% 73.73% -0.17%
Complexity 891 891
============================================
Files 133 134 +1
Lines 5870 5910 +40
Branches 717 726 +9
============================================
+ Hits 4338 4358 +20
- Misses 1219 1233 +14
- Partials 313 319 +6 ☔ View full report in Codecov by Sentry. |
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
The backport to
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/common-utils/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.x
# Create a new branch
git switch --create backport-633-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 abc69cdbaf1de6258db430b1d284e7a3e614c83b
# Push it to GitHub
git push --set-upstream origin backport-633-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.x Then, create a pull request where the |
The backport to
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/common-utils/backport-2.12 2.12
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.12
# Create a new branch
git switch --create backport-633-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 abc69cdbaf1de6258db430b1d284e7a3e614c83b
# Push it to GitHub
git push --set-upstream origin backport-633-to-2.12
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.12 Then, create a pull request where the |
The backport to
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/common-utils/backport-2.13 2.13
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.13
# Create a new branch
git switch --create backport-633-to-2.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 abc69cdbaf1de6258db430b1d284e7a3e614c83b
# Push it to GitHub
git push --set-upstream origin backport-633-to-2.13
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.13 Then, create a pull request where the |
* Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]>
* Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]>
* Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]>
) * Added validation for the new clusters field. (#633) * Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> * Removed CommonUtilsException. Team decided IllegalArgumentExceptions should be caught in the plugins themselves. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]>
) * Added validation for the new clusters field. (#633) * Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> * Removed CommonUtilsException. Team decided IllegalArgumentExceptions should be caught in the plugins themselves. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> (cherry picked from commit 4e81d64) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) * Added validation for the new clusters field. (#633) * Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. Signed-off-by: AWSHurneyt <[email protected]> * Moved some regex from alerting plugin to common utils. Signed-off-by: AWSHurneyt <[email protected]> * Moved cluster-based regex to separate file. Signed-off-by: AWSHurneyt <[email protected]> * Fixed ktlint error. Signed-off-by: AWSHurneyt <[email protected]> * Fixed regex. Moved cluster-related regexes. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> * Removed CommonUtilsException. Team decided IllegalArgumentExceptions should be caught in the plugins themselves. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> (cherry picked from commit 4e81d64) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) (#641) * Added validation for the new clusters field. (#633) * Added validation for the clusters field. Refactored ClusterMetricsInput validiation to throw 4xx-level CommonUtilsExceptions instead of 5xx-level IllegalArgumentException. * Moved some regex from alerting plugin to common utils. * Moved cluster-based regex to separate file. * Fixed ktlint error. * Fixed regex. Moved cluster-related regexes. --------- * Removed CommonUtilsException. Team decided IllegalArgumentExceptions should be caught in the plugins themselves. --------- (cherry picked from commit 4e81d64) Signed-off-by: AWSHurneyt <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Issues Resolved
[List any issues this PR will resolve]
Check List
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.