Skip to content

Commit

Permalink
#1374 Fixing workflow trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Jan 6, 2025
1 parent 0bb64c1 commit 32784dd
Show file tree
Hide file tree
Showing 5 changed files with 599 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import net.nemerosa.ontrack.kdsl.acceptance.tests.scm.withMockScmRepository
import net.nemerosa.ontrack.kdsl.acceptance.tests.support.uid
import net.nemerosa.ontrack.kdsl.acceptance.tests.support.waitUntil
import net.nemerosa.ontrack.kdsl.connector.graphql.schema.type.SlotPipelineStatus
import net.nemerosa.ontrack.kdsl.connector.graphql.schema.type.SlotWorkflowTrigger
import net.nemerosa.ontrack.kdsl.spec.extension.av.autoVersioning
import net.nemerosa.ontrack.kdsl.spec.extension.environments.environments
import net.nemerosa.ontrack.kdsl.spec.extension.environments.workflows.addWorkflow
Expand Down Expand Up @@ -42,7 +41,7 @@ class ACCAutoVersioningWorkflow : AbstractACCAutoVersioningTestSupport() {

// Adding a workflow to this slot
slot.addWorkflow(
trigger = SlotWorkflowTrigger.DEPLOYING,
trigger = SlotPipelineStatus.RUNNING,
workflowYaml = """
name: Deployment
nodes:
Expand Down Expand Up @@ -74,7 +73,7 @@ class ACCAutoVersioningWorkflow : AbstractACCAutoVersioningTestSupport() {
timeout = 10_000,
interval = 1_000,
) {
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.DEPLOYED
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.DONE
}

// We expect the GitOps repository to contain the new version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import net.nemerosa.ontrack.kdsl.acceptance.tests.AbstractACCDSLTestSupport
import net.nemerosa.ontrack.kdsl.acceptance.tests.support.uid
import net.nemerosa.ontrack.kdsl.acceptance.tests.support.waitUntil
import net.nemerosa.ontrack.kdsl.connector.graphql.schema.type.SlotPipelineStatus
import net.nemerosa.ontrack.kdsl.connector.graphql.schema.type.SlotWorkflowTrigger
import net.nemerosa.ontrack.kdsl.spec.extension.environments.environments
import net.nemerosa.ontrack.kdsl.spec.extension.environments.workflows.addWorkflow
import org.junit.jupiter.api.Test
Expand All @@ -29,7 +28,7 @@ class ACCEnvironmentsWorkflows : AbstractACCDSLTestSupport() {

// Adding a workflow to this slot
slot.addWorkflow(
trigger = SlotWorkflowTrigger.CREATION,
trigger = SlotPipelineStatus.CANDIDATE,
workflowYaml = """
name: Creation
nodes:
Expand All @@ -50,7 +49,7 @@ class ACCEnvironmentsWorkflows : AbstractACCDSLTestSupport() {
timeout = 10_000,
interval = 1_000,
) {
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.DEPLOYING
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.RUNNING
}

}
Expand All @@ -73,7 +72,7 @@ class ACCEnvironmentsWorkflows : AbstractACCDSLTestSupport() {

// Adding a workflow to this slot
slot.addWorkflow(
trigger = SlotWorkflowTrigger.DEPLOYING,
trigger = SlotPipelineStatus.RUNNING,
workflowYaml = """
name: Deployment
nodes:
Expand All @@ -95,7 +94,7 @@ class ACCEnvironmentsWorkflows : AbstractACCDSLTestSupport() {
timeout = 10_000,
interval = 1_000,
) {
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.DEPLOYED
ontrack.environments.findPipelineById(pipeline.id)?.status == SlotPipelineStatus.DONE
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mutation CreateSlotWorkflow(
$slotId: String!,
$trigger: SlotWorkflowTrigger!,
$trigger: SlotPipelineStatus!,
$workflowYaml: String!,
) {
addSlotWorkflow(input: {
Expand Down
Loading

0 comments on commit 32784dd

Please sign in to comment.