Skip to content
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

EREQ-85 Use Repox mirror of Reddeer after termination of project at Eclipse #782

Merged
merged 8 commits into from
Dec 9, 2024
3 changes: 3 additions & 0 deletions .cirrus.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ qa_connectedModeSonarQube_task:
echo "Run Maven ITs for Connected Mode with SonarQube on Eclipse 2024-03 / 4.31 (latest Java 17) and Server ${SQ_VERSION}"
cd its/
mvn -B -e -V org.jacoco:jacoco-maven-plugin:prepare-agent verify \
-s ${HOME}/.m2/settings-public-auth.xml \
-P coverage,\!standaloneMode,\!connectedModeSc \
-Declipse.p2.mirrors=false \
-Dtarget.platform=latest-java-17_e431 \
Expand Down Expand Up @@ -308,6 +309,7 @@ qa_connectedModeSonarCloud_task:
cd its/
env SONARCLOUD_IT_PASSWORD=$SONARCLOUD_IT_PASSWORD \
mvn -B -e -V org.jacoco:jacoco-maven-plugin:prepare-agent verify \
-s ${HOME}/.m2/settings-public-auth.xml \
-P coverage,\!standaloneMode,\!connectedModeSq \
-Declipse.p2.mirrors=false \
-Dtarget.platform=latest-java-21 \
Expand Down Expand Up @@ -386,6 +388,7 @@ qa_standaloneMode_task:
echo "Run Maven ITs for Standalone Mode on Eclipse '${TARGET_PLATFORM}'"
cd its/
mvn -B -e -V org.jacoco:jacoco-maven-plugin:prepare-agent verify \
-s ${HOME}/.m2/settings-public-auth.xml \
-P coverage,\!connectedModeSq,\!connectedModeSc \
-Declipse.p2.mirrors=false \
-Dtarget.platform=${TARGET_PLATFORM} \
Expand Down
1 change: 1 addition & 0 deletions .cirrus.ibuilds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ qa_ibuilds_task:
echo "Run Maven ITs for Standalone Mode on Eclipse iBuilds"
cd its/
mvn -B -e -V verify \
-s ${HOME}/.m2/settings-public-auth.xml \
-P \!connectedModeSq,\!connectedModeSc \
-Declipse.p2.mirrors=false \
-Dtarget.platform=ibuilds \
Expand Down
11 changes: 10 additions & 1 deletion .cirrus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
# "build-essential" (containing gcc/g++/make) for C/C++ analysis
# Webkit libraries for rendering the SonarQube Rule Description view
ARG NODE_VERSION=20
RUN apt-get update && apt-get install -y build-essential metacity xvfb ffmpeg nodejs=${NODE_VERSION}.* gettext-base \
RUN apt-get update && apt-get install -y \
build-essential \
dbus-x11 \
ffmpeg \
gettext-base \
libwebkit2gtk-4.* \
metacity \
nodejs=${NODE_VERSION}.* \
xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --chmod=755 .cirrus/init.d/xvfb /etc/init.d/
Expand All @@ -30,3 +37,5 @@ ENV JAVA_HOME_11_X64=/opt/java/openjdk-11
ENV JAVA_HOME_17_X64=/opt/java/openjdk
ENV JAVA_HOME_21_X64=/opt/java/openjdk-21
COPY --chown=sonarsource .cirrus/toolchains.xml .m2/toolchains.xml
# Fix for authenticated access to Reddeer mirror on Repox
COPY --chown=sonarsource .cirrus/settings-public-auth.xml .m2/settings-public-auth.xml
117 changes: 117 additions & 0 deletions .cirrus/settings-public-auth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
<!--
Imported from SonarSource/ci-common-scripts
-->
<localRepository>${env.CIRRUS_WORKING_DIR}/.m2/repository</localRepository>
<servers>
<server>
<id>sonarsource</id>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<value>Bearer ${env.ARTIFACTORY_ACCESS_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
<!-- Authenticated P2 repo part 1 -->
<server>
<id>reddeerLatest</id>
<username>${env.ARTIFACTORY_PRIVATE_USERNAME}</username>
<password>${env.ARTIFACTORY_PRIVATE_PASSWORD}</password>
<configuration>
<wagonProvider>httpclient</wagonProvider>
<httpConfiguration>
<all>
<params>
<param>
<name>http.authentication.preemptive</name>
<value>%b,false</value>
</param>
</params>
<usePreemptive>true</usePreemptive>
</all>
</httpConfiguration>
</configuration>
</server>
<server>
<id>reddeer420</id>
<username>${env.ARTIFACTORY_PRIVATE_USERNAME}</username>
<password>${env.ARTIFACTORY_PRIVATE_PASSWORD}</password>
<configuration>
<wagonProvider>httpclient</wagonProvider>
<httpConfiguration>
<all>
<params>
<param>
<name>http.authentication.preemptive</name>
<value>%b,false</value>
</param>
</params>
<usePreemptive>true</usePreemptive>
</all>
</httpConfiguration>
</configuration>
</server>
<!-- /Authenticated P2 repo part 1 -->
</servers>
<profiles>
<profile>
<id>sonarsource-repo</id>
<activation>
<property>
<name>!skip-sonarsource-repo</name>
</property>
</activation>
<repositories>
<repository>
<id>sonarsource</id>
<name>SonarSource Central Repository</name>
<url>https://repox.jfrog.io/artifactory/sonarsource</url>
<releases>
<enabled>true</enabled>
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<!-- Authenticated P2 repo part 2 -->
<repository>
<id>reddeerLatest</id>
<url>https://repox.jfrog.io/artifactory/reddeer/releases/latest</url>
<layout>p2</layout>
</repository>
<repository>
<id>reddeer420</id>
<url>https://repox.jfrog.io/artifactory/reddeer/releases/4.2.0</url>
<layout>p2</layout>
</repository>
<!-- /Authenticated P2 repo part 2 -->
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonarsource</id>
<name>SonarSource Central Repository</name>
<url>https://repox.jfrog.io/artifactory/sonarsource</url>
<releases>
<enabled>true</enabled>
<!-- no need to always check if new versions are available when
executing a maven plugin without specifying the version -->
<updatePolicy>interval:60</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.awaitility.Awaitility;
import org.eclipse.reddeer.common.wait.TimePeriod;
import org.eclipse.reddeer.common.wait.WaitUntil;
import org.eclipse.reddeer.common.wait.WaitWhile;
Expand Down Expand Up @@ -636,8 +637,20 @@ public void test_Java_Python_DBD() {
new DefaultEditor().close();

openFileAndWaitForAnalysisCompletion(rootProject.getResource("src", "dbd", "Main.java"));
waitForSonarLintMarkers(onTheFlyView,
tuple("Fix this access on a collection that may trigger an 'ArrayIndexOutOfBoundsException'. [+2 locations]", "Main.java", "few seconds ago"));

// Due to changes in the DBD Java analyzer the rule "S6466" was changed to now find more locations. This analyzer
// is only included in the latest version of SonarQube Server!
Awaitility.await()
.atMost(20, TimeUnit.SECONDS)
.untilAsserted(() -> {
assertThat(onTheFlyView.getIssues()).hasSize(1);
assertThat(onTheFlyView.getIssues())
.extracting(SonarLintIssueMarker::getDescription, SonarLintIssueMarker::getResource, SonarLintIssueMarker::getCreationDate)
.containsAnyOf(
tuple("Fix this access on a collection that may trigger an 'ArrayIndexOutOfBoundsException'. [+2 locations]", "Main.java", "few seconds ago"),
tuple("Fix this access on a collection that may trigger an 'ArrayIndexOutOfBoundsException'. [+4 locations]", "Main.java", "few seconds ago"));
});

new DefaultEditor().close();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.sonarlint.eclipse.its.shared.reddeer.preferences;

import org.eclipse.reddeer.common.exception.RedDeerException;
import org.eclipse.reddeer.core.matcher.WithLabelMatcher;
import org.eclipse.reddeer.core.reference.ReferencedComposite;
import org.eclipse.reddeer.eclipse.ui.dialogs.PropertyPage;
Expand All @@ -44,11 +45,21 @@ public static FileAssociationsPreferences open() {
}

public void resetFileAssociation() {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("System Editor; if none: Text Editor");
// With Eclipse 4.34 (2024-12) they changed the label inside the combo box from "Text Editor" to "Plain Text Editor"
try {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("System Editor; if none: Text Editor");
} catch (RedDeerException ignored) {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("System Editor; if none: Plain Text Editor");
}
}

public void enforceFileAssociation() {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("Text Editor");
// With Eclipse 4.34 (2024-12) they changed the label inside the combo box from "Text Editor" to "Plain Text Editor"
try {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("Text Editor");
} catch (RedDeerException ignored) {
new DefaultCombo(this, new WithLabelMatcher(LABEL)).setSelection("Plain Text Editor");
}
}

public void ok() {
Expand Down
3 changes: 2 additions & 1 deletion target-platforms/ibuilds.target
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.reddeer.eclipse.feature.feature.group" version="0.0.0" />
<repository location="https://download.eclipse.org/reddeer/releases/latest" />
<!-- Mirror of the defunct "https://download.eclipse.org/reddeer/releases/latest/" -->
<repository location="https://repox.jfrog.io/artifactory/reddeer/releases/latest/" />
</location>

<!-- Reddeer requires GEF legacy-->
Expand Down
3 changes: 2 additions & 1 deletion target-platforms/latest-java-17_e431.target
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
</location>

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/reddeer/releases/latest/" />
<!-- Mirror of the defunct "https://download.eclipse.org/reddeer/releases/latest/" -->
<repository location="https://repox.jfrog.io/artifactory/reddeer/releases/latest/" />
<unit id="org.eclipse.reddeer.eclipse.feature.feature.group" version="0.0.0" />
</location>

Expand Down
3 changes: 2 additions & 1 deletion target-platforms/latest-java-21.target
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
</location>

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/reddeer/releases/latest/" />
<!-- Mirror of the defunct "https://download.eclipse.org/reddeer/releases/latest/" -->
<repository location="https://repox.jfrog.io/artifactory/reddeer/releases/latest/" />
<unit id="org.eclipse.reddeer.eclipse.feature.feature.group" version="0.0.0" />
<unit id="org.eclipse.reddeer.ui.feature.feature.group" version="0.0.0" />
</location>
Expand Down
3 changes: 2 additions & 1 deletion target-platforms/oldest-java-11_e48.target
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.reddeer.eclipse.feature.feature.group" version="0.0.0" />
<repository location="https://download.eclipse.org/reddeer/releases/4.2.0/" />
<!-- Mirror of the defunct "https://download.eclipse.org/reddeer/releases/4.2.0/" -->
<repository location="https://repox.jfrog.io/artifactory/reddeer/releases/4.2.0/" />
</location>

<location includeDependencyDepth="infinite" includeDependencyScopes="compile,runtime" includeSource="true" missingManifest="error" type="Maven">
Expand Down
Loading