Skip to content

Commit

Permalink
Update ktlint and force common-codec version (#575)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Agrawal <[email protected]>

Signed-off-by: Ashish Agrawal <[email protected]>
  • Loading branch information
lezzago authored Sep 29, 2022
1 parent 8f2ce35 commit 2494d5f
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data class BucketLevelTriggerRunResult(
override fun writeTo(out: StreamOutput) {
super.writeTo(out)
out.writeMap(aggregationResultBuckets, StreamOutput::writeString) {
valueOut: StreamOutput, aggResultBucket: AggregationResultBucket ->
valueOut: StreamOutput, aggResultBucket: AggregationResultBucket ->
aggResultBucket.writeTo(valueOut)
}
out.writeMap(actionResultsMap as Map<String, Any>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RestGetAlertsAction : BaseRestHandler() {

val getAlertsRequest = GetAlertsRequest(table, severityLevel, alertState, monitorId)
return RestChannelConsumer {
channel ->
channel ->
client.execute(GetAlertsAction.INSTANCE, getAlertsRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class RestGetDestinationsAction : BaseRestHandler() {
destinationType
)
return RestChannelConsumer {
channel ->
channel ->
client.execute(GetDestinationsAction.INSTANCE, getDestinationsRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class RestGetMonitorAction : BaseRestHandler() {
}
val getMonitorRequest = GetMonitorRequest(monitorId, RestActions.parseVersion(request), request.method(), srcContext)
return RestChannelConsumer {
channel ->
channel ->
client.execute(GetMonitorAction.INSTANCE, getMonitorRequest, RestToXContentListener(channel))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class RestIndexDestinationAction : BaseRestHandler() {
}
val indexDestinationRequest = IndexDestinationRequest(id, seqNo, primaryTerm, refreshPolicy, request.method(), destination)
return RestChannelConsumer {
channel ->
channel ->
client.execute(
IndexDestinationAction.INSTANCE, indexDestinationRequest,
indexDestinationResponse(channel, request.method())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class TransportIndexDestinationAction @Inject constructor(
var failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
entry ->
failureReasons.append(entry.reason())
}
return failureReasons.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class TransportIndexEmailAccountAction @Inject constructor(
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
entry ->
failureReasons.append(entry.reason())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class TransportIndexEmailGroupAction @Inject constructor(
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
entry ->
failureReasons.append(entry.reason())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class TransportIndexMonitorAction @Inject constructor(
val failureReasons = StringBuilder()
if (response.shardInfo.failed > 0) {
response.shardInfo.failures.forEach {
entry ->
entry ->
failureReasons.append(entry.reason())
}
return failureReasons.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
_, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
assertEquals(monitor.name, output["monitor_name"])
Expand Down Expand Up @@ -1037,7 +1037,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
_, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
assertEquals(monitor.name, output["monitor_name"])
Expand All @@ -1064,7 +1064,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
_, v ->
assertTrue((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
@Suppress("UNCHECKED_CAST")
Expand Down Expand Up @@ -1093,7 +1093,7 @@ class MonitorRunnerIT : AlertingRestTestCase() {
val output = entityAsMap(response)
@Suppress("UNCHECKED_CAST")
(output["trigger_results"] as HashMap<String, Any>).forEach {
_, v ->
_, v ->
assertFalse((v as HashMap<String, Boolean>)["triggered"] as Boolean)
}
@Suppress("UNCHECKED_CAST")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ configurations {
}

dependencies {
add("ktlint", "com.pinterest:ktlint:0.41.0") {
add("ktlint", "com.pinterest:ktlint:0.45.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL))
}
Expand Down
7 changes: 7 additions & 0 deletions notification/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'

configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "commons-codec:commons-codec:1.13"
}
}

dependencies {
compileOnly "org.opensearch:opensearch:${opensearch_version}"
compile "org.apache.httpcomponents:httpcore:4.4.5"
Expand Down

0 comments on commit 2494d5f

Please sign in to comment.