chore(spotless): upgrade spinnaker gradle plugin
This includes updates to google-java-format and ktlint, so requires some
formatting changes. These were made with a simple `./gradlew spotlessApply`.
MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginCache.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginCache.kt
@@ -75,7 +75,8 @@ class DeckPluginCache(
val newCache = releases.mapNotNull { release ->
val plugin = DeckPluginVersion(release.pluginId, release.props.version)
getOrDownload(plugin.id, plugin.version)?.let {
- path -> PluginCacheEntry(plugin, path)
+ path ->
+ PluginCacheEntry(plugin, path)
}
}

MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginConfiguration.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginConfiguration.kt
@@ -41,8 +41,10 @@ class DeckPluginConfiguration {
springStrictPluginLoaderStatusProvider: SpringStrictPluginLoaderStatusProvider,
dynamicConfigService: DynamicConfigService
): DeckPluginCache {
- val springPluginStatusProvider = SpringPluginStatusProvider(dynamicConfigService,
- "spinnaker.extensibility.deck-proxy.plugins")
+ val springPluginStatusProvider = SpringPluginStatusProvider(
+ dynamicConfigService,
+ "spinnaker.extensibility.deck-proxy.plugins"
+ )
val sources = listOf(
LatestPluginInfoReleaseSource(updateManager, "deck"),
@@ -55,7 +57,8 @@ class DeckPluginConfiguration {
springPluginStatusProvider,
AggregatePluginInfoReleaseProvider(sources, springStrictPluginLoaderStatusProvider),
registry,
- springStrictPluginLoaderStatusProvider)
+ springStrictPluginLoaderStatusProvider
+ )
}
@Bean

MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginService.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginService.kt
@@ -60,7 +60,8 @@ class DeckPluginService(
val sanitizedAssetPath = if (assetPath.startsWith("/")) assetPath.substring(1) else assetPath
val localAsset = pluginCache.getOrDownload(pluginId, pluginVersion)?.let {
- path -> path.resolve(sanitizedAssetPath).toFile()
+ path ->
+ path.resolve(sanitizedAssetPath).toFile()
}
if (localAsset == null || !localAsset.exists()) {
log.error("Unable to find requested plugin asset '$assetPath' for '$pluginId@$pluginVersion'")

MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginsController.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/deck/DeckPluginsController.kt
@@ -53,7 +53,8 @@ class DeckPluginsController(
return ResponseEntity.ok()
.header("Content-Type", pluginAsset.contentType)
- .header("Cache-Control",
+ .header(
+ "Cache-Control",
CacheControl
.maxAge(30, TimeUnit.DAYS)
.mustRevalidate()

MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/web/info/PluginInfoController.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/web/info/PluginInfoController.kt
@@ -45,7 +45,8 @@ class PluginInfoController(
@ApiOperation(value = "Persist plugin metadata information")
@RequestMapping(
method = [RequestMethod.POST, RequestMethod.PUT],
- consumes = [MediaType.APPLICATION_JSON_VALUE])
+ consumes = [MediaType.APPLICATION_JSON_VALUE]
+ )
@ResponseStatus(value = HttpStatus.ACCEPTED)
fun persistPluginInfo(@RequestBody pluginInfo: SpinnakerPluginInfo): Map<String, Any> {
return pluginService.upsertPluginInfo(pluginInfo)
@@ -56,7 +57,8 @@ class PluginInfoController(
@RequestMapping(
value = ["/{id:.+}"],
method = [RequestMethod.DELETE],
- consumes = [MediaType.APPLICATION_JSON_VALUE])
+ consumes = [MediaType.APPLICATION_JSON_VALUE]
+ )
@ResponseStatus(value = HttpStatus.ACCEPTED)
fun deletePluginInfo(@PathVariable id: String): Map<String, Any> {
return pluginService.deletePluginInfo(id)

MODIFY
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/web/publish/PluginPublishController.kt
gate-plugins/src/main/kotlin/com/netflix/spinnaker/gate/plugins/web/publish/PluginPublishController.kt
@@ -87,12 +87,15 @@ class PluginPublishController(
AuthenticatedRequest.propagate {
val request = Request.Builder()
.url("$front50Url/pluginBinaries/$pluginId/$pluginVersion?sha512sum=$checksum")
- .post(MultipartBody.Builder()
+ .post(
+ MultipartBody.Builder()
.addFormDataPart(
"plugin",
format("%s-%s.zip", pluginId, pluginVersion),
- RequestBody.create(MediaType.parse("application/octet-stream"), body))
- .build())
+ RequestBody.create(MediaType.parse("application/octet-stream"), body)
+ )
+ .build()
+ )
.build()
val response = okHttpClient.newCall(request).execute()

MODIFY
gate-proxy/src/test/kotlin/com/netflix/spinnaker/gate/controllers/ApiExtensionControllerTest.kt
gate-proxy/src/test/kotlin/com/netflix/spinnaker/gate/controllers/ApiExtensionControllerTest.kt
@@ -56,13 +56,17 @@ class ApiExtensionControllerTest : JUnit5Minutests {
}
test("returns expected response") {
- expectThat(subject.any(
+ expectThat(
+ subject.any(
firstApiExtension.id(), emptyMap(), mockk(relaxed = true)
- ).body).isEqualTo("This is a result from ${firstApiExtension.id()}")
+ ).body
+ ).isEqualTo("This is a result from ${firstApiExtension.id()}")
- expectThat(subject.any(
+ expectThat(
+ subject.any(
secondApiExtension.id(), emptyMap(), mockk(relaxed = true)
- ).body).isEqualTo("This is a result from ${secondApiExtension.id()}")
+ ).body
+ ).isEqualTo("This is a result from ${secondApiExtension.id()}")
}
}
}

MODIFY
gradle.properties
gradle.properties
@@ -4,7 +4,7 @@ includeProviders=basic,iap,ldap,oauth2,saml,x509
korkVersion=7.56.0
kotlinVersion=1.3.71
org.gradle.parallel=true
-spinnakerGradleVersion=8.3.0
+spinnakerGradleVersion=8.4.0
# To enable a composite reference to a project, set the
# project property `'<projectName>Composite=true'`.

chore(spotless): upgrade spinnaker gradle plugin (#1294)

This includes updates to google-java-format and ktlint, so requires some
formatting changes. These were made with a simple `./gradlew spotlessApply`.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>