From 74b1b80e6c7843b7ba46e98ad940d5f6c0f40519 Mon Sep 17 00:00:00 2001 From: Tobias Hahnen Date: Wed, 22 Jan 2025 10:20:18 +0100 Subject: [PATCH 1/4] NO-JIRA: Fix SonarQube Server issue --- .../eclipse/core/internal/markers/MarkerUtilsTest.java | 2 +- .../resources/SonarLintProjectConfigurationManagerTest.java | 2 +- .../sonarlint/eclipse/core/internal/SonarLintCorePlugin.java | 2 +- .../preferences/SonarLintProjectConfigurationManager.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/markers/MarkerUtilsTest.java b/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/markers/MarkerUtilsTest.java index 1783546ba..32e3a489a 100644 --- a/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/markers/MarkerUtilsTest.java +++ b/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/markers/MarkerUtilsTest.java @@ -43,7 +43,7 @@ public class MarkerUtilsTest extends SonarTestCase { public static void importProject() throws Exception { project = importEclipseProject("SimpleProject"); // Configure the project - SonarLintCorePlugin.getInstance().getProjectConfigManager().load(new ProjectScope(project), "A Project"); + SonarLintCorePlugin.getInstance().getProjectConfigManager().load(new ProjectScope(project)); } /** While we couldn't test this via integration tests, this must do it otherwise promotion failed due to SQ QG failing */ diff --git a/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/resources/SonarLintProjectConfigurationManagerTest.java b/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/resources/SonarLintProjectConfigurationManagerTest.java index 1ddd02bc2..0dc129b5a 100644 --- a/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/resources/SonarLintProjectConfigurationManagerTest.java +++ b/org.sonarlint.eclipse.core.tests/src/test/java/org/sonarlint/eclipse/core/internal/resources/SonarLintProjectConfigurationManagerTest.java @@ -68,7 +68,7 @@ public void settings_are_written_to_disk() throws IOException, CoreException, In var project = importEclipseProject("SimpleProject"); var projectScope = new ProjectScope(project); assertThat(projectScope.getLocation().append("org.sonarlint.eclipse.core.prefs").toFile()).doesNotExist(); - var configuration = SonarLintCorePlugin.getInstance().getProjectConfigManager().load(projectScope, "SimpleProject"); + var configuration = SonarLintCorePlugin.getInstance().getProjectConfigManager().load(projectScope); configuration.setAutoEnabled(false); configuration.setBindingSuggestionsDisabled(true); configuration.setProjectBinding(new EclipseProjectBinding("myServer", "myProjectKey")); diff --git a/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/SonarLintCorePlugin.java b/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/SonarLintCorePlugin.java index 1d000d7a1..853bd1cdf 100644 --- a/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/SonarLintCorePlugin.java +++ b/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/SonarLintCorePlugin.java @@ -112,7 +112,7 @@ public static synchronized ConnectionManager getConnectionManager() { } public static SonarLintProjectConfiguration loadConfig(ISonarLintProject project) { - return getInstance().getProjectConfigManager().load(project.getScopeContext(), project.getName()); + return getInstance().getProjectConfigManager().load(project.getScopeContext()); } public static void saveConfig(ISonarLintProject project, SonarLintProjectConfiguration config) { diff --git a/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/preferences/SonarLintProjectConfigurationManager.java b/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/preferences/SonarLintProjectConfigurationManager.java index b9073ecde..0cbd6151e 100644 --- a/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/preferences/SonarLintProjectConfigurationManager.java +++ b/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/preferences/SonarLintProjectConfigurationManager.java @@ -65,7 +65,7 @@ public static void registerPreferenceChangeListenerForBindingProperties(ISonarLi }); } - public SonarLintProjectConfiguration load(IScopeContext projectScope, String projectName) { + public SonarLintProjectConfiguration load(IScopeContext projectScope) { var projectNode = projectScope.getNode(SonarLintCorePlugin.PLUGIN_ID); var projectConfig = new SonarLintProjectConfiguration(); if (projectNode == null) { From 36ceda5ee0b6e35a75a4318dc11a15a9ad19380f Mon Sep 17 00:00:00 2001 From: Tobias Hahnen Date: Wed, 22 Jan 2025 10:22:57 +0100 Subject: [PATCH 2/4] SLE-1046: Remove dependency on Eclipse PDT PHP projects can run (and be analyzed) without having it installed. Remove the dependency and the experimental logic around it (`RequiresExtraDependency`). --- .../reddeer/perspectives/PhpPerspective.java | 30 ------------------- .../its.ibuilds.product | 1 - .../its.standalone.product | 1 - .../standalone/RequiresExtraDependency.java | 24 --------------- .../standalone/StandaloneAnalysisTest.java | 10 ------- target-platforms/latest-java-17_e431.target | 1 - target-platforms/latest-java-21.target | 1 - target-platforms/oldest-java-11_e417.target | 1 - 8 files changed, 69 deletions(-) delete mode 100644 its/org.sonarlint.eclipse.its.shared/src/org/sonarlint/eclipse/its/shared/reddeer/perspectives/PhpPerspective.java delete mode 100644 its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/RequiresExtraDependency.java diff --git a/its/org.sonarlint.eclipse.its.shared/src/org/sonarlint/eclipse/its/shared/reddeer/perspectives/PhpPerspective.java b/its/org.sonarlint.eclipse.its.shared/src/org/sonarlint/eclipse/its/shared/reddeer/perspectives/PhpPerspective.java deleted file mode 100644 index 6c862e9b4..000000000 --- a/its/org.sonarlint.eclipse.its.shared/src/org/sonarlint/eclipse/its/shared/reddeer/perspectives/PhpPerspective.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarLint for Eclipse ITs - * Copyright (C) 2009-2025 SonarSource SA - * sonarlint@sonarsource.com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonarlint.eclipse.its.shared.reddeer.perspectives; - -import org.eclipse.reddeer.eclipse.ui.perspectives.AbstractPerspective; - -public class PhpPerspective extends AbstractPerspective { - - public PhpPerspective() { - super("PHP"); - } - -} diff --git a/its/org.sonarlint.eclipse.its.standalone/its.ibuilds.product b/its/org.sonarlint.eclipse.its.standalone/its.ibuilds.product index b8495f7a5..32328ed05 100644 --- a/its/org.sonarlint.eclipse.its.standalone/its.ibuilds.product +++ b/its/org.sonarlint.eclipse.its.standalone/its.ibuilds.product @@ -41,7 +41,6 @@ - diff --git a/its/org.sonarlint.eclipse.its.standalone/its.standalone.product b/its/org.sonarlint.eclipse.its.standalone/its.standalone.product index 21b7cd52e..cdf1d4502 100644 --- a/its/org.sonarlint.eclipse.its.standalone/its.standalone.product +++ b/its/org.sonarlint.eclipse.its.standalone/its.standalone.product @@ -33,7 +33,6 @@ - diff --git a/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/RequiresExtraDependency.java b/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/RequiresExtraDependency.java deleted file mode 100644 index 6db08aeb9..000000000 --- a/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/RequiresExtraDependency.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * SonarLint for Eclipse ITs - * Copyright (C) 2009-2025 SonarSource SA - * sonarlint@sonarsource.com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonarlint.eclipse.its.standalone; - -public interface RequiresExtraDependency { - -} diff --git a/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/StandaloneAnalysisTest.java b/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/StandaloneAnalysisTest.java index 5613b3f2b..69a8b2c8c 100644 --- a/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/StandaloneAnalysisTest.java +++ b/its/org.sonarlint.eclipse.its.standalone/src/org/sonarlint/eclipse/its/standalone/StandaloneAnalysisTest.java @@ -33,9 +33,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.reddeer.common.wait.TimePeriod; import org.eclipse.reddeer.common.wait.WaitUntil; -import org.eclipse.reddeer.common.wait.WaitWhile; import org.eclipse.reddeer.eclipse.condition.ProjectExists; import org.eclipse.reddeer.eclipse.jdt.ui.packageview.PackageExplorerPart; import org.eclipse.reddeer.eclipse.ui.dialogs.PropertyDialog; @@ -45,26 +43,22 @@ import org.eclipse.reddeer.swt.impl.link.DefaultLink; import org.eclipse.reddeer.swt.impl.menu.ContextMenu; import org.eclipse.reddeer.swt.impl.shell.DefaultShell; -import org.eclipse.reddeer.workbench.core.condition.JobIsRunning; import org.eclipse.reddeer.workbench.impl.editor.DefaultEditor; import org.eclipse.reddeer.workbench.impl.editor.TextEditor; import org.eclipse.reddeer.workbench.ui.dialogs.WorkbenchPreferenceDialog; import org.hamcrest.CoreMatchers; -import org.hamcrest.core.StringContains; import org.junit.After; import org.junit.AfterClass; import org.junit.Assume; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonarlint.eclipse.its.shared.AbstractSonarLintTest; import org.sonarlint.eclipse.its.shared.reddeer.conditions.ConfirmManualAnalysisDialogOpened; import org.sonarlint.eclipse.its.shared.reddeer.conditions.EnhancedWithConnectedModeInformationDialogOpened; import org.sonarlint.eclipse.its.shared.reddeer.conditions.OnTheFlyViewIsEmpty; import org.sonarlint.eclipse.its.shared.reddeer.dialogs.ConfirmManualAnalysisDialog; import org.sonarlint.eclipse.its.shared.reddeer.dialogs.EnhancedWithConnectedModeInformationDialog; -import org.sonarlint.eclipse.its.shared.reddeer.perspectives.PhpPerspective; import org.sonarlint.eclipse.its.shared.reddeer.preferences.GeneralWorkspaceBuildPreferences; import org.sonarlint.eclipse.its.shared.reddeer.preferences.SonarLintPreferences; import org.sonarlint.eclipse.its.shared.reddeer.preferences.SonarLintProperties; @@ -458,11 +452,8 @@ public void shouldAnalysePython() { // Need PDT @Test - @Category(RequiresExtraDependency.class) public void shouldAnalysePHP() { - new PhpPerspective().open(); var rootProject = importExistingProjectIntoWorkspace("php", "php"); - new WaitWhile(new JobIsRunning(StringContains.containsString("DLTK Indexing")), TimePeriod.LONG); openFileAndWaitForAnalysisCompletion(rootProject.getResource("foo.php")); @@ -505,7 +496,6 @@ public void shouldAnalyseLinkedFile() throws IOException { // Need RSE @Test - @Category(RequiresExtraDependency.class) public void shouldAnalyseVirtualProject() throws Exception { // INFO: It is flaky when running on top of the oldest Eclipse version but works fine in the other test cases, // therefore it should be skipped in that particular situation! diff --git a/target-platforms/latest-java-17_e431.target b/target-platforms/latest-java-17_e431.target index 478c8160a..aef9ce064 100644 --- a/target-platforms/latest-java-17_e431.target +++ b/target-platforms/latest-java-17_e431.target @@ -11,7 +11,6 @@ - diff --git a/target-platforms/latest-java-21.target b/target-platforms/latest-java-21.target index 059951848..5a655cad0 100644 --- a/target-platforms/latest-java-21.target +++ b/target-platforms/latest-java-21.target @@ -11,7 +11,6 @@ - diff --git a/target-platforms/oldest-java-11_e417.target b/target-platforms/oldest-java-11_e417.target index 82f8dcb6f..b3f53488d 100644 --- a/target-platforms/oldest-java-11_e417.target +++ b/target-platforms/oldest-java-11_e417.target @@ -12,7 +12,6 @@ - From eb5a0b8a49e0f6ba3d7f71cfa080874611184ddd Mon Sep 17 00:00:00 2001 From: Tobias Hahnen Date: Wed, 22 Jan 2025 11:04:08 +0100 Subject: [PATCH 3/4] SLE-1046: Update build dependencies Use the latest version of Eclipse Tycho in order to be in sync with the latest Eclipse PDE/RCP changes. --- its/pom.xml | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/its/pom.xml b/its/pom.xml index b9bcdb2b7..33656084e 100644 --- a/its/pom.xml +++ b/its/pom.xml @@ -31,7 +31,7 @@ 11 - 4.0.8 + 4.0.10 latest diff --git a/pom.xml b/pom.xml index 3f116ebd0..e83a3b978 100644 --- a/pom.xml +++ b/pom.xml @@ -69,12 +69,12 @@ 11 - 3.0.0 + 3.1.0 3.2.0 1.7.1 - 4.0.8 + 4.0.10 10.13.0.79996 From 74fd375bb9e204f5b93ae316c6364e44b8e0e413 Mon Sep 17 00:00:00 2001 From: Tobias Hahnen Date: Wed, 22 Jan 2025 12:17:13 +0100 Subject: [PATCH 4/4] SLE-1046: Update dependencies Remove Minimal JSON from ITs that don't require Orchestrator --- its/org.sonarlint.eclipse.its.cdt/META-INF/MANIFEST.MF | 1 - .../META-INF/MANIFEST.MF | 1 - its/org.sonarlint.eclipse.its.standalone/META-INF/MANIFEST.MF | 1 - target-platforms/commons-build.target | 4 ++-- target-platforms/commons-its.target | 4 ++-- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/its/org.sonarlint.eclipse.its.cdt/META-INF/MANIFEST.MF b/its/org.sonarlint.eclipse.its.cdt/META-INF/MANIFEST.MF index 54d9ae706..482c63443 100644 --- a/its/org.sonarlint.eclipse.its.cdt/META-INF/MANIFEST.MF +++ b/its/org.sonarlint.eclipse.its.cdt/META-INF/MANIFEST.MF @@ -37,7 +37,6 @@ Require-Bundle: org.eclipse.jdt.core, org.apache.commons.commons-io;bundle-version="2.16.1", org.awaitility;bundle-version="4.2.2", org.hamcrest;bundle-version="2.2.0", - minimal-json;bundle-version="0.9.5", org.apache.commons.exec;bundle-version="1.3.0", com.google.protobuf;bundle-version="3.25.1", org.sonarlint.eclipse.its.shared diff --git a/its/org.sonarlint.eclipse.its.connected.sc/META-INF/MANIFEST.MF b/its/org.sonarlint.eclipse.its.connected.sc/META-INF/MANIFEST.MF index 093ca09db..80a83971e 100644 --- a/its/org.sonarlint.eclipse.its.connected.sc/META-INF/MANIFEST.MF +++ b/its/org.sonarlint.eclipse.its.connected.sc/META-INF/MANIFEST.MF @@ -40,7 +40,6 @@ Require-Bundle: org.eclipse.jdt.core, org.sonarsource.orchestrator.sonar-orchestrator;bundle-version="3.43.0", org.sonarsource.orchestrator.sonar-orchestrator-junit4;bundle-version="3.43.0", org.sonarsource.sonarqube.sonar-ws;bundle-version="6.7.0", - minimal-json;bundle-version="0.9.5", org.apache.commons.exec;bundle-version="1.3.0", com.google.guava;bundle-version="18.0.0", com.google.protobuf;bundle-version="3.25.1", diff --git a/its/org.sonarlint.eclipse.its.standalone/META-INF/MANIFEST.MF b/its/org.sonarlint.eclipse.its.standalone/META-INF/MANIFEST.MF index 96aeefe47..b07f49dd4 100644 --- a/its/org.sonarlint.eclipse.its.standalone/META-INF/MANIFEST.MF +++ b/its/org.sonarlint.eclipse.its.standalone/META-INF/MANIFEST.MF @@ -36,7 +36,6 @@ Require-Bundle: org.eclipse.jdt.core, org.apache.commons.commons-io;bundle-version="2.16.1", org.awaitility;bundle-version="4.2.2", org.hamcrest;bundle-version="2.2.0", - minimal-json;bundle-version="0.9.5", org.apache.commons.exec;bundle-version="1.3.0", com.google.protobuf;bundle-version="3.25.1", org.sonarlint.eclipse.its.shared diff --git a/target-platforms/commons-build.target b/target-platforms/commons-build.target index 9a39f6e0a..91c4caebf 100644 --- a/target-platforms/commons-build.target +++ b/target-platforms/commons-build.target @@ -23,13 +23,13 @@ org.assertj assertj-core - 3.26.3 + 3.27.3 jar org.mockito mockito-core - 5.13.0 + 5.15.2 jar diff --git a/target-platforms/commons-its.target b/target-platforms/commons-its.target index 5b5d3a77a..d6003d53f 100644 --- a/target-platforms/commons-its.target +++ b/target-platforms/commons-its.target @@ -37,7 +37,7 @@ commons-io commons-io - 2.16.1 + 2.18.0 jar @@ -72,7 +72,7 @@ org.assertj assertj-core - 3.26.3 + 3.27.3 jar