Skip to content

Commit f4de954

Browse files
authored
[REMOCK-1] PLU-471: remove GetStepWithTestExecutions and ExecuteFlow, remove single step testing killswitch (#1054)
## House-keeping PR - Removed the `executeFlow` mutation resolver and its implementation - Removed the `getStepWithTestExecutions` query which was already marked as deprecated - Removed the `SINGLE_STEP_TEST_KILL_SWITCH` feature flag as it's no longer needed ### How to test? 1. Verify that step testing still works correctly in the editor 2. Confirm that test execution steps are properly displayed 3. Ensure that step execution status updates correctly after testing
1 parent ab92468 commit f4de954

File tree

13 files changed

+6
-323
lines changed

13 files changed

+6
-323
lines changed

packages/backend/src/graphql/mutation-resolvers.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import deleteFlow from './mutations/delete-flow'
1010
import deleteStep from './mutations/delete-step'
1111
import deleteUploadedFile from './mutations/delete-uploaded-file'
1212
import duplicateFlow from './mutations/duplicate-flow'
13-
import executeFlow from './mutations/execute-flow'
1413
import executeStep from './mutations/execute-step'
1514
import generateAuthUrl from './mutations/generate-auth-url'
1615
import generatePresignedUrl from './mutations/generate-presigned-url'
@@ -63,7 +62,6 @@ export default {
6362
updateFlow,
6463
updateFlowStatus,
6564
updateFlowConfig,
66-
executeFlow,
6765
executeStep,
6866
deleteFlow,
6967
createStep,

packages/backend/src/graphql/mutations/execute-flow.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

packages/backend/src/graphql/queries/get-step-with-test-executions.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

packages/backend/src/graphql/queries/get-test-execution-steps.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const getTestExecutionSteps: QueryResolvers['getTestExecutionSteps'] = async (
77
params,
88
context,
99
) => {
10-
const { flowId, ignoreTestExecutionId } = params
10+
const { flowId } = params
1111
// For checking if flow belongs to the user
1212
const flow = await context.currentUser
1313
.$relatedQuery('flows')
@@ -17,10 +17,7 @@ const getTestExecutionSteps: QueryResolvers['getTestExecutionSteps'] = async (
1717
.findById(flowId)
1818
.throwIfNotFound()
1919

20-
const testExecutionSteps = await getTestExecutionStepsHelper(
21-
flow.id,
22-
ignoreTestExecutionId,
23-
)
20+
const testExecutionSteps = await getTestExecutionStepsHelper(flow.id)
2421

2522
// We do not return test execution steps if the step is not complete
2623
// to ensure we dont show variables from other step/events.

packages/backend/src/graphql/query-resolvers.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import getFlowTransferDetails from './queries/get-flow-transfer-details'
1212
import getFlows from './queries/get-flows'
1313
import getPendingFlowTransfers from './queries/get-pending-flow-transfers'
1414
import getPlumberStats from './queries/get-plumber-stats'
15-
import getStepWithTestExecutions from './queries/get-step-with-test-executions'
1615
import getTemplates from './queries/get-templates'
1716
import getTestExecutionSteps from './queries/get-test-execution-steps'
1817
import healthcheck from './queries/healthcheck'
@@ -37,7 +36,6 @@ export default {
3736
testConnection,
3837
getFlow,
3938
getFlows,
40-
getStepWithTestExecutions,
4139
getTestExecutionSteps,
4240
getExecution,
4341
getExecutions,

packages/backend/src/graphql/schema.graphql

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ type Query {
1515
connectionId: String
1616
name: String
1717
): PaginatedFlows
18-
getStepWithTestExecutions(stepId: String!): [Step]
19-
@deprecated(reason: "Use getTestExecution instead")
2018
getTestExecutionSteps(
2119
flowId: String!
2220
ignoreTestExecutionId: Boolean
@@ -77,7 +75,6 @@ type Mutation {
7775
updateFlow(input: UpdateFlowInput): Flow
7876
updateFlowStatus(input: UpdateFlowStatusInput): Flow
7977
updateFlowConfig(input: UpdateFlowConfigInput): Flow
80-
executeFlow(input: ExecuteFlowInput): ExecutionStep!
8178
executeStep(input: ExecuteStepInput): ExecutionStep!
8279
deleteFlow(input: DeleteFlowInput): Boolean
8380
createStep(input: CreateStepInput): Step
@@ -476,10 +473,6 @@ input UpdateFlowConfigInput {
476473
attachments: [FlowAttachmentsConfigInput]
477474
}
478475

479-
input ExecuteFlowInput {
480-
stepId: String!
481-
}
482-
483476
input ExecuteStepInput {
484477
stepId: String!
485478
}

packages/backend/src/helpers/__tests__/get-test-execution-steps.itest.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { beforeEach, describe, expect, it } from 'vitest'
22

33
import Execution from '@/models/execution'
4-
import ExecutionStep from '@/models/execution-step'
54
import Flow from '@/models/flow'
65
import User from '@/models/user'
76

@@ -234,57 +233,5 @@ describe('get test execution steps', () => {
234233
testExecution2.executionSteps[1].id,
235234
])
236235
})
237-
238-
it('should return the latest test execution steps if ignoreTestExecutionId is set to true', async () => {
239-
const testExecution2 = await Execution.query().insertGraphAndFetch({
240-
flowId: flow.id,
241-
testRun: true,
242-
executionSteps: [
243-
{
244-
stepId: flow.steps[0].id,
245-
status: 'success',
246-
dataOut: { someData: 'data' },
247-
},
248-
{
249-
stepId: flow.steps[1].id,
250-
status: 'success',
251-
dataOut: { someData: 'data' },
252-
},
253-
],
254-
})
255-
await flow.$query().patch({ testExecutionId: testExecution1.id })
256-
const testExecutionSteps = await getTestExecutionSteps(flow.id, true)
257-
expect(testExecutionSteps).to.toHaveLength(3)
258-
expect(testExecutionSteps.map((step) => step.id)).toEqual([
259-
testExecution2.executionSteps[0].id,
260-
testExecution2.executionSteps[1].id,
261-
testExecution1.executionSteps[2].id,
262-
])
263-
})
264-
265-
it('should return the latest test execution steps if more than 1 found for a step', async () => {
266-
const dupes = await ExecutionStep.query().insert([
267-
{
268-
executionId: testExecution1.id,
269-
stepId: flow.steps[0].id,
270-
status: 'success',
271-
dataOut: { someData: 'data' },
272-
},
273-
{
274-
executionId: testExecution1.id,
275-
stepId: flow.steps[1].id,
276-
status: 'success',
277-
dataOut: { someData: 'data' },
278-
},
279-
])
280-
await flow.$query().patch({ testExecutionId: testExecution1.id })
281-
const testExecutionSteps = await getTestExecutionSteps(flow.id, true)
282-
expect(testExecutionSteps).to.toHaveLength(3)
283-
expect(testExecutionSteps.map((step) => step.id)).toEqual([
284-
dupes[0].id,
285-
dupes[1].id,
286-
testExecution1.executionSteps[2].id,
287-
])
288-
})
289236
})
290237
})

packages/backend/src/helpers/get-test-execution-steps.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Flow from '@/models/flow'
55

66
export async function getTestExecutionSteps(
77
flowId: string,
8-
ignoreTestExecutionId = false,
98
): Promise<ExecutionStep[]> {
109
const flow = await Flow.query()
1110
.findById(flowId)
@@ -23,7 +22,7 @@ export async function getTestExecutionSteps(
2322
return []
2423
}
2524

26-
if (flow.testExecution && !ignoreTestExecutionId) {
25+
if (flow.testExecution) {
2726
const testExecutionSteps = flow.testExecution.executionSteps
2827

2928
/**

packages/backend/src/services/test-run.ts

Lines changed: 0 additions & 86 deletions
This file was deleted.

packages/frontend/src/config/flags.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
export const BANNER_TEXT_FLAG = 'banner_display'
88
// we only want to show this notification to users created before this date (ms since epoch)
99
export const SINGLE_STEP_TEST_SHOW_BEFORE_FLAG = 'single_step_test_show_before'
10-
// kill-switch for single-step testing in case of issues
11-
export const SINGLE_STEP_TEST_KILL_SWITCH = 'single_step_test_kill_switch'
1210

1311
/**
1412
* Feature flags

0 commit comments

Comments
 (0)