Skip to content

Commit

Permalink
bumping ktlint, running linter to resolve breaking changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Li <lnse@amazon.com>
  • Loading branch information
sejli committed Feb 7, 2024
1 parent 36f06b9 commit d0e2184
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ 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"
}
}

Expand Down Expand Up @@ -198,7 +199,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 d0e2184

Please sign in to comment.