Skip to content

Commit

Permalink
[Security] Bumping ktlint to 0.47.1 (#960)
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <[email protected]>
  • Loading branch information
sejli authored Feb 8, 2024
1 parent 36f06b9 commit 95de908
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ configurations.all {
force "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4"
force "org.yaml:snakeyaml:2.0"
force "org.slf4j:slf4j-api:2.0.7"
force "ch.qos.logback:logback-classic:1.3.14"
force "ch.qos.logback:logback-core:1.3.14"
}
}

Expand Down Expand Up @@ -198,7 +201,7 @@ dependencies {
testImplementation "org.mockito:mockito-junit-jupiter:${versions.mockito}"
testImplementation 'com.google.code.gson:gson:2.8.9'

ktlint "com.pinterest:ktlint:0.45.1"
ktlint "com.pinterest:ktlint:0.47.1"
}

javadoc.enabled = false // turn off javadoc as it barfs on Kotlin code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ internal class OnDemandReportRestHandler : PluginBaseHandler() {
client.execute(
OnDemandReportCreateAction.ACTION_TYPE,
OnDemandReportCreateRequest.parse(
request.contentParserNextToken(), request.param(REPORT_DEFINITION_ID_FIELD)
request.contentParserNextToken(),
request.param(REPORT_DEFINITION_ID_FIELD)
),
RestResponseToXContentListener(it)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,31 @@ internal object PluginSettings {
OPERATION_TIMEOUT_MS_KEY,
defaultSettings[OPERATION_TIMEOUT_MS_KEY]!!.toLong(),
MINIMUM_OPERATION_TIMEOUT_MS,
NodeScope, Dynamic
NodeScope,
Dynamic
)

private val DEFAULT_ITEMS_QUERY_COUNT: Setting<Int> = Setting.intSetting(
DEFAULT_ITEMS_QUERY_COUNT_KEY,
defaultSettings[DEFAULT_ITEMS_QUERY_COUNT_KEY]!!.toInt(),
MINIMUM_ITEMS_QUERY_COUNT,
NodeScope, Dynamic
NodeScope,
Dynamic
)

private val LEGACY_FILTER_BY_BACKEND_ROLES: Setting<Boolean> = Setting.boolSetting(
LEGACY_FILTER_BY_BACKEND_ROLES_KEY,
false,
NodeScope, Dynamic, Setting.Property.Deprecated
NodeScope,
Dynamic,
Setting.Property.Deprecated
)

private val FILTER_BY_BACKEND_ROLES: Setting<Boolean> = Setting.boolSetting(
FILTER_BY_BACKEND_ROLES_KEY,
LEGACY_FILTER_BY_BACKEND_ROLES,
NodeScope, Dynamic
NodeScope,
Dynamic
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() {
val response = client().performRequest(Request("GET", "/_cat/indices?format=json&expand_wildcards=all"))
val xContentType = MediaType.fromMediaType(response.entity.contentType)
xContentType.xContent().createParser(
NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
response.entity.content
).use { parser ->
for (index in parser.list()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ class ReportInstanceIT : PluginRestTestCase() {
Assert.assertEquals(totalHits, 2)
val reportInstanceList = listReportInstancesResponse.get("reportInstanceList").asJsonArray
Assert.assertEquals(
reportInstanceId, reportInstanceList[0].asJsonObject.get("id").asString
reportInstanceId,
reportInstanceList[0].asJsonObject.get("id").asString
)
Assert.assertEquals(
newReportInstanceId, reportInstanceList[1].asJsonObject.get("id").asString
newReportInstanceId,
reportInstanceList[1].asJsonObject.get("id").asString
)
}

Expand Down Expand Up @@ -514,10 +516,12 @@ class ReportInstanceIT : PluginRestTestCase() {
Assert.assertEquals(totalHits, 2)
val reportInstanceList = listReportInstancesResponse.get("reportInstanceList").asJsonArray
Assert.assertEquals(
reportInstanceId, reportInstanceList[0].asJsonObject.get("id").asString
reportInstanceId,
reportInstanceList[0].asJsonObject.get("id").asString
)
Assert.assertEquals(
newReportInstanceId, reportInstanceList[1].asJsonObject.get("id").asString
newReportInstanceId,
reportInstanceList[1].asJsonObject.get("id").asString
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.opensearch.reportsscheduler.getJsonString
internal class GetAllReportInstancesResponseTests {

private fun createReportInstanceSearchResults(): ReportInstanceSearchResults {

return ReportInstanceSearchResults(
startIndex = 0,
totalHits = 100,
Expand Down

0 comments on commit 95de908

Please sign in to comment.