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

Updating Kotlin version #1052

Merged
merged 7 commits into from
Sep 30, 2022
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: 3 additions & 2 deletions opensearch-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
// 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT
opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2')
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
kotlin_version = System.getProperty("kotlin.version", "1.6.0")
}

repositories {
Expand All @@ -28,7 +28,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0"
classpath "org.jacoco:org.jacoco.agent:0.8.5"
classpath "org.jacoco:org.jacoco.agent:0.8.7"
}
}

Expand Down Expand Up @@ -117,6 +117,7 @@ allprojects {
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
jacoco.toolVersion = "0.8.7"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ package org.opensearch.observability.settings
import org.apache.logging.log4j.LogManager
import org.opensearch.bootstrap.BootstrapInfo
import org.opensearch.cluster.service.ClusterService
import org.opensearch.common.io.PathUtils
import org.opensearch.common.settings.Setting
import org.opensearch.common.settings.Setting.Property.Dynamic
import org.opensearch.common.settings.Setting.Property.NodeScope
import org.opensearch.common.settings.Settings
import org.opensearch.observability.ObservabilityPlugin.Companion.LOG_PREFIX
import org.opensearch.observability.ObservabilityPlugin.Companion.PLUGIN_NAME
import java.io.IOException
import java.nio.file.Paths

/**
* settings specific to observability Plugin.
Expand Down Expand Up @@ -246,7 +246,7 @@ internal object PluginSettings {
var settings: Settings? = null
val configDirName = BootstrapInfo.getSystemProperties()?.get("opensearch.path.conf")?.toString()
if (configDirName != null) {
val defaultSettingYmlFile = Paths.get(configDirName, PLUGIN_NAME, "observability.yml")
val defaultSettingYmlFile = PathUtils.get(configDirName, PLUGIN_NAME, "observability.yml")
try {
settings = Settings.builder().loadFromPath(defaultSettingYmlFile).build()
} catch (exception: IOException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.opensearch.client.Response
import org.opensearch.client.ResponseException
import org.opensearch.client.RestClient
import org.opensearch.client.RestClientBuilder
import org.opensearch.common.io.PathUtils
import org.opensearch.common.settings.Settings
import org.opensearch.common.unit.TimeValue
import org.opensearch.common.util.concurrent.ThreadContext
Expand All @@ -38,7 +39,6 @@ import java.io.IOException
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.Paths
import java.security.cert.X509Certificate
import javax.management.MBeanServerInvocationHandler
import javax.management.ObjectName
Expand Down Expand Up @@ -263,7 +263,7 @@ abstract class PluginRestTestCase : OpenSearchRestTestCase() {
false
)
proxy.getExecutionData(false)?.let {
val path = Paths.get("$jacocoBuildPath/integTest.exec")
val path = PathUtils.get("$jacocoBuildPath/integTest.exec")
Files.write(path, it)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import org.opensearch.observability.PluginRestTestCase
import org.opensearch.observability.constructNotebookRequest
import org.opensearch.rest.RestRequest
import org.opensearch.rest.RestStatus
import java.util.List
import java.util.Map

class TABackwardCompatibilityIT : PluginRestTestCase() {

Expand Down Expand Up @@ -61,14 +59,14 @@ class TABackwardCompatibilityIT : PluginRestTestCase() {
}

@Throws(Exception::class)
@SuppressWarnings("unchecked")
@SuppressWarnings("UNCHECKED_CAST")
fun `test backwards compatibility`() {
val uri = getUri()
val responseMap = getAsMap(uri)["nodes"] as Map<String, Map<String, Any>>
for (response in responseMap.values()) {
for (response in responseMap.values) {
val plugins = response["plugins"] as List<Map<String, Any>>
val pluginNames = plugins.map { plugin -> plugin["name"] }.toSet()
return when (CLUSTER_TYPE) {
when (CLUSTER_TYPE) {
ClusterType.OLD -> {
assertTrue(pluginNames.contains("opensearch-notebooks"))
createNotebook()
Expand Down