diff --git a/kork-plugins-tck/src/test/kotlin/com/spinnaker/netflix/kork/plugins/TestPluginGeneratorTest.kt b/kork-plugins-tck/src/test/kotlin/com/spinnaker/netflix/kork/plugins/TestPluginGeneratorTest.kt index 228ae6847..c17b0bef5 100644 --- a/kork-plugins-tck/src/test/kotlin/com/spinnaker/netflix/kork/plugins/TestPluginGeneratorTest.kt +++ b/kork-plugins-tck/src/test/kotlin/com/spinnaker/netflix/kork/plugins/TestPluginGeneratorTest.kt @@ -38,16 +38,6 @@ class TestPluginGeneratorTest : JUnit5Minutests { expectThat(resolve("classes")).describedAs("classes directory").isDirectory() } - test("extensions index is written to META-INF") { - expectThat(resolve("classes/META-INF")).and { - isDirectory() - get { resolve("extensions.idx") }.and { - isRegularFile() - get { toFile().readText() }.isEqualTo("# Generated by PF4J\n") - } - } - } - test("generated class is written to subdirectories matching package") { expectThat(resolve("classes/com/netflix/spinnaker/kork/plugins/testplugin/generated")).and { isDirectory() diff --git a/kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/repository/PluginRefPluginRepository.kt b/kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/repository/PluginRefPluginRepository.kt index 5ff62e71a..4534b3dcb 100644 --- a/kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/repository/PluginRefPluginRepository.kt +++ b/kork-plugins/src/main/kotlin/com/netflix/spinnaker/kork/plugins/repository/PluginRefPluginRepository.kt @@ -26,6 +26,6 @@ import org.pf4j.util.ExtensionFileFilter /** * A [PluginRepository] supporting [PluginRef] type [Plugin]s by matching files with the extension [PluginRef.EXTENSION]. */ -class PluginRefPluginRepository(pluginPath: Path) : BasePluginRepository(pluginPath, ExtensionFileFilter(PluginRef.EXTENSION)) { +class PluginRefPluginRepository(pluginPath: Path) : BasePluginRepository(listOf(pluginPath), ExtensionFileFilter(PluginRef.EXTENSION)) { override fun deletePluginPath(pluginPath: Path?): Boolean = false } diff --git a/kork-retrofit/src/main/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerHttpException.java b/kork-retrofit/src/main/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerHttpException.java index 7a705797f..500e93d30 100644 --- a/kork-retrofit/src/main/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerHttpException.java +++ b/kork-retrofit/src/main/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerHttpException.java @@ -194,8 +194,14 @@ public String getMessage() { return super.getMessage(); } + if (getHttpMethod() == null) { + return String.format( + "Status: %s, URL: %s, Message: %s", responseCode, this.getUrl(), getRawMessage()); + } + return String.format( - "Status: %s, URL: %s, Message: %s", responseCode, this.getUrl(), getRawMessage()); + "Status: %s, Method: %s, URL: %s, Message: %s", + responseCode, getHttpMethod(), this.getUrl(), getRawMessage()); } @Override diff --git a/kork-retrofit/src/test/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerRetrofit2ErrorHandleTest.java b/kork-retrofit/src/test/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerRetrofit2ErrorHandleTest.java index f82efd3a0..bc294dc48 100644 --- a/kork-retrofit/src/test/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerRetrofit2ErrorHandleTest.java +++ b/kork-retrofit/src/test/java/com/netflix/spinnaker/kork/retrofit/exceptions/SpinnakerRetrofit2ErrorHandleTest.java @@ -234,7 +234,8 @@ void testNonJsonHttpErrorResponse() { assertThat(spinnakerHttpException.getResponseBody()).isNull(); assertThat(spinnakerHttpException.getResponseCode()).isEqualTo(responseCode); assertThat(spinnakerHttpException) - .hasMessage("Status: " + responseCode + ", URL: " + url + ", Message: " + reason); + .hasMessage( + "Status: " + responseCode + ", Method: GET, URL: " + url + ", Message: " + reason); assertThat(spinnakerHttpException.getUrl()).isEqualTo(url); assertThat(spinnakerHttpException.getReason()).isEqualTo(reason); } diff --git a/spinnaker-dependencies/spinnaker-dependencies.gradle b/spinnaker-dependencies/spinnaker-dependencies.gradle index d7e265acd..c91d9b69f 100644 --- a/spinnaker-dependencies/spinnaker-dependencies.gradle +++ b/spinnaker-dependencies/spinnaker-dependencies.gradle @@ -81,8 +81,7 @@ dependencies { api("com.google.cloud:google-cloud-secretmanager:2.3.10") api("com.google.code.findbugs:jsr305:3.0.2") api("com.google.guava:guava:30.0-jre") - // JinJava 2.5.3 has a bad bug: https://github.com/HubSpot/jinjava/issues/429 - api("com.hubspot.jinjava:jinjava:2.5.2") + api("com.hubspot.jinjava:jinjava:2.7.1") api("com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0") api("com.jcraft:jsch:${versions.jsch}") api("com.jcraft:jsch.agentproxy.connector-factory:${versions.jschAgentProxy}") @@ -161,7 +160,16 @@ dependencies { } } api("org.objenesis:objenesis:2.5.1") - api("org.pf4j:pf4j:3.2.0") + api("org.pf4j:pf4j:3.10.0") + // pf4j:3.10.0 brings in slf4j-api:2.0.6 which is not compatible with logback 1.2.x. + // And the upgraded logback version(1.3.8) is becoming incompatible with SpringBoot's LogbackLoggingSystem: + // java.lang.NoClassDefFoundError at LogbackLoggingSystem.java:293 + // Hence pinning slf4j-api at 1.7.36 which spring boot 2.5.15 brings in. + api("org.slf4j:slf4j-api"){ + version { + strictly("1.7.36") + } + } api("org.pf4j:pf4j-update:2.3.0") // snakeyaml 1.29 fails to parse yaml (including some k8s manifests), so