diff --git a/CHANGELOG.md b/CHANGELOG.md index 1acf1c2f..b22546a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.22.0 (Unreleased) +### Added +- Announce that 0.23.0 will require Eclipse 2025-12 (4.38) or later and Java 21 or later to run Eclipse. + The 0.22.0 release retains existing environment compatibility and TM Terminal support. +- Show a startup reminder on affected environments, with a persistent "Don't remind me again" option. + This notice does not depend on sign-in or the automatic What's New setting. +- Document how users who cannot upgrade can install the last compatible 0.22.x release ZIP. + ## 0.21.0 ### Added - Support Ollama as a custom (BYOK) model provider. [#93](https://github.com/microsoft/copilot-for-eclipse/issues/93) diff --git a/README.md b/README.md index 31cddede..af297c28 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,30 @@ To use GitHub Copilot, an active subscription is required. Learn more about busi - [Eclipse IDE](https://www.eclipse.org/downloads/) - An active [GitHub Copilot subscription](https://github.com/features/copilot) +### Upcoming requirements in 0.23.0 + +Starting with **GitHub Copilot for Eclipse 0.23.0**, the minimum supported environment will be +**Eclipse IDE 2025-12 (4.38)** and **Java 21** to run Eclipse. This does not require changing the +Java version used by your projects. + +**0.22.0 is the advance-notice release and retains the existing environment compatibility, +including TM Terminal support.** On affected environments (Eclipse older than 4.38 or an Eclipse +Java runtime older than 21), a startup notice explains the upcoming requirements. It appears at +most once per Eclipse startup until you select **Don't remind me again** or upgrade your +environment. Dismissal applies to this announcement in the same Eclipse configuration, including +when switching workspaces, and is independent of the automatic What's New setting. + +Before upgrading to 0.23.0, update Eclipse and the Java runtime used to launch it. If necessary, +set the Eclipse launcher runtime using the `-vm` option in `eclipse.ini`; keep it before `-vmargs`. +Your project JDK and compiler settings can remain unchanged. + +If you cannot upgrade your environment, you can continue using the last compatible **0.22.x** +version. Once published, its `GithubCopilotForEclipse.zip` installation archive will remain +available from [GitHub Releases](https://github.com/microsoft/copilot-for-eclipse/releases). +Download the ZIP from the selected 0.22.x release, then use **Help > Install New Software... > +Add... > Archive...** to select it and install GitHub Copilot. The legacy version will not have +a separate online update site. + ## Install and set up ### Option 1: Eclipse Marketplace diff --git a/com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java b/com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java index 73817770..4ce1d6d5 100644 --- a/com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java +++ b/com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java @@ -51,6 +51,7 @@ private Constants() { public static final String AUTO_BREAKPOINT_RESPONSE = "autoBreakpointResponse"; public static final String GITHUB_JOBS_VIEW_ID = "com.microsoft.copilot.eclipse.ui.jobs.JobsView"; public static final String SUPPRESS_TERMINAL_DEPENDENCY_DIALOG = "suppressTerminalDependencyDialog"; + public static final String SUPPRESS_COMPATIBILITY_NOTICE_0_23 = "suppressCompatibilityNotice0.23"; // Auto-Approve settings public static final String AUTO_APPROVE_TERMINAL_RULES = "autoApproveTerminalRules"; diff --git a/com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/CompatibilityNoticeTest.java b/com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/CompatibilityNoticeTest.java new file mode 100644 index 00000000..c2e3cf40 --- /dev/null +++ b/com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/CompatibilityNoticeTest.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package com.microsoft.copilot.eclipse.ui; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.UUID; + +import org.eclipse.core.runtime.preferences.ConfigurationScope; +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.osgi.framework.Version; +import org.osgi.service.prefs.BackingStoreException; + +import com.microsoft.copilot.eclipse.core.Constants; + +class CompatibilityNoticeTest { + + private IEclipsePreferences preferences; + + @BeforeEach + void setUp() { + preferences = ConfigurationScope.INSTANCE.getNode("copilot.compatibility.test." + UUID.randomUUID()); + } + + @AfterEach + void tearDown() throws BackingStoreException { + var parent = preferences.parent(); + preferences.removeNode(); + parent.flush(); + } + + @Test + void testShouldShow_eclipse437WithJava21_returnsTrue() { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertTrue(notice.shouldShow(new Version(4, 37, 99, "release"), 21)); + } + + @Test + void testShouldShow_eclipse438WithJava20_returnsTrue() { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertTrue(notice.shouldShow(new Version(4, 38, 0), 20)); + } + + @Test + void testDismiss_nextStartupWithOldEnvironment_doesNotShow() throws BackingStoreException { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + notice.dismiss(); + + CompatibilityNotice nextStartup = new CompatibilityNotice( + ConfigurationScope.INSTANCE.getNode(preferences.name())); + + assertFalse(nextStartup.shouldShow(new Version(4, 37, 0), 17)); + } + + @Test + void testShouldShow_unknownPlatformWithJava17_returnsTrue() { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertTrue(notice.shouldShow(null, 17)); + } + + @ParameterizedTest + @CsvSource({"4.38.0, 21", "4.38.1.release, 21", "4.40.0, 25", "5.0.0, 21"}) + void testShouldShow_supportedEnvironment_returnsFalse(String platformVersion, int javaFeature) { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertFalse(notice.shouldShow(Version.parseVersion(platformVersion), javaFeature)); + } + + @Test + void testShouldShow_unknownPlatformWithJava21_doesNotAssumeUnsupportedPlatform() { + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertFalse(notice.shouldShow(null, 21)); + } + + @Test + void testShouldShow_nextStartupWithoutDismissal_returnsTrue() { + new CompatibilityNotice(preferences).shouldShow(new Version(4, 37, 0), 21); + + CompatibilityNotice nextStartup = new CompatibilityNotice(preferences); + + assertTrue(nextStartup.shouldShow(new Version(4, 37, 0), 21)); + } + + @Test + void testShouldShow_otherNoticesDisabled_returnsTrue() { + preferences.putBoolean(Constants.AUTO_SHOW_WHAT_IS_NEW, false); + preferences.putBoolean(Constants.SUPPRESS_TERMINAL_DEPENDENCY_DIALOG, true); + CompatibilityNotice notice = new CompatibilityNotice(preferences); + + assertTrue(notice.shouldShow(new Version(4, 37, 0), 21)); + } +} diff --git a/com.microsoft.copilot.eclipse.ui/intro/whatsnew/WHATISNEW.md b/com.microsoft.copilot.eclipse.ui/intro/whatsnew/WHATISNEW.md index feef388f..c1a4b3c8 100644 --- a/com.microsoft.copilot.eclipse.ui/intro/whatsnew/WHATISNEW.md +++ b/com.microsoft.copilot.eclipse.ui/intro/whatsnew/WHATISNEW.md @@ -1,3 +1,23 @@ +# GitHub Copilot 0.22.0 Release Notes + +### Upcoming Eclipse and Java Requirements + +Starting with **GitHub Copilot for Eclipse 0.23.0**, you will need **Eclipse IDE 2025-12 (4.38) or +later** and **Java 21 or later to run Eclipse**. Your projects can continue using their existing +Java versions. + +**0.22.0 keeps the existing environment compatibility, including TM Terminal support**, so you +have one release to prepare. If your Eclipse or its Java runtime is below the future minimum, a +reminder appears at most once per Eclipse startup. Select **Don't remind me again** to stop +reminders for this announcement in the same Eclipse configuration. Upgrading your environment +also stops the reminder. + +If you cannot upgrade, the last compatible 0.22.x installation ZIP will remain available in +[GitHub Releases](https://github.com/microsoft/copilot-for-eclipse/releases) once published. +See the [requirements and installation guidance](https://github.com/microsoft/copilot-for-eclipse#upcoming-requirements-in-0230). + +--- + # GitHub Copilot 0.21.0 Release Notes ### Use Ollama Models with BYOK diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/CompatibilityNotice.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/CompatibilityNotice.java new file mode 100644 index 00000000..21272c80 --- /dev/null +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/CompatibilityNotice.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package com.microsoft.copilot.eclipse.ui; + +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.osgi.framework.Version; +import org.osgi.service.prefs.BackingStoreException; + +import com.microsoft.copilot.eclipse.core.Constants; + +/** + * Determines whether the current environment needs the 0.23 compatibility announcement. + */ +public final class CompatibilityNotice { + + private static final Version MINIMUM_ECLIPSE_VERSION = new Version(4, 38, 0); + private static final int MINIMUM_JAVA_FEATURE = 21; + + private final IEclipsePreferences preferences; + + /** + * Creates an announcement using configuration-scoped dismissal preferences. + * + * @param preferences the preferences shared by workspaces in this Eclipse configuration + */ + public CompatibilityNotice(IEclipsePreferences preferences) { + this.preferences = preferences; + } + + /** + * Checks whether the current environment will be unsupported in version 0.23.0. + * + * @param platformVersion the version of the org.eclipse.platform bundle, or null when unavailable + * @param javaFeature the Java feature version used to run Eclipse, not the project JDK + * @return whether the announcement should be displayed + */ + public boolean shouldShow(Version platformVersion, int javaFeature) { + return !preferences.getBoolean(Constants.SUPPRESS_COMPATIBILITY_NOTICE_0_23, false) + && (javaFeature < MINIMUM_JAVA_FEATURE + || platformVersion != null && platformVersion.compareTo(MINIMUM_ECLIPSE_VERSION) < 0); + } + + /** + * Persists dismissal of this announcement. Call outside the UI thread because preferences are flushed to disk. + * + * @throws BackingStoreException if the dismissal cannot be persisted + */ + public void dismiss() throws BackingStoreException { + preferences.putBoolean(Constants.SUPPRESS_COMPATIBILITY_NOTICE_0_23, true); + preferences.flush(); + } +} diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/StartUp.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/StartUp.java index 9a76a98d..26823878 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/StartUp.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/StartUp.java @@ -3,7 +3,22 @@ package com.microsoft.copilot.eclipse.ui; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.core.runtime.preferences.ConfigurationScope; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.ui.IStartup; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.Bundle; +import org.osgi.framework.Version; +import org.osgi.service.prefs.BackingStoreException; + +import com.microsoft.copilot.eclipse.core.CopilotCore; +import com.microsoft.copilot.eclipse.ui.dialogs.Messages; +import com.microsoft.copilot.eclipse.ui.utils.SwtUtils; /** * Early startup the Copilot for Eclipse plugin. @@ -12,7 +27,55 @@ public class StartUp implements IStartup { @Override public void earlyStartup() { - // do nothing. + Bundle platform = Platform.getBundle("org.eclipse.platform"); + if (platform == null) { + Platform.getLog(CopilotUi.getPlugin().getBundle()) + .log(Status.warning("Cannot determine the Eclipse platform version for the compatibility notice.")); + } + + Version platformVersion = platform == null ? null : platform.getVersion(); + int javaFeature = Runtime.version().feature(); + CompatibilityNotice notice = new CompatibilityNotice( + ConfigurationScope.INSTANCE.getNode(CopilotUi.getPlugin().getBundle().getSymbolicName())); + if (!notice.shouldShow(platformVersion, javaFeature)) { + return; + } + + SwtUtils.invokeOnDisplayThreadAsync(() -> { + if (PlatformUI.getWorkbench().isClosing() || !notice.shouldShow(platformVersion, javaFeature)) { + return; + } + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) { + IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); + if (windows.length == 0) { + CopilotCore.LOGGER.error( + new IllegalStateException("No workbench window is available for the compatibility notice.")); + return; + } + window = windows[0]; + } + if (window.getShell().isDisposed()) { + return; + } + + MessageDialogWithToggle dialog = MessageDialogWithToggle.openInformation(window.getShell(), + Messages.compatibilityNotice_title, Messages.compatibilityNotice_message, + Messages.compatibilityNotice_dontRemindAgain, false, null, null); + if (dialog.getReturnCode() == IDialogConstants.OK_ID && dialog.getToggleState()) { + Job savePreference = Job.create(Messages.compatibilityNotice_saveJobName, monitor -> { + try { + notice.dismiss(); + return Status.OK_STATUS; + } catch (BackingStoreException e) { + CopilotCore.LOGGER.error("Failed to persist compatibility notice dismissal", e); + return Status.error("Failed to persist compatibility notice dismissal", e); + } + }); + savePreference.setSystem(true); + savePreference.schedule(); + } + }); } } diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/Messages.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/Messages.java index 29fee450..769f94ad 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/Messages.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/Messages.java @@ -30,6 +30,11 @@ public final class Messages extends NLS { public static String terminalDependencyDialog_helpLink; public static String terminalDependencyDialog_dontShowAgain; + public static String compatibilityNotice_title; + public static String compatibilityNotice_message; + public static String compatibilityNotice_dontRemindAgain; + public static String compatibilityNotice_saveJobName; + static { // initialize resource bundle NLS.initializeMessages("com.microsoft.copilot.eclipse.ui.dialogs.messages", Messages.class); diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/messages.properties b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/messages.properties index 69e7eadd..8d7d1f33 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/messages.properties +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/messages.properties @@ -18,3 +18,8 @@ terminalDependencyDialog_missingDependencies=Missing dependencies: terminalDependencyDialog_instruction=To enable terminal support, please install the {0} from your Eclipse update site. terminalDependencyDialog_helpLink=Learn how to install terminal support terminalDependencyDialog_dontShowAgain=Don''t show this message again + +compatibilityNotice_title=GitHub Copilot Compatibility Update +compatibilityNotice_message=Starting with GitHub Copilot for Eclipse 0.23.0, you will need Eclipse IDE 2025-12 (4.38) or later and Java 21 or later to run Eclipse.\n\nYour projects can keep their existing Java versions. This version of Copilot still supports your current environment.\n\nPlease upgrade Eclipse and its Java runtime before updating to 0.23.0. If you cannot upgrade, continue using the last compatible 0.22.x release ZIP from GitHub Releases. +compatibilityNotice_dontRemindAgain=Don't remind me again +compatibilityNotice_saveJobName=Save Copilot compatibility notice preference