Skip to content

Commit 4912697

Browse files
authored
Merge #4312 fix(gumby): remove unneeded dep
2 parents 95e381e + 30ecea9 commit 4912697

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

package-lock.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@
24152415
{
24162416
"command": "aws.amazonq.transformationHub.summary.reveal",
24172417
"title": "%AWS.command.q.transform.showChangeSummary%",
2418-
"enablement": "gumby.reviewState == InReview"
2418+
"enablement": "gumby.isSummaryAvailable"
24192419
},
24202420
{
24212421
"command": "aws.amazonq.transformationHub.reviewChanges.reveal",
@@ -3805,7 +3805,6 @@
38053805
{
38063806
"command": "aws.amazonq.showTransformationPlanInHub",
38073807
"title": "Show Transformation Plan",
3808-
"icon": "$(book)",
38093808
"enablement": "gumby.isPlanAvailable"
38103809
}
38113810
],
@@ -4382,7 +4381,6 @@
43824381
"markdown-it": "^13.0.2",
43834382
"mime-types": "^2.1.32",
43844383
"node-fetch": "^2.7.0",
4385-
"parse-diff": "0.11.1",
43864384
"portfinder": "^1.0.32",
43874385
"sanitize-html": "^2.3.3",
43884386
"semver": "^7.5.4",

src/codewhisperer/commands/startTransformByQ.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ export async function setTransformationToRunningState(userInputState: UserInputS
317317
await vscode.commands.executeCommand('setContext', 'gumby.isStopButtonAvailable', true)
318318
await vscode.commands.executeCommand('setContext', 'gumby.isTransformAvailable', false)
319319
await vscode.commands.executeCommand('setContext', 'gumby.isPlanAvailable', false)
320+
await vscode.commands.executeCommand('setContext', 'gumby.isSummaryAvailable', false)
320321
await resetReviewInProgress()
321322

322323
await vscode.commands.executeCommand('aws.amazonq.refresh')

src/codewhisperer/service/transformationResultsViewProvider.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ export class DiffModel {
140140
*/
141141
public parseDiff(pathToDiff: string, pathToWorkspace: string): ProposedChangeNode[] {
142142
const diffContents = fs.readFileSync(pathToDiff, 'utf8')
143+
if (!diffContents) {
144+
throw new ToolkitError('diff.patch file is empty', { code: 'EmptyDiffPatch' })
145+
}
143146
const changedFiles = parsePatch(diffContents)
144147
// path to the directory containing copy of the changed files in the transformed project
145148
const pathToTmpSrcDir = this.copyProject(pathToWorkspace, changedFiles)
@@ -361,6 +364,19 @@ export class ProposedTransformationExplorer {
361364
transformByQState.setSummaryFilePath(
362365
path.join(pathContainingArchive, ExportResultArchiveStructure.PathToSummary)
363366
)
367+
transformByQState.setResultArchiveFilePath(pathContainingArchive)
368+
await vscode.commands.executeCommand('setContext', 'gumby.isSummaryAvailable', true)
369+
370+
// This metric is only emitted when placed before showInformationMessage
371+
telemetry.codeTransform_vcsDiffViewerVisible.emit({
372+
codeTransformSessionId: codeTransformTelemetryState.getSessionId(),
373+
codeTransformJobId: transformByQState.getJobId(),
374+
result: MetadataResult.Pass,
375+
})
376+
377+
// Do not await this so that the summary reveals without user needing to close this notification
378+
void vscode.window.showInformationMessage(CodeWhispererConstants.viewProposedChangesMessage)
379+
await vscode.commands.executeCommand('aws.amazonq.transformationHub.summary.reveal')
364380
} catch (e: any) {
365381
deserializeErrorMessage =
366382
(e as Error).message ??
@@ -378,19 +394,6 @@ export class ProposedTransformationExplorer {
378394
reason: deserializeErrorMessage ? 'DeserializationFailed' : undefined,
379395
})
380396
}
381-
382-
transformByQState.setResultArchiveFilePath(pathContainingArchive)
383-
384-
// This metric is only emitted when placed before showInformationMessage
385-
telemetry.codeTransform_vcsDiffViewerVisible.emit({
386-
codeTransformSessionId: codeTransformTelemetryState.getSessionId(),
387-
codeTransformJobId: transformByQState.getJobId(),
388-
result: MetadataResult.Pass,
389-
})
390-
391-
// Do not await this so that the summary reveals without user needing to close this notification
392-
void vscode.window.showInformationMessage(CodeWhispererConstants.viewProposedChangesMessage)
393-
await vscode.commands.executeCommand('aws.amazonq.transformationHub.summary.reveal')
394397
})
395398

396399
vscode.commands.registerCommand('aws.amazonq.transformationHub.reviewChanges.acceptChanges', async () => {

0 commit comments

Comments
 (0)