Skip to content

Commit 4d462e2

Browse files
dhasani23David Hasani
andauthored
fix(amazonq): show correct diff after consecutive transformations (#6238)
## Problem If a user runs a transformation, rejects changes, then immediately runs another transformation on the same project (rare, but it happens), we attempt to show the user the old diff (which has already been deleted at this point). ## Solution Reset `patchFiles` before showing the user the patch file. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: David Hasani <[email protected]>
1 parent 0609e5b commit 4d462e2

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
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": "Fix(Amazon Q Code Transformation): show correct diff when running consecutive transformations"
4+
}

packages/core/src/amazonq/webview/ui/quickActions/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class QuickActionGenerator {
8686
? [
8787
{
8888
command: '/transform',
89-
description: 'Transform your Java 8, 11, or 17 Maven projects',
89+
description: 'Transform your Java project',
9090
icon: MynahIcons.TRANSFORM,
9191
},
9292
]

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ export const absolutePathDetectedMessage = (numPaths: number, buildFile: string,
579579
`I detected ${numPaths} potential absolute file path(s) in your ${buildFile} file: **${listOfPaths}**. Absolute file paths might cause issues when I build your code. Any errors will show up in the build log.`
580580

581581
export const selectSQLMetadataFileHelpMessage =
582-
'Okay, I can convert the embedded SQL code for your Oracle to PostgreSQL transformation. To get started, upload the zipped metadata file from your schema conversion in AWS Data Migration Service (DMS). To retrieve the metadata file:\n1. Open your database migration project in the AWS DMS console.\n2. Open the schema conversion and choose **Convert the embedded SQL in your application**.\n3. Choose the link to Amazon S3 console.\n\nYou can download the metadata file from the {schema-conversion-project}/ directory. For more info, refer to the [documentation](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-save-apply.html#schema-conversion-save).'
582+
'Okay, I can convert the embedded SQL code for your Oracle to PostgreSQL transformation. To get started, upload the zipped metadata file from your schema conversion in AWS Data Migration Service (DMS). To retrieve the metadata file:\n1. Open your database migration project in the AWS DMS console.\n2. Open the schema conversion and choose **Convert the embedded SQL in your application**.\n3. Once you complete the conversion, close the project and go to the S3 bucket where your project is stored.\n4. Open the folder and find the project folder ("sct-project").\n5. Download the object inside the project folder. This will be a zip file.\n\nFor more info, refer to the [documentation](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-save-apply.html#schema-conversion-save).'
583583

584584
export const invalidMetadataFileUnsupportedSourceDB =
585585
'I can only convert SQL for migrations from an Oracle source database. The provided .sct file indicates another source database for this migration.'

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class ProposedTransformationExplorer {
325325
treeDataProvider: transformDataProvider,
326326
})
327327

328-
const patchFiles: string[] = []
328+
let patchFiles: string[] = []
329329
let singlePatchFile: string = ''
330330
let patchFilesDescriptions: DescriptionContent | undefined = undefined
331331

@@ -430,6 +430,7 @@ export class ProposedTransformationExplorer {
430430

431431
let deserializeErrorMessage = undefined
432432
let pathContainingArchive = ''
433+
patchFiles = [] // reset patchFiles if there was a previous transformation
433434
try {
434435
// Download and deserialize the zip
435436
pathContainingArchive = path.dirname(pathToArchive)

0 commit comments

Comments
 (0)