Skip to content

Commit e8c516c

Browse files
author
David Hasani
committed
open plan periodically
1 parent 65a3ba9 commit e8c516c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/core/src/codewhisperer/commands/startTransformByQ.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,11 @@ export async function pollTransformationStatusUntilPlanReady(jobId: string, prof
554554
// for now, no plan shown with SQL conversions. later, we may add one
555555
return
556556
}
557+
jobPlanProgress['generatePlan'] = StepProgress.Succeeded
558+
throwIfCancelled()
559+
}
560+
561+
export async function openTransformationPlan(jobId: string, profile?: RegionProfile) {
557562
let plan = undefined
558563
try {
559564
plan = await getTransformationPlan(jobId, profile)
@@ -576,8 +581,6 @@ export async function pollTransformationStatusUntilPlanReady(jobId: string, prof
576581
transformByQState.setPlanFilePath(planFilePath)
577582
await setContext('gumby.isPlanAvailable', true)
578583
}
579-
jobPlanProgress['generatePlan'] = StepProgress.Succeeded
580-
throwIfCancelled()
581584
}
582585

583586
export async function pollTransformationStatusUntilComplete(jobId: string, profile: RegionProfile | undefined) {

packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { AuthUtil } from '../../util/authUtil'
5555
import { DiffModel } from './transformationResultsViewProvider'
5656
import { spawnSync } from 'child_process' // eslint-disable-line no-restricted-imports
5757
import { isClientSideBuildEnabled } from '../../../dev/config'
58+
import { openTransformationPlan } from '../../commands/startTransformByQ'
5859

5960
export function getSha256(buffer: Buffer) {
6061
const hasher = crypto.createHash('sha256')
@@ -785,6 +786,11 @@ export async function pollTransformationJob(jobId: string, validStates: string[]
785786
`${CodeWhispererConstants.failedToCompleteJobGenericNotification} ${errorMessage}`
786787
)
787788
}
789+
790+
if (CodeWhispererConstants.validStatesForPlanGenerated.includes(status)) {
791+
await openTransformationPlan(jobId, profile)
792+
}
793+
788794
if (validStates.includes(status)) {
789795
break
790796
}

0 commit comments

Comments
 (0)