From 7148adf9637b7abc93c3e192fbde09b549704947 Mon Sep 17 00:00:00 2001 From: Kshitij Tandon Date: Tue, 29 Oct 2024 10:54:05 +0530 Subject: [PATCH] Updating some more versions and resolving some dependency conflicts Signed-off-by: Kshitij Tandon --- build.gradle | 9 ++++++--- detekt.yml | 4 ++++ .../indexstatemanagement/ManagedIndexRunner.kt | 3 +++ .../step/forcemerge/AttemptCallForceMergeStep.kt | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 59a523f48..5ab7defc4 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ buildscript { classpath "org.opensearch.gradle:build-tools:${opensearch_version}" 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.23.3" + classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6" classpath "org.jacoco:org.jacoco.agent:0.8.10" } } @@ -105,6 +105,9 @@ configurations.all { resolutionStrategy { force "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}" force "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}" + force "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}" + force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}" + force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlin_version}" force 'junit:junit:4.13.1' force 'commons-beanutils:commons-beanutils:1.9.4' force 'com.google.guava:guava:30.0-jre' @@ -222,7 +225,7 @@ dependencies { } } configurations.ktlint { - resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22" + resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10" } // https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/ @@ -892,4 +895,4 @@ task updateVersion { // String tokenization to support -SNAPSHOT ant.replaceregexp(file: 'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags: 'g', byline: true) } -} +} \ No newline at end of file diff --git a/detekt.yml b/detekt.yml index 57ab2f3c5..620bd4998 100644 --- a/detekt.yml +++ b/detekt.yml @@ -15,6 +15,10 @@ style: excludes: ['**/test/**'] FunctionOnlyReturningConstant: active: false + UseRequire: + active: false + UnusedPrivateProperty: + active: false complexity: LargeClass: diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt index 003a612ce..890e5008d 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/ManagedIndexRunner.kt @@ -7,6 +7,7 @@ package org.opensearch.indexmanagement.indexstatemanagement import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.SupervisorJob @@ -254,6 +255,7 @@ object ManagedIndexRunner : } } + @OptIn(DelicateCoroutinesApi::class) @Suppress("ReturnCount", "ComplexMethod", "LongMethod", "ComplexCondition", "NestedBlockDepth") private suspend fun runManagedIndexConfig(managedIndexConfig: ManagedIndexConfig, jobContext: JobExecutionContext) { logger.debug("Run job for index ${managedIndexConfig.index}") @@ -640,6 +642,7 @@ object ManagedIndexRunner : * update metadata in config index, and save metadata in history after update * this can be called 2 times in one job run, so need to save seqNo & primeTerm */ + @OptIn(DelicateCoroutinesApi::class) private suspend fun updateManagedIndexMetaData( managedIndexMetaData: ManagedIndexMetaData, lastUpdateResult: UpdateMetadataResult? = null, diff --git a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt index 3ff796e55..e7596842a 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/indexstatemanagement/step/forcemerge/AttemptCallForceMergeStep.kt @@ -6,6 +6,7 @@ package org.opensearch.indexmanagement.indexstatemanagement.step.forcemerge import kotlinx.coroutines.CoroutineName +import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay @@ -30,6 +31,7 @@ class AttemptCallForceMergeStep(private val action: ForceMergeAction) : Step(nam private var stepStatus = StepStatus.STARTING private var info: Map? = null + @OptIn(DelicateCoroutinesApi::class) @Suppress("TooGenericExceptionCaught", "ComplexMethod") override suspend fun execute(): AttemptCallForceMergeStep { val context = this.context ?: return this