Skip to content

Commit 4de0ed8

Browse files
dhasani23David Hasani
andauthored
fix(gumby): set shell to false (#4286)
* fix(gumby): set shell to false * add changelog * fix: fix lint error by adding void --------- Co-authored-by: David Hasani <davhasan@amazon.com>
1 parent be4816e commit 4de0ed8

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Amazon Q CodeTransform: open summary.md automatically when job finishes"
4+
}

src/codewhisperer/service/transformByQHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ export async function validateProjectSelection(project: vscode.QuickPickItem) {
110110
})
111111
throw new TransformByQJavaProjectNotFound()
112112
}
113-
const classFilePath = `"${compiledJavaFiles[0].fsPath}"`
113+
const classFilePath = `${compiledJavaFiles[0].fsPath}`
114114
const baseCommand = 'javap'
115115
const args = ['-v', classFilePath]
116-
const spawnResult = spawnSync(baseCommand, args, { shell: true, encoding: 'utf-8' })
116+
const spawnResult = spawnSync(baseCommand, args, { shell: false, encoding: 'utf-8' })
117117

118118
if (spawnResult.error || spawnResult.status !== 0) {
119119
void vscode.window.showErrorMessage(CodeWhispererConstants.noSupportedJavaProjectsFoundMessage)

src/codewhisperer/service/transformationResultsViewProvider.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,8 @@ export class ProposedTransformationExplorer {
302302
codeTransformApiNames: 'ExportResultArchive',
303303
codeTransformSessionId: codeTransformTelemetryState.getSessionId(),
304304
codeTransformJobId: transformByQState.getJobId(),
305-
codeTransformApiErrorMessage: e?.message || errorMessage,
306-
codeTransformRequestId: e?.requestId,
305+
codeTransformApiErrorMessage: (e as Error).message ?? errorMessage,
306+
codeTransformRequestId: e.requestId ?? '',
307307
result: MetadataResult.Fail,
308308
reason: 'ExportResultArchiveFailed',
309309
})
@@ -336,7 +336,7 @@ export class ProposedTransformationExplorer {
336336
)
337337
} catch (e: any) {
338338
deserializeErrorMessage =
339-
e?.message ||
339+
(e as Error).message ??
340340
'Transform by Q experienced an error during the deserialization of the downloaded result archive'
341341
getLogger().error('CodeTransform: ParseDiff error = ', deserializeErrorMessage)
342342
void vscode.window.showErrorMessage(deserializeErrorMessage)
@@ -361,7 +361,8 @@ export class ProposedTransformationExplorer {
361361
result: MetadataResult.Pass,
362362
})
363363

364-
await vscode.window.showInformationMessage(CodeWhispererConstants.viewProposedChangesMessage)
364+
// Do not await this so that the summary reveals without user needing to close this notification
365+
void vscode.window.showInformationMessage(CodeWhispererConstants.viewProposedChangesMessage)
365366
await vscode.commands.executeCommand('aws.amazonq.transformationHub.summary.reveal')
366367
})
367368

0 commit comments

Comments
 (0)