Skip to content

Commit c09bd31

Browse files
Revert SCAN4NET-714 and set version to 10.4.1 (#2857)
1 parent 6f29661 commit c09bd31

File tree

8 files changed

+31
-41
lines changed

8 files changed

+31
-41
lines changed

AssemblyInfo.Shared.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
using System.Resources;
2323
using System.Runtime.InteropServices;
2424

25-
[assembly: AssemblyVersion("11.0.0")]
26-
[assembly: AssemblyFileVersion("11.0.0.0")]
27-
[assembly: AssemblyInformationalVersion("Version:11.0.0.0 Branch:not-set Sha1:not-set")]
25+
[assembly: AssemblyVersion("10.4.1")]
26+
[assembly: AssemblyFileVersion("10.4.1.0")]
27+
[assembly: AssemblyInformationalVersion("Version:10.4.1.0 Branch:not-set Sha1:not-set")]
2828
[assembly: AssemblyConfiguration("")]
2929
[assembly: AssemblyCompany("SonarSource")]
3030
[assembly: AssemblyCopyright("Copyright © SonarSource 2015-2025")]

Tests/SonarScanner.MSBuild.PreProcessor.Test/SonarQubeWebServerTest.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void Ctor_LogsServerTypeAndVersion()
4545
[DataRow("7.9.0.5545")]
4646
[DataRow("8.0.0.18670")]
4747
[DataRow("8.8.9.999")]
48-
public void IsServerVersionSupported_FailHard_LogError(string sqVersion)
48+
public void IsServerVersionSupported_LessThan89_LogError(string sqVersion)
4949
{
5050
var context = new Context(sqVersion);
5151
context.Server.IsServerVersionSupported().Should().BeFalse();
@@ -56,22 +56,18 @@ public void IsServerVersionSupported_FailHard_LogError(string sqVersion)
5656
[DataRow("8.9.0.0")]
5757
[DataRow("9.0.0.1121")]
5858
[DataRow("9.8.9.999")]
59-
[DataRow("9.9.0.0")]
60-
[DataRow("10.15.0.1121")]
61-
[DataRow("2024.12.0.100206")]
62-
public void IsServerVersionSupported_OutOfSupport_LogWarning(string sqVersion)
59+
public void IsServerVersionSupported_Between89And99_LogWarning(string sqVersion)
6360
{
6461
var context = new Context(sqVersion);
6562
context.Server.IsServerVersionSupported().Should().BeTrue();
66-
context.Logger.AssertUIWarningLogged("You're using an unsupported version of SonarQube. The next major version release of SonarScanner for .NET will not work with this version. Please upgrade to a newer SonarQube version.");
63+
context.Logger.AssertUIWarningLogged("Starting in January 2025, the SonarScanner for .NET will not support SonarQube versions below 9.9. Please upgrade to a newer version.");
6764
context.Logger.Should().HaveNoErrors();
6865
}
6966

7067
[TestMethod]
71-
[DataRow("2025.1.0.0")]
72-
[DataRow("2025.1.0.102122")]
73-
[DataRow("2026.1.0.0")]
74-
public void IsServerVersionSupported_Supported_NoLogs(string sqVersion)
68+
[DataRow("9.9.0.0")]
69+
[DataRow("10.15.0.1121")]
70+
public void IsServerVersionSupported_EqualOrGreaterThan99_NoLogs(string sqVersion)
7571
{
7672
var context = new Context(sqVersion);
7773
context.Server.IsServerVersionSupported().Should().BeTrue();

its/src/test/java/com/sonar/it/scanner/msbuild/sonarqube/SolutionKindTest.java

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@
1919
*/
2020
package com.sonar.it.scanner.msbuild.sonarqube;
2121

22-
import com.sonar.it.scanner.msbuild.utils.AnalysisContext;
23-
import com.sonar.it.scanner.msbuild.utils.AnalysisResult;
24-
import com.sonar.it.scanner.msbuild.utils.ContextExtension;
25-
import com.sonar.it.scanner.msbuild.utils.MSBuildMinVersion;
26-
import com.sonar.it.scanner.msbuild.utils.TestUtils;
27-
import com.sonar.it.scanner.msbuild.utils.Workload;
28-
import com.sonar.it.scanner.msbuild.utils.WorkloadPrerequisite;
2922
import java.nio.file.Path;
3023
import java.nio.file.Paths;
3124
import java.util.ArrayList;
3225
import java.util.Arrays;
3326
import java.util.List;
27+
import java.util.stream.Collectors;
28+
29+
import com.sonar.it.scanner.msbuild.utils.*;
3430
import org.apache.commons.io.FileUtils;
3531
import org.junit.jupiter.api.Test;
3632
import org.junit.jupiter.api.condition.EnabledOnOs;
@@ -198,22 +194,17 @@ private void validateCSharpSdk(String folderName) {
198194
}
199195

200196
private void assertUIWarnings(AnalysisResult result) {
201-
// AnalysisWarningsSensor was implemented starting from analyzer version 8.39.0.47922, so it's available from SQ 9.9 onwards
197+
// AnalysisWarningsSensor was implemented starting from analyzer version 8.39.0.47922 (https://github.com/SonarSource/sonar-dotnet-enterprise/commit/39baabb01799aa1945ac5c80d150f173e6ada45f)
198+
// So it's available from SQ 9.9 onwards
202199
if (ORCHESTRATOR.getServer().version().isGreaterThanOrEquals(9, 9)) {
203200
var warnings = TestUtils.getAnalysisWarningsTask(ORCHESTRATOR, result.end());
204201
assertThat(warnings.getStatus()).isEqualTo(Ce.TaskStatus.SUCCESS);
205-
if (ORCHESTRATOR.getServer().version().isGreaterThanOrEquals(2025, 1)) {
206-
assertThat(warnings.getWarningsList()).isEmpty();
207-
} else {
208-
assertThat(warnings.getWarningsList()).containsExactlyInAnyOrder(
209-
"You're using an unsupported version of SonarQube. The next major version release of SonarScanner for .NET will not work with this version. Please upgrade to a newer SonarQube version."
210-
);
211-
}
202+
assertThat(warnings.getWarningsList()).isEmpty();
212203
}
213204
}
214205

215206
private void assertProjectFileContains(AnalysisContext context, String textToLookFor) {
216-
Path csProjPath = context.projectDir.resolve(Paths.get("RazorWebApplication", "RazorWebApplication.csproj"));
207+
Path csProjPath = context.projectDir.resolve(Paths.get("RazorWebApplication","RazorWebApplication.csproj"));
217208
try {
218209
String str = FileUtils.readFileToString(csProjPath.toFile(), "utf-8");
219210
assertThat(str.indexOf(textToLookFor)).isPositive();
@@ -228,7 +219,7 @@ private void validateRazorProject(String project, String textToLookFor) {
228219
context.runAnalysis();
229220

230221
List<Issue> issues = TestUtils.projectIssues(context.orchestrator, context.projectKey);
231-
List<String> ruleKeys = issues.stream().map(Issue::getRule).toList();
222+
List<String> ruleKeys = issues.stream().map(Issue::getRule).collect(Collectors.toList());
232223

233224
assertThat(ruleKeys).containsAll(Arrays.asList(SONAR_RULES_PREFIX + "S1118", SONAR_RULES_PREFIX + "S1186"));
234225

nuspec/netcoreglobaltool/dotnet-sonarscanner.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
33
<metadata>
44
<id>dotnet-sonarscanner</id>
5-
<version>11.0.0</version>
5+
<version>10.4.1</version>
66
<title>SonarScanner for .NET</title>
77
<authors>SonarSource</authors>
88
<projectUrl>https://redirect.sonarsource.com/doc/msbuild-sq-runner.html</projectUrl>

scripts/version/Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3-
<MainVersion>11.0.0</MainVersion>
3+
<MainVersion>10.4.1</MainVersion>
44
<BuildNumber>0</BuildNumber>
55
<PrereleaseSuffix>
66
</PrereleaseSuffix>

src/SonarScanner.MSBuild.PreProcessor/Resources.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SonarScanner.MSBuild.PreProcessor/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ If you already have a compatible Java version installed, please add either the p
507507
<data name="ERROR_SonarSourcesAndTestsNotSupported" xml:space="preserve">
508508
<value>The arguments 'sonar.sources' and 'sonar.tests' are not supported. Please remove them and invoke the scanner again.</value>
509509
</data>
510-
<data name="WARN_UI_SonarQubeUnsupported" xml:space="preserve">
511-
<value>You're using an unsupported version of SonarQube. The next major version release of SonarScanner for .NET will not work with this version. Please upgrade to a newer SonarQube version.</value>
510+
<data name="WARN_UI_SonarQubeNearEndOfSupport" xml:space="preserve">
511+
<value>Starting in January 2025, the SonarScanner for .NET will not support SonarQube versions below 9.9. Please upgrade to a newer version.</value>
512512
</data>
513513
<data name="WARN_SourcesAndTestsDeprecated" xml:space="preserve">
514514
<value>The sonar.sources and sonar.tests properties are not supported by the Scanner for .NET and are ignored. They are automatically computed based on your repository. You can fine-tune the analysis and exclude some files by using the sonar.exclusions, sonar.inclusions, sonar.test.exclusions, and sonar.test.inclusions properties.</value>

src/SonarScanner.MSBuild.PreProcessor/WebServer/SonarQubeWebServer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ namespace SonarScanner.MSBuild.PreProcessor.WebServer;
2828

2929
internal class SonarQubeWebServer : SonarWebServer
3030
{
31-
public override bool SupportsJreProvisioning => serverVersion >= new Version(10, 6);
31+
public override bool SupportsJreProvisioning =>
32+
serverVersion >= new Version(10, 6);
3233

3334
public SonarQubeWebServer(IDownloader webDownloader, IDownloader apiDownloader, Version serverVersion, ILogger logger, string organization)
34-
: base(webDownloader, apiDownloader, serverVersion, logger, organization) =>
35+
: base(webDownloader, apiDownloader, serverVersion, logger, organization)
36+
{
3537
logger.LogInfo(Resources.MSG_UsingSonarQube, serverVersion);
38+
}
3639

3740
public override bool IsServerVersionSupported()
3841
{
@@ -42,9 +45,9 @@ public override bool IsServerVersionSupported()
4245
logger.LogError(Resources.ERR_SonarQubeUnsupported);
4346
return false;
4447
}
45-
else if (serverVersion.CompareTo(new Version(2025, 1)) < 0)
48+
else if (serverVersion.CompareTo(new Version(9, 9)) < 0)
4649
{
47-
logger.LogUIWarning(Resources.WARN_UI_SonarQubeUnsupported);
50+
logger.LogUIWarning(Resources.WARN_UI_SonarQubeNearEndOfSupport);
4851
}
4952
return true;
5053
}

0 commit comments

Comments
 (0)