Skip to content

Commit e197021

Browse files
committed
Spotless apply
1 parent c968fff commit e197021

File tree

8 files changed

+44
-42
lines changed

8 files changed

+44
-42
lines changed

scenario/src/main/kotlin/com/cosmotech/scenario/azure/ScenarioServiceImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import com.cosmotech.api.events.ScenarioRunEndToEndStateRequest
2525
import com.cosmotech.api.events.ScenarioRunStartedForScenario
2626
import com.cosmotech.api.events.WorkflowPhaseToStateRequest
2727
import com.cosmotech.api.exceptions.CsmResourceNotFoundException
28-
import com.cosmotech.api.exceptions.CsmServerException
2928
import com.cosmotech.api.rbac.CsmRbac
3029
import com.cosmotech.api.rbac.PERMISSION_CREATE_CHILDREN
3130
import com.cosmotech.api.rbac.PERMISSION_DELETE

scenariorun/src/main/kotlin/com/cosmotech/scenariorun/workflow/argo/ArgoWorkflowService.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ internal class ArgoWorkflowService(
9595
json =
9696
json.apply {
9797
gson =
98-
gson
99-
.newBuilder()
98+
gson.newBuilder()
10099
.registerTypeAdapter(java.time.Instant::class.java, InstantTypeAdapter())
101100
.create()
102101
}
@@ -238,7 +237,8 @@ internal class ArgoWorkflowService(
238237
labelSelector: String,
239238
artifactNameFilter: String
240239
): List<WorkflowStatusAndArtifact> {
241-
var workflowList: IoArgoprojWorkflowV1alpha1WorkflowList? = findWorkflowListByLabel(labelSelector)
240+
var workflowList: IoArgoprojWorkflowV1alpha1WorkflowList? =
241+
findWorkflowListByLabel(labelSelector)
242242

243243
return workflowList?.items?.map { workflow ->
244244
val workflowId = workflow.metadata.uid!!
@@ -268,7 +268,8 @@ internal class ArgoWorkflowService(
268268
override fun findWorkflowStatusByLabel(
269269
labelSelector: String
270270
): List<com.cosmotech.scenariorun.workflow.WorkflowStatus> {
271-
var workflowList: IoArgoprojWorkflowV1alpha1WorkflowList? = findWorkflowListByLabel(labelSelector)
271+
var workflowList: IoArgoprojWorkflowV1alpha1WorkflowList? =
272+
findWorkflowListByLabel(labelSelector)
272273

273274
return workflowList?.items?.map { workflow ->
274275
val workflowId = workflow.metadata.uid!!
@@ -278,7 +279,9 @@ internal class ArgoWorkflowService(
278279
?: listOf()
279280
}
280281

281-
internal fun findWorkflowListByLabel(labelSelector: String): IoArgoprojWorkflowV1alpha1WorkflowList? {
282+
internal fun findWorkflowListByLabel(
283+
labelSelector: String
284+
): IoArgoprojWorkflowV1alpha1WorkflowList? {
282285
var workflowList: IoArgoprojWorkflowV1alpha1WorkflowList? = null
283286
try {
284287
// Workflows are auto-archived and auto-deleted more frequently

scenariorun/src/test/kotlin/com/cosmotech/scenariorun/ContainerFactoryTests.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,7 +2311,7 @@ class ContainerFactoryTests {
23112311
"CSM_PROBES_MEASURES_TOPIC" to
23122312
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
23132313
"CSM_CONTROL_PLANE_TOPIC" to
2314-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2314+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
23152315
"CSM_SIMULATION" to "TestSimulation",
23162316
"TWIN_CACHE_HOST" to "this_is_a_host",
23172317
"TWIN_CACHE_PORT" to "6973",
@@ -2358,7 +2358,7 @@ class ContainerFactoryTests {
23582358
"CSM_PROBES_MEASURES_TOPIC" to
23592359
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
23602360
"CSM_CONTROL_PLANE_TOPIC" to
2361-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2361+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
23622362
"CSM_SIMULATION" to "TestSimulation",
23632363
"TWIN_CACHE_HOST" to "this_is_a_host",
23642364
"TWIN_CACHE_PORT" to "6973",
@@ -2452,8 +2452,8 @@ class ContainerFactoryTests {
24522452
"CSM_PROBES_MEASURES_TOPIC" to
24532453
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
24542454
"CSM_CONTROL_PLANE_TOPIC" to
2455-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2456-
"AZURE_EVENT_HUB_SHARED_ACCESS_POLICY" to "my-eventhub-access-policy",
2455+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2456+
"AZURE_EVENT_HUB_SHARED_ACCESS_POLICY" to "my-eventhub-access-policy",
24572457
"AZURE_EVENT_HUB_SHARED_ACCESS_KEY" to "a1b2c3d4e5==",
24582458
"CSM_AMQPCONSUMER_USER" to "my-eventhub-access-policy",
24592459
"CSM_AMQPCONSUMER_PASSWORD" to "a1b2c3d4e5==",
@@ -2632,7 +2632,7 @@ class ContainerFactoryTests {
26322632
"CSM_PROBES_MEASURES_TOPIC" to
26332633
"amqps://organizationid-test.servicebus.windows.net/probesmeasures",
26342634
"CSM_CONTROL_PLANE_TOPIC" to
2635-
"amqps://organizationid-test.servicebus.windows.net/scenariorun",
2635+
"amqps://organizationid-test.servicebus.windows.net/scenariorun",
26362636
"CSM_SIMULATION" to "TestSimulation",
26372637
"TWIN_CACHE_HOST" to "this_is_a_host",
26382638
"TWIN_CACHE_PORT" to "6973",
@@ -2883,7 +2883,7 @@ class ContainerFactoryTests {
28832883
"TWIN_CACHE_PORT" to "6973",
28842884
"TWIN_CACHE_PASSWORD" to "this_is_a_password",
28852885
"TWIN_CACHE_USERNAME" to "default"),
2886-
container.envVars)
2886+
container.envVars)
28872887
}
28882888

28892889
@Test
@@ -2920,7 +2920,7 @@ class ContainerFactoryTests {
29202920
"CSM_PROBES_MEASURES_TOPIC" to
29212921
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
29222922
"CSM_CONTROL_PLANE_TOPIC" to
2923-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2923+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
29242924
"CSM_SIMULATION" to "TestSimulation",
29252925
"TWIN_CACHE_HOST" to "this_is_a_host",
29262926
"TWIN_CACHE_PORT" to "6973",

scenariorun/src/test/kotlin/com/cosmotech/scenariorun/OktaContainerFactoryTests.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,8 +2325,8 @@ class OktaContainerFactoryTests {
23252325
"CSM_PROBES_MEASURES_TOPIC" to
23262326
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
23272327
"CSM_CONTROL_PLANE_TOPIC" to
2328-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2329-
"CSM_SIMULATION" to "TestSimulation",
2328+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2329+
"CSM_SIMULATION" to "TestSimulation",
23302330
"TWIN_CACHE_HOST" to "this_is_a_host",
23312331
"TWIN_CACHE_PORT" to "6973",
23322332
"TWIN_CACHE_PASSWORD" to "this_is_a_password",
@@ -2375,8 +2375,8 @@ class OktaContainerFactoryTests {
23752375
"CSM_PROBES_MEASURES_TOPIC" to
23762376
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
23772377
"CSM_CONTROL_PLANE_TOPIC" to
2378-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2379-
"CSM_SIMULATION" to "TestSimulation",
2378+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2379+
"CSM_SIMULATION" to "TestSimulation",
23802380
"TWIN_CACHE_HOST" to "this_is_a_host",
23812381
"TWIN_CACHE_PORT" to "6973",
23822382
"TWIN_CACHE_PASSWORD" to "this_is_a_password",
@@ -2430,8 +2430,8 @@ class OktaContainerFactoryTests {
24302430
"CSM_PROBES_MEASURES_TOPIC" to
24312431
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
24322432
"CSM_CONTROL_PLANE_TOPIC" to
2433-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2434-
"AZURE_EVENT_HUB_SHARED_ACCESS_POLICY" to "my-eventhub-access-policy",
2433+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2434+
"AZURE_EVENT_HUB_SHARED_ACCESS_POLICY" to "my-eventhub-access-policy",
24352435
"AZURE_EVENT_HUB_SHARED_ACCESS_KEY" to "a1b2c3d4e5==",
24362436
"CSM_AMQPCONSUMER_USER" to "my-eventhub-access-policy",
24372437
"CSM_AMQPCONSUMER_PASSWORD" to "a1b2c3d4e5==",
@@ -2564,8 +2564,8 @@ class OktaContainerFactoryTests {
25642564
"CSM_PROBES_MEASURES_TOPIC" to
25652565
"amqps://organizationid-test.servicebus.windows.net/probesmeasures",
25662566
"CSM_CONTROL_PLANE_TOPIC" to
2567-
"amqps://organizationid-test.servicebus.windows.net/scenariorun",
2568-
"CSM_SIMULATION" to "TestSimulation",
2567+
"amqps://organizationid-test.servicebus.windows.net/scenariorun",
2568+
"CSM_SIMULATION" to "TestSimulation",
25692569
"TWIN_CACHE_HOST" to "this_is_a_host",
25702570
"TWIN_CACHE_PORT" to "6973",
25712571
"TWIN_CACHE_PASSWORD" to "this_is_a_password",
@@ -2611,8 +2611,8 @@ class OktaContainerFactoryTests {
26112611
"CSM_PROBES_MEASURES_TOPIC" to
26122612
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test",
26132613
"CSM_CONTROL_PLANE_TOPIC" to
2614-
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2615-
"CSM_SIMULATION" to "TestSimulation",
2614+
"amqps://csm-phoenix.servicebus.windows.net/organizationid-test-scenariorun",
2615+
"CSM_SIMULATION" to "TestSimulation",
26162616
"TWIN_CACHE_HOST" to "this_is_a_host",
26172617
"TWIN_CACHE_PORT" to "6973",
26182618
"TWIN_CACHE_PASSWORD" to "this_is_a_password",

workspace/src/main/kotlin/com/cosmotech/workspace/azure/WorkspaceServiceImpl.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import com.cosmotech.api.rbac.model.RbacAccessControl
3535
import com.cosmotech.api.rbac.model.RbacSecurity
3636
import com.cosmotech.api.utils.ResourceScanner
3737
import com.cosmotech.api.utils.SecretManager
38-
import com.cosmotech.api.utils.changed
3938
import com.cosmotech.api.utils.compareToAndMutateIfNeeded
4039
import com.cosmotech.api.utils.getCurrentAuthenticatedMail
4140
import com.cosmotech.api.utils.getCurrentAuthenticatedUserName
@@ -48,8 +47,8 @@ import com.cosmotech.workspace.api.WorkspaceApiService
4847
import com.cosmotech.workspace.domain.Workspace
4948
import com.cosmotech.workspace.domain.WorkspaceAccessControl
5049
import com.cosmotech.workspace.domain.WorkspaceFile
51-
import com.cosmotech.workspace.domain.WorkspaceSecret
5250
import com.cosmotech.workspace.domain.WorkspaceRole
51+
import com.cosmotech.workspace.domain.WorkspaceSecret
5352
import com.cosmotech.workspace.domain.WorkspaceSecurity
5453
import com.fasterxml.jackson.databind.JsonNode
5554
import kotlinx.coroutines.GlobalScope

workspace/src/main/kotlin/com/cosmotech/workspace/azure/strategy/WorkspaceEventHubStrategyDedicated.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class WorkspaceEventHubStrategyDedicated(
5858
workspace.sendScenarioRunToEventHub.takeIf { it == true }?.let { EVENTHUB_CONTROL_PLANE }
5959
?: NOT_AVAILABLE
6060
EventHubRole.SCENARIO_METADATA ->
61-
workspace.sendScenarioMetadataToEventHub
62-
.takeIf { it == true }
63-
?.let { EVENTHUB_SCENARIO_METADATA }
61+
workspace.sendScenarioMetadataToEventHub.takeIf { it == true }?.let {
62+
EVENTHUB_SCENARIO_METADATA
63+
}
6464
?: NOT_AVAILABLE
6565
EventHubRole.SCENARIO_RUN_METADATA ->
66-
workspace.sendScenarioMetadataToEventHub
67-
.takeIf { it == true }
68-
?.let { EVENTHUB_SCENARIO_RUN_METADATA }
66+
workspace.sendScenarioMetadataToEventHub.takeIf { it == true }?.let {
67+
EVENTHUB_SCENARIO_RUN_METADATA
68+
}
6969
?: NOT_AVAILABLE
7070
}
7171
}

workspace/src/main/kotlin/com/cosmotech/workspace/azure/strategy/WorkspaceEventHubStrategyShared.kt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class WorkspaceEventHubStrategyShared(
3030
override fun getWorkspaceEventHubSasKeyName(
3131
workspace: Workspace,
3232
): String {
33-
return csmPlatformProperties.azure
33+
return csmPlatformProperties
34+
.azure
3435
?.eventBus
3536
?.authentication
3637
?.sharedAccessPolicy
@@ -49,19 +50,19 @@ class WorkspaceEventHubStrategyShared(
4950
return when (eventHubRole) {
5051
EventHubRole.PROBES_MEASURES -> baseName
5152
EventHubRole.CONTROL_PLANE ->
52-
workspace.sendScenarioRunToEventHub
53-
.takeIf { it == true }
54-
?.let { "$baseName$CONTROL_PLANE_SUFFIX" }
53+
workspace.sendScenarioRunToEventHub.takeIf { it == true }?.let {
54+
"$baseName$CONTROL_PLANE_SUFFIX"
55+
}
5556
?: NOT_AVAILABLE
5657
EventHubRole.SCENARIO_METADATA ->
57-
workspace.sendScenarioMetadataToEventHub
58-
.takeIf { it == true }
59-
?.let { "$baseName$SCENARIO_METADATA_SUFFIX" }
58+
workspace.sendScenarioMetadataToEventHub.takeIf { it == true }?.let {
59+
"$baseName$SCENARIO_METADATA_SUFFIX"
60+
}
6061
?: NOT_AVAILABLE
6162
EventHubRole.SCENARIO_RUN_METADATA ->
62-
workspace.sendScenarioMetadataToEventHub
63-
.takeIf { it == true }
64-
?.let { "$baseName$SCENARIO_RUN_METADATA_SUFFIX" }
63+
workspace.sendScenarioMetadataToEventHub.takeIf { it == true }?.let {
64+
"$baseName$SCENARIO_RUN_METADATA_SUFFIX"
65+
}
6566
?: NOT_AVAILABLE
6667
}
6768
}

workspace/src/test/kotlin/com/cosmotech/workspace/azure/WorkspaceServiceImplTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import com.cosmotech.api.config.CsmPlatformProperties
1111
import com.cosmotech.api.exceptions.CsmResourceNotFoundException
1212
import com.cosmotech.api.rbac.CsmRbac
1313
import com.cosmotech.api.utils.ResourceScanner
14-
import com.cosmotech.api.utils.getCurrentAuthenticatedMail
1514
import com.cosmotech.api.utils.SecretManager
15+
import com.cosmotech.api.utils.getCurrentAuthenticatedMail
1616
import com.cosmotech.organization.api.OrganizationApiService
1717
import com.cosmotech.solution.api.SolutionApiService
1818
import com.cosmotech.workspace.domain.Workspace

0 commit comments

Comments
 (0)