Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export namespace Commands {
/**
* Commands from Java Upgrade Tool
*/
export const GOTO_AGENT_MODE = "javaupgrade.gotoAgentMode";
export const GOTO_AGENT_MODE = "appmod.javaUpgrade.gotoAgentMode";

/**
* Get the project settings
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export namespace Explorer {
export namespace ExtensionName {
export const JAVA_LANGUAGE_SUPPORT: string = "redhat.java";
export const APP_MODERNIZATION_FOR_JAVA = "vscjava.migrate-java-to-azure";
export const APP_MODERNIZATION_UPGRADE_FOR_JAVA = "vscjava.vscode-java-upgrade";
// Java upgarde extension is merged into app modernization extension
export const APP_MODERNIZATION_UPGRADE_FOR_JAVA = "vscjava.migrate-java-to-azure";
export const APP_MODERNIZATION_EXTENSION_NAME = "GitHub Copilot app modernization";
}

Expand Down
2 changes: 1 addition & 1 deletion src/upgrade/dependency.metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Upgrade } from "../constants";
import { UpgradeReason, type DependencyCheckMetadata } from "./type";

const MATURE_JAVA_LTS_VERSION = 21;
const MATURE_JAVA_LTS_VERSION = 25;

export const DEPENDENCY_JAVA_RUNTIME = {
"name": "Java Runtime",
Expand Down
2 changes: 1 addition & 1 deletion src/upgrade/upgradeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UpgradeManager {
context.subscriptions.push(instrumentOperationAsVsCodeCommand(Commands.JAVA_UPGRADE_WITH_COPILOT, async (promptText?: string) => {
await checkOrInstallAppModExtensionForUpgrade(ExtensionName.APP_MODERNIZATION_UPGRADE_FOR_JAVA);
const promptToUse = promptText ?? DEFAULT_UPGRADE_PROMPT;
await commands.executeCommand(Commands.GOTO_AGENT_MODE, { prompt: promptToUse });
await commands.executeCommand(Commands.GOTO_AGENT_MODE, { prompt: promptToUse, useCustomAgent: true });
}));

// Show modernization view
Expand Down
9 changes: 4 additions & 5 deletions src/upgrade/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function buildNotificationMessage(issue: UpgradeIssue, hasExtension: bool
const upgradeWord = hasExtension ? "upgrade" : `install ${ExtensionName.APP_MODERNIZATION_EXTENSION_NAME} extension and upgrade`;

if (packageId === Upgrade.PACKAGE_ID_FOR_JAVA_RUNTIME) {
return `This project is using an older Java runtime (${currentVersion}). Would you like to ${upgradeWord} it to ${suggestedVersionName} (LTS)?`;
return `This project is using an older Java runtime (${currentVersion}). Would you like to ${upgradeWord} it to a newer LTS version?`;
}

switch (reason) {
Expand Down Expand Up @@ -94,16 +94,15 @@ export function buildFixPrompt(issue: UpgradeIssue): string {

switch (reason) {
case UpgradeReason.JRE_TOO_OLD: {
const { suggestedVersion: { name: suggestedVersionName } } = issue;
return `upgrade java runtime to the LTS version ${suggestedVersionName} using java upgrade tools by invoking #generate_upgrade_plan`;
return `upgrade java runtime to the latest LTS version`;
}
case UpgradeReason.END_OF_LIFE:
case UpgradeReason.DEPRECATED: {
const { suggestedVersion: { name: suggestedVersionName } } = issue;
return `upgrade ${packageDisplayName} to ${suggestedVersionName} using java upgrade tools by invoking #generate_upgrade_plan`;
return `upgrade ${packageDisplayName} to ${suggestedVersionName}`;
}
case UpgradeReason.CVE: {
return `fix all critical and high-severity CVE vulnerabilities in this project by invoking #validate_cves_for_java`;
return `fix all critical and high-severity CVE vulnerabilities in this project by invoking #appmod-validate-cves-for-java`;
}
}
}
Expand Down
Loading