Skip to content
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

[Backport 2.12] [Security] Bumping ktlint to 0.47.1 #963

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,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 @@ -199,7 +202,7 @@ dependencies {
testImplementation "org.mockito:mockito-junit-jupiter:4.7.0"
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.value)
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
Loading