-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(amazonq): java21 support #6414
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,12 @@ export const AWSTemplateKeyWords = ['AWSTemplateFormatVersion', 'Resources', 'AW | |
|
||
export const AWSTemplateCaseInsensitiveKeyWords = ['cloudformation', 'cfn', 'template', 'description'] | ||
|
||
// TO-DO: make sure all Strings look good for Java 21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you still working on this TODO or did we just want to keep it in? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strings should be good, will remove this comment when confirmed |
||
const patchDescriptions: { [key: string]: string } = { | ||
'Prepare minimal upgrade to Java 17': | ||
'This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks.', | ||
'This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks in Java 17.', | ||
'Prepare minimal upgrade to Java 21': | ||
'This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks in Java 21.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't looked at the closures for java 21 (I can look), but assuming they make the same corresponding upgrades as the first patch for java 17 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes will confirm, but that should be true |
||
'Popular Enterprise Specifications and Application Frameworks upgrade': | ||
'This diff patch covers the set of upgrades for Jakarta EE 10, Hibernate 6.2, and Micronaut 3.', | ||
'HTTP Client Utilities, Apache Commons Utilities, and Web Frameworks': | ||
|
@@ -505,14 +508,14 @@ export const codeTransformLocThreshold = 100000 | |
export const jobStartedChatMessage = | ||
'I am starting to transform your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your project. To monitor progress, go to the Transformation Hub. If I run into any issues, I might pause the transformation to get input from you on how to proceed.' | ||
|
||
export const chooseTransformationObjective = `I can help you with the following tasks:\n- Upgrade your Java 8 and Java 11 codebases to Java 17, or upgrade Java 17 code with up to date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS. [Learn more](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-embedded-sql.html).\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".` | ||
export const chooseTransformationObjective = `I can help you with the following tasks:\n- Upgrade your Java 8, Java 11, and Java 17 codebases to Java 17 or Java 21.\n- Upgrade Java 17 or Java 21 code with up-to-date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS. [Learn more](https://docs.aws.amazon.com/dms/latest/userguide/schema-conversion-embedded-sql.html).\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".` | ||
|
||
export const chooseTransformationObjectivePlaceholder = 'Enter "language upgrade" or "sql conversion"' | ||
|
||
export const userPatchDescriptionChatMessage = ` | ||
export const userPatchDescriptionChatMessage = (version: string) => ` | ||
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: | ||
|
||
• Minimal Compatible Library Upgrade to Java 17: Dependencies to the minimum compatible versions in Java 17, including Springboot, JUnit, and PowerMockito. | ||
• Minimal Compatible Library Upgrade to Java ${version}: Dependencies to the minimum compatible versions in Java ${version}, including Springboot, JUnit, and PowerMockito. | ||
|
||
• Popular Enterprise Specifications Application Frameworks: Popular enterprise and application frameworks like Jakarta EE, Hibernate, and Micronaut 3. | ||
|
||
|
@@ -597,6 +600,9 @@ export const invalidMetadataFileErrorParsing = | |
export const invalidMetadataFileNoSctFile = | ||
"An .sct file is required for transformation. Make sure that you've uploaded the .zip file you retrieved from your schema conversion in AWS DMS." | ||
|
||
export const invalidFromToJdkChatMessage = | ||
"I can't transform a project from Java 21 to Java 17, but I can upgrade Java 21 code with up to date libraries and other dependencies. Try again with a supported language upgrade." | ||
|
||
export const sqlMetadataFileReceived = | ||
'I found the following source database, target database, and host based on the schema conversion metadata you provided:' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,6 +436,9 @@ | |
export async function startJob(uploadId: string) { | ||
const sourceLanguageVersion = `JAVA_${transformByQState.getSourceJDKVersion()}` | ||
const targetLanguageVersion = `JAVA_${transformByQState.getTargetJDKVersion()}` | ||
// TO-DO: remove these logs statements | ||
console.log('sourceLanguageVersion', sourceLanguageVersion) | ||
Check failure on line 440 in packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts GitHub Actions / lint (18.x, stable)
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming you'll be removing these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops I just saw the GitHub comments my bad! |
||
console.log('targetLanguageVersion', targetLanguageVersion) | ||
Check failure on line 441 in packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts GitHub Actions / lint (18.x, stable)
|
||
try { | ||
const response = await codeWhisperer.codeWhispererClient.codeModernizerStartCodeTransformation({ | ||
workspaceState: { | ||
|
@@ -445,7 +448,7 @@ | |
transformationSpec: { | ||
transformationType: CodeWhispererConstants.transformationType, // shared b/w language upgrades & sql conversions for now | ||
source: { language: sourceLanguageVersion }, // dummy value of JDK8 used for SQL conversions just so that this API can be called | ||
target: { language: targetLanguageVersion }, // always JDK17 | ||
target: { language: targetLanguageVersion }, // JAVA_17 or JAVA_21 | ||
}, | ||
}) | ||
getLogger().info('CodeTransformation: called startJob API successfully') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why block this but allow other downgrades? e.g. 21 -> 11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this one is possible
The source Java versions we show in dropdown form are: 8, 11, 17, 21
The target Java versions we show in dropdown form are: 17, 21
So the only downgrade possible for user to select is 21 -> 17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in other words you don't allow downgrades. This is a confusing if statement if that is the original intent, can we maybe check that source version is not >= target version? Or a comment at the very least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added another comment to make it more specific but after that LGTM