-
Notifications
You must be signed in to change notification settings - Fork 79
Conversation
Codecov Report
@@ Coverage Diff @@
## master #260 +/- ##
============================================
+ Coverage 79.34% 80.39% +1.04%
- Complexity 197 199 +2
============================================
Files 138 149 +11
Lines 4522 4810 +288
Branches 614 635 +21
============================================
+ Hits 3588 3867 +279
- Misses 596 597 +1
- Partials 338 346 +8
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added my comments.
@@ -185,6 +185,21 @@ class MonitorRunner( | |||
} | |||
|
|||
suspend fun runMonitor(monitor: Monitor, periodStart: Instant, periodEnd: Instant, dryrun: Boolean = false): MonitorRunResult { | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you picked inject roles changes. Do we need this change for getDest, getAlerts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. I accidentally picked it up
@@ -121,9 +121,9 @@ data class Alert( | |||
|
|||
companion object { | |||
|
|||
const val ALERT_ID_FIELD = "id" | |||
const val ALERT_ID_FIELD = "alert_id" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats the reason behind changing the name from id
to alert_id
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to insert the same string into alert_mapping.json
. In the file, there is monitor_id
and trigger_id
, so I wanted to follow the same format and ensure it is clear what the id
is for.
type = sin.readEnum(DestinationType::class.java), | ||
name = sin.readString(), | ||
user = if (sin.readBoolean()) { | ||
User(sin) | ||
User.readFrom(sin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you over wrote my change ;) . User(sin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I cherry picked changes, it looked like it was changed to User.readFrom(sin)
. Just changed it back
return listOf( | ||
// Get a specific destination | ||
RestHandler.Route(RestRequest.Method.GET, "${AlertingPlugin.DESTINATION_BASE_URI}/{destinationID}"), | ||
RestHandler.Route(RestRequest.Method.GET, "${AlertingPlugin.DESTINATION_BASE_URI}/all") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is all
a standard REST way? Cant we leave GET /destinations/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. Meant to change it to something better later on after testing.
log.debug("${request.method()} ${AlertingPlugin.MONITOR_BASE_URI}/_search") | ||
|
||
val index = request.param("index", SCHEDULED_JOBS_INDEX) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this change is related to GET /destinations GET /alerts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had included it because it was needed for the security changes. I will remove this change since it is already included in ur PR.
@@ -135,7 +135,7 @@ class DestinationTests : ESTestCase() { | |||
} | |||
|
|||
fun `test slack destination create using stream`() { | |||
val chimeDest = Destination("2345", 1L, 2, DestinationType.SLACK, "TestSlackDest", | |||
val chimeDest = Destination("2345", 1L, 2, 1, 1, DestinationType.SLACK, "TestSlackDest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable is a little inaccurate, including the one for "custom webhook" in below test, but looks like it's a change in a past PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pointing that out. I fixed them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 👍
841a942
* Add getDestination(s) rest api * remove security context for GetDestinations api * replaces try-finally with use for all auto-closables * add getAlerts API * minor cleanup to get-alerts * fix sorting and pagination. Also allow searchMonitor to search in other indexes * fix sorting, searching, and filtering * add opendistro to GetDestinations action name * Cleanup code and add unit and integ tests * cleanup some of the read streaminput code * cleanup code more * cleanup tests * fix unit test * remove extra stuff * fix mappings * fix test names Co-authored-by: skkosuri-amzn <[email protected]>
Issue #, if available:
#215
Description of changes:
#215
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.