Skip to content

Commit f5bc3ed

Browse files
frankliu20app_modernizationwenytang-ms
authored
chore: update upgrade prompt after merging extension (#971)
* chore: update upgarde prompt after merging extension * fix * fix: address Copilot review comments --------- Co-authored-by: app_modernization <app_modernization@example.com> Co-authored-by: wenyt <75360946+wenytang-ms@users.noreply.github.com>
1 parent be62653 commit f5bc3ed

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ export namespace Commands {
167167
export const BUILD_PROJECT = "java.project.build";
168168

169169
/**
170-
* Commands from Java Upgrade Tool
170+
* Commands from appmod (Java Upgrade Tool)
171171
*/
172-
export const GOTO_AGENT_MODE = "javaupgrade.gotoAgentMode";
172+
export const GOTO_AGENT_MODE = "appmod.javaUpgrade.gotoAgentMode";
173173

174174
/**
175175
* Get the project settings

src/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export namespace Explorer {
3434
export namespace ExtensionName {
3535
export const JAVA_LANGUAGE_SUPPORT: string = "redhat.java";
3636
export const APP_MODERNIZATION_FOR_JAVA = "vscjava.migrate-java-to-azure";
37-
export const APP_MODERNIZATION_UPGRADE_FOR_JAVA = "vscjava.vscode-java-upgrade";
37+
// Java upgrade extension is merged into app modernization extension
38+
export const APP_MODERNIZATION_UPGRADE_FOR_JAVA = APP_MODERNIZATION_FOR_JAVA;
3839
export const APP_MODERNIZATION_EXTENSION_NAME = "GitHub Copilot app modernization";
3940
}
4041

src/upgrade/dependency.metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { Upgrade } from "../constants";
55
import { UpgradeReason, type DependencyCheckMetadata } from "./type";
66

7-
const MATURE_JAVA_LTS_VERSION = 21;
7+
const MATURE_JAVA_LTS_VERSION = 25;
88

99
export const DEPENDENCY_JAVA_RUNTIME = {
1010
"name": "Java Runtime",

src/upgrade/upgradeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class UpgradeManager {
2828
context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_UPGRADE_WITH_COPILOT, async (promptText?: string) => {
2929
await checkOrInstallAppModExtensionForUpgrade(ExtensionName.APP_MODERNIZATION_UPGRADE_FOR_JAVA);
3030
const promptToUse = promptText ?? DEFAULT_UPGRADE_PROMPT;
31-
await commands.executeCommand(Commands.GOTO_AGENT_MODE, { prompt: promptToUse });
31+
await commands.executeCommand(Commands.GOTO_AGENT_MODE, { prompt: promptToUse, useCustomAgent: true });
3232
}));
3333

3434
// Show modernization view

src/upgrade/utility.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function buildNotificationMessage(issue: UpgradeIssue, hasExtension: bool
3434
const upgradeWord = hasExtension ? "upgrade" : `install ${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension and upgrade`;
3535

3636
if (packageId === Upgrade.PACKAGE_ID_FOR_JAVA_RUNTIME) {
37-
return `This project is using an older Java runtime (${currentVersion}). Would you like to ${upgradeWord} it to ${suggestedVersionName} (LTS)?`;
37+
return `This project is using an older Java runtime (${currentVersion}). Would you like to ${upgradeWord} it to the latest LTS version?`;
3838
}
3939

4040
switch (reason) {
@@ -94,16 +94,15 @@ export function buildFixPrompt(issue: UpgradeIssue): string {
9494

9595
switch (reason) {
9696
case UpgradeReason.JRE_TOO_OLD: {
97-
const { suggestedVersion: { name: suggestedVersionName } } = issue;
98-
return `upgrade java runtime to the LTS version ${suggestedVersionName} using java upgrade tools by invoking #generate_upgrade_plan`;
97+
return `upgrade java runtime to the latest LTS version`;
9998
}
10099
case UpgradeReason.END_OF_LIFE:
101100
case UpgradeReason.DEPRECATED: {
102101
const { suggestedVersion: { name: suggestedVersionName } } = issue;
103-
return `upgrade ${packageDisplayName} to ${suggestedVersionName} using java upgrade tools by invoking #generate_upgrade_plan`;
102+
return `upgrade ${packageDisplayName} to ${suggestedVersionName}`;
104103
}
105104
case UpgradeReason.CVE: {
106-
return `fix all critical and high-severity CVE vulnerabilities in this project by invoking #validate_cves_for_java`;
105+
return `fix all critical and high-severity CVE vulnerabilities in this project by invoking #appmod-validate-cves-for-java`;
107106
}
108107
}
109108
}

0 commit comments

Comments
 (0)