Skip to content

Commit 19fa05c

Browse files
committed
chore: remove GetStepWithTestExecutions and ExecuteFlow, remove single step testing killswitch
1 parent b439397 commit 19fa05c

File tree

11 files changed

+6
-184
lines changed

11 files changed

+6
-184
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/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/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

packages/frontend/src/contexts/Editor.tsx

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import type { IApp, IExecutionStep, IFlow, IStep } from '@plumber/types'
22

3-
import {
4-
createContext,
5-
ReactNode,
6-
useCallback,
7-
useContext,
8-
useMemo,
9-
useState,
10-
} from 'react'
3+
import { createContext, ReactNode, useCallback, useMemo, useState } from 'react'
114
import { useMutation, useQuery } from '@apollo/client'
125
import { Center, useDisclosure } from '@chakra-ui/react'
136
import { useIsMobile } from '@opengovsg/design-system-react'
@@ -17,11 +10,9 @@ import {
1710
genVariableInfoMap,
1811
VariableInfoMap,
1912
} from '@/components/RichTextEditor/utils'
20-
import { SINGLE_STEP_TEST_KILL_SWITCH } from '@/config/flags'
2113
import { ExecutionStep } from '@/graphql/__generated__/graphql'
2214
import client from '@/graphql/client'
2315
import { CREATE_STEP } from '@/graphql/mutations/create-step'
24-
import { EXECUTE_FLOW } from '@/graphql/mutations/execute-flow'
2516
import { EXECUTE_STEP } from '@/graphql/mutations/execute-step'
2617
import { UPDATE_STEP } from '@/graphql/mutations/update-step'
2718
import { GET_APPS } from '@/graphql/queries/get-apps'
@@ -34,8 +25,6 @@ import {
3425
} from '@/helpers/toolbox'
3526
import { extractVariables, StepWithVariables } from '@/helpers/variables'
3627

37-
import { LaunchDarklyContext } from './LaunchDarkly'
38-
3928
interface IEditorContextValue {
4029
flow: IFlow
4130
flowId: string
@@ -156,10 +145,6 @@ export const EditorProvider = ({
156145
setShouldWarnOnLeave,
157146
children,
158147
}: EditorProviderProps) => {
159-
// TODO: remove this kill switch once Single Step Testing is stable
160-
const { flags } = useContext(LaunchDarklyContext)
161-
const shouldUseSingleStepTest = !flags?.[SINGLE_STEP_TEST_KILL_SWITCH]
162-
163148
const isMobile = useIsMobile()
164149

165150
const flowId = flow.id
@@ -184,8 +169,6 @@ export const EditorProvider = ({
184169
{
185170
variables: {
186171
flowId,
187-
// ignore test execution id and fetch execution steps by ordering if SST not enabled
188-
ignoreTestExecutionId: !shouldUseSingleStepTest,
189172
},
190173
},
191174
)
@@ -324,17 +307,15 @@ export const EditorProvider = ({
324307
* Test execution step
325308
*/
326309
const [executeStep, { loading: isTestExecuting }] = useMutation(
327-
shouldUseSingleStepTest ? EXECUTE_STEP : EXECUTE_FLOW,
310+
EXECUTE_STEP,
328311
{
329312
context: { autoSnackbar: false },
330313
awaitRefetchQueries: true,
331314
refetchQueries: [GET_TEST_EXECUTION_STEPS, GET_FLOW],
332315
update(cache, { data }) {
333316
// If last execution step is successful, it means the test run is successful
334317
// Update the step status to completed without refreshing
335-
const lastExecutionStep: ExecutionStep = shouldUseSingleStepTest
336-
? data?.executeStep
337-
: data?.executeFlow
318+
const lastExecutionStep: ExecutionStep = data?.executeStep
338319
if (lastExecutionStep.status === 'success') {
339320
const stepCache = cache.identify({
340321
__typename: 'Step',

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

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

0 commit comments

Comments
 (0)