Skip to content

Commit 3756a44

Browse files
committed
only including min java 17 upgrade patch message if source version not java 17
1 parent c4f965f commit 3756a44

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ export class Messenger {
177177
this.dispatcher.sendAsyncEventProgress(
178178
new AsyncEventProgressMessage(tabID, {
179179
inProgress: true,
180-
message: CodeWhispererConstants.userPatchDescriptionChatMessage,
180+
message: CodeWhispererConstants.userPatchDescriptionChatMessage(
181+
transformByQState.getSourceJDKVersion() === JDKVersion.JDK17
182+
),
181183
})
182184
)
183185

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

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,48 @@ export const chooseTransformationObjective = `I can help you with the following
507507

508508
export const chooseTransformationObjectivePlaceholder = 'Enter "language upgrade" or "sql conversion"'
509509

510-
export const userPatchDescriptionChatMessage = `
511-
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:
510+
// export const userPatchDescriptionChatMessage = (java17Source: boolean) => {
511+
// return `
512+
// 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:
512513

513-
• Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.
514+
// • Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.
514515

515-
• Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.
516+
// • Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.
516517

517-
• HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.
518+
// • HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.
518519

519-
• Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.
520+
// • Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.
520521

521-
• Miscellaneous Processing Documentation: Upgrades ORMs, XML processing, and Swagger to SpringDoc/OpenAPI.
522+
// • Miscellaneous Processing Documentation: Upgrades ORMs, XML processing, and Swagger to SpringDoc/OpenAPI.
522523

523-
• Deprecated API replacement, dependency upgrades, and formatting: Replaces deprecated APIs, makes additional dependency version upgrades, and formats code changes.
524-
`
524+
// • Deprecated API replacement, dependency upgrades, and formatting: Replaces deprecated APIs, makes additional dependency version upgrades, and formats code changes.
525+
// `
526+
// }
527+
528+
export const userPatchDescriptionChatMessage = (java17Source: boolean) => {
529+
const patches = [
530+
'• Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3.',
531+
'• HTTP Client Utilities Web Frameworks: HTTP client libraries, Apache Commons utilities, and Struts frameworks.',
532+
'• Testing Tools Frameworks: Testing tools like ArchUnit, Mockito, and TestContainers and build tools like Jenkins and Maven Wrapper.',
533+
'• Miscellaneous Processing Documentation: Upgrades ORMs, XML processing, and Swagger to SpringDoc/OpenAPI.',
534+
'• Deprecated API replacement, dependency upgrades, and formatting: Replaces deprecated APIs, makes additional dependency version upgrades, and formats code changes.',
535+
]
536+
537+
const intro =
538+
"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:"
539+
540+
const minUpgradeText =
541+
'• Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito.'
542+
543+
const bulletsList = java17Source ? patches : [minUpgradeText, ...patches]
544+
const bulletsText = bulletsList.join('\n\n')
545+
546+
return `
547+
${intro}
548+
549+
${bulletsText}
550+
`
551+
}
525552

526553
export const uploadingCodeStepMessage = 'Upload your code'
527554

0 commit comments

Comments
 (0)