Skip to content

Commit b4d7417

Browse files
authored
feat(amazon q): removing feature flag for selective transformation and confirmed string changes (aws#6084)
## Problem Selective transformation changes were released under an IDE feature flag due to backend changes that needed to be fixed. ## Solution In this PR, we are removing the feature flag on the IDE side so the users will now be able to see the form to select if they want to view their changes in one or multiple diffs. If they select multiple diffs in this form, then selective transformation will be invoked. --- <!--- REMINDER: Ensure that your PR meets the guidelines in CONTRIBUTING.md --> License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent db097d0 commit b4d7417

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Feature(Amazon Q Code Transformation): allow users to view results in 5 smaller diffs"
4+
}

packages/core/src/amazonqGumby/chat/controller/controller.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import { getStringHash } from '../../../shared/utilities/textUtilities'
6262
import { getVersionData } from '../../../codewhisperer/service/transformByQ/transformMavenHandler'
6363
import AdmZip from 'adm-zip'
6464
import { AuthError } from '../../../auth/sso/server'
65-
import { isSelectiveTransformationReady } from '../../../dev/config'
6665

6766
// These events can be interactions within the chat,
6867
// or elsewhere in the IDE
@@ -424,18 +423,15 @@ export class GumbyController {
424423
result: MetadataResult.Pass,
425424
})
426425
this.messenger.sendSkipTestsSelectionMessage(skipTestsSelection, message.tabID)
427-
if (!isSelectiveTransformationReady) {
428-
// perform local build
429-
await this.validateBuildWithPromptOnError(message)
430-
} else {
431-
await this.messenger.sendOneOrMultipleDiffsPrompt(message.tabID)
432-
}
426+
await this.messenger.sendOneOrMultipleDiffsPrompt(message.tabID)
433427
}
434428

435429
private async handleOneOrMultipleDiffs(message: any) {
436430
const oneOrMultipleDiffsSelection = message.formSelectedValues['GumbyTransformOneOrMultipleDiffsForm']
437431
if (oneOrMultipleDiffsSelection === CodeWhispererConstants.multipleDiffsMessage) {
438432
transformByQState.setMultipleDiffs(true)
433+
} else {
434+
transformByQState.setMultipleDiffs(false)
439435
}
440436
this.messenger.sendOneOrMultipleDiffsMessage(oneOrMultipleDiffsSelection, message.tabID)
441437
// perform local build

packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ export class Messenger {
603603
}
604604

605605
public sendOneOrMultipleDiffsMessage(selectiveTransformationSelection: string, tabID: string) {
606-
const message = `Okay, I will create ${selectiveTransformationSelection.toLowerCase()} when providing the proposed changes.`
606+
const message = `Okay, I will create ${selectiveTransformationSelection.toLowerCase()} with my proposed changes.`
607607
this.dispatcher.sendChatMessage(new ChatMessage({ message, messageType: 'ai-prompt' }, tabID))
608608
}
609609

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ const patchDescriptions: { [key: string]: string } = {
2828
'Popular Enterprise Specifications and Application Frameworks upgrade':
2929
'This diff patch covers the set of upgrades for Jakarta EE 10, Hibernate 6.2, and Micronaut 3.',
3030
'HTTP Client Utilities, Apache Commons Utilities, and Web Frameworks':
31-
'This diff patch covers the set of upgrades for Apache HTTP Client 5, Apache Commons utilities (Collections, IO, Lang, Math), Struts 6.0.',
31+
'This diff patch covers the set of upgrades for Apache HTTP Client 5, Apache Commons utilities (Collections, IO, Lang, Math), and Struts 6.0.',
3232
'Testing Tools and Frameworks upgrade':
33-
'This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, Cucumber, and additionally, Jenkins plugins and the Maven Wrapper.',
33+
'This diff patch covers the set of upgrades for ArchUnit, Mockito, TestContainers, and Cucumber, in addition to the Jenkins plugins and the Maven Wrapper.',
3434
'Miscellaneous Processing Documentation upgrade':
3535
'This diff patch covers a diverse set of upgrades spanning ORMs, XML processing, API documentation, and more.',
3636
'Deprecated API replacement, dependency upgrades, and formatting':
@@ -470,7 +470,7 @@ export const chooseTransformationObjective = `I can help you with the following
470470
export const chooseTransformationObjectivePlaceholder = 'Enter "language upgrade" or "sql conversion"'
471471

472472
export const userPatchDescriptionChatMessage = `
473-
I can now divide the transformation results into diff patches (if applicable to the app) if you would like to review and accept each diff with fewer changes:
473+
If you'd like to update and test your code with fewer changes at a time, I can divide the transformation results into separate diff patches. If applicable to your application, I can split up the diffs up into the following groups of upgrades. Here are the upgrades included in each diff:
474474
475475
• Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.
476476
@@ -616,16 +616,16 @@ export const jobCancelledNotification = 'You cancelled the transformation.'
616616

617617
export const diffMessage = (multipleDiffs: boolean) => {
618618
return multipleDiffs
619-
? 'You can review the diff to see my proposed changes and accept or reject them. If you reject the diff, you will not be able to see the diffs later.'
619+
? 'You can review the diffs to see my proposed changes and accept or reject them. You will be able to accept changes from one diff at a time. If you reject changes in one diff, you will not be able to view or accept changes in the other diffs.'
620620
: 'You can review the diff to see my proposed changes and accept or reject them.'
621621
}
622622

623623
export const jobCompletedChatMessage = (multipleDiffsString: string) => {
624-
return `I transformed your code. ${multipleDiffsString} The transformation summary has details about the files I updated.`
624+
return `I completed your transformation. ${multipleDiffsString} The transformation summary has details about the changes I'm proposing.`
625625
}
626626

627627
export const jobCompletedNotification = (multipleDiffsString: string) => {
628-
return `Amazon Q transformed your code. ${multipleDiffsString} The transformation summary has details about the files I updated.`
628+
return `Amazon Q transformed your code. ${multipleDiffsString} The transformation summary has details about the changes.`
629629
}
630630

631631
export const jobPartiallyCompletedChatMessage = (multipleDiffsString: string) => {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ export class TransformByQState {
808808
this.errorLog = ''
809809
this.customBuildCommand = ''
810810
this.intervalId = undefined
811+
this.produceMultipleDiffs = false
811812
}
812813
}
813814

packages/core/src/dev/config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,3 @@ export const betaUrl = {
1010
amazonq: '',
1111
toolkit: '',
1212
}
13-
14-
//feature flag for Selective Transformation
15-
export const isSelectiveTransformationReady = false

0 commit comments

Comments
 (0)