Skip to content

Commit

Permalink
add debug logs temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hasani committed Dec 9, 2024
1 parent 1d1fa50 commit e451f5b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/core/src/codewhisperer/commands/startTransformByQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ export async function startTransformByQ() {
// step 1: CreateUploadUrl and upload code
const uploadId = await preTransformationUploadCode()

console.log('upload ID = ' + uploadId)

// step 2: StartJob and store the returned jobId in TransformByQState
const jobId = await startTransformationJob(uploadId, transformStartTime)

console.log('jobId =' + jobId)

// step 3 (intermediate step): show transformation-plan.md file
await pollTransformationStatusUntilPlanReady(jobId)

Expand All @@ -246,6 +250,7 @@ export async function startTransformByQ() {
} catch (error: any) {
await transformationJobErrorHandler(error)
} finally {
console.log('QCT: in finally block')
await postTransformationJob()
await cleanupTransformationJob()
}
Expand Down Expand Up @@ -341,12 +346,14 @@ export async function preTransformationUploadCode() {
const transformZipManifest = new ZipManifest()
// if the user chose to skip unit tests, add the custom build command here
transformZipManifest.customBuildCommand = transformByQState.getCustomBuildCommand()
console.log('QCT: about to zipCode')
const zipCodeResult = await zipCode({
// dependenciesFolder will be undefined for SQL conversions since we don't compileProject
dependenciesFolder: transformByQState.getDependencyFolderInfo(),
projectPath: transformByQState.getProjectPath(),
zipManifest: transformZipManifest,
})
console.log('QCT: done zipping')

const payloadFilePath = zipCodeResult.tempFilePath
const zipSize = zipCodeResult.fileSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ export async function zipCode(
}
} catch (e: any) {
getLogger().error(`CodeTransformation: zipCode error = ${e}`)
console.log('QCT: error zipping: ' + e)
throw Error('Failed to zip project')
} finally {
if (logFilePath) {
Expand Down Expand Up @@ -409,6 +410,7 @@ export async function startJob(uploadId: string) {
const sourceLanguageVersion = `JAVA_${transformByQState.getSourceJDKVersion()}`
const targetLanguageVersion = `JAVA_${transformByQState.getTargetJDKVersion()}`
try {
console.log('QCT: about to start Job')
const response = await codeWhisperer.codeWhispererClient.codeModernizerStartCodeTransformation({
workspaceState: {
uploadId: uploadId,
Expand All @@ -427,6 +429,7 @@ export async function startJob(uploadId: string) {
} catch (e: any) {
const errorMessage = `Starting the job failed due to: ${(e as Error).message}`
getLogger().error(`CodeTransformation: StartTransformation error = ${errorMessage}`)
console.log('QCT: startJob failed: ' + e)
throw new Error(errorMessage)
}
}
Expand Down Expand Up @@ -624,6 +627,7 @@ export async function pollTransformationJob(jobId: string, validStates: string[]
transformationJobId: jobId,
})
status = response.transformationJob.status!
console.log('QCT: status = ' + status)
if (CodeWhispererConstants.validStatesForBuildSucceeded.includes(status)) {
jobPlanProgress['buildCode'] = StepProgress.Succeeded
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/testInteg/globalSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { globals } from '../shared'
// ASSUMPTION: Tests are not run concurrently

let windowPatch: vscode.Disposable
const maxTestDuration = 420_000 // 7 minutes
const maxTestDuration = 300_000
const globalSandbox = sinon.createSandbox()

export async function mochaGlobalSetup(extensionId: string) {
Expand Down

0 comments on commit e451f5b

Please sign in to comment.