From d0e4af9a83f0db0a43c490ac10cfdab9e11544af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Sat, 9 Dec 2023 02:06:45 +0100 Subject: [PATCH] Make SonarCloud use won't fix (#5101) Fixes #5100 --- .../Configuration/ConnectedModeFeaturesConfigurationTests.cs | 4 ++-- src/Core/Configuration/ConnectedModeFeaturesConfiguration.cs | 2 +- .../Requests/DefaultConfiguration_Configure.cs | 2 +- src/SonarQube.Client/Api/DefaultConfiguration.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core.UnitTests/Configuration/ConnectedModeFeaturesConfigurationTests.cs b/src/Core.UnitTests/Configuration/ConnectedModeFeaturesConfigurationTests.cs index b10e31e1ef..74db8ed1b8 100644 --- a/src/Core.UnitTests/Configuration/ConnectedModeFeaturesConfigurationTests.cs +++ b/src/Core.UnitTests/Configuration/ConnectedModeFeaturesConfigurationTests.cs @@ -52,11 +52,11 @@ public void IsAcceptTransitionAvailable_NoServerInfo_ReturnsFalse() [DataRow(9, 6, 9)] [DataRow(0, 0, 0)] [DataTestMethod] - public void IsAcceptTransitionAvailable_AnySonarCloudVersion_ReturnsTrue(int major, int minor, int build) + public void IsAcceptTransitionAvailable_AnySonarCloudVersion_ReturnsFalse(int major, int minor, int build) { var testSubject = CreateTestSubject(new ServerInfo(new Version(major, minor, build), ServerType.SonarCloud)); - testSubject.IsAcceptTransitionAvailable().Should().BeTrue(); + testSubject.IsAcceptTransitionAvailable().Should().BeFalse(); } [DataRow(0, 0, 0, false)] diff --git a/src/Core/Configuration/ConnectedModeFeaturesConfiguration.cs b/src/Core/Configuration/ConnectedModeFeaturesConfiguration.cs index 4d6fe7056e..f8847cbdc2 100644 --- a/src/Core/Configuration/ConnectedModeFeaturesConfiguration.cs +++ b/src/Core/Configuration/ConnectedModeFeaturesConfiguration.cs @@ -88,7 +88,7 @@ public bool IsAcceptTransitionAvailable() { var serverInfo = sonarQubeService.GetServerInfo(); - return serverInfo != null && IsSupportedForVersion(serverInfo, minimalSonarQubeVersionForAccept); + return serverInfo != null && (serverInfo.ServerType == ServerType.SonarQube && serverInfo.Version >= minimalSonarQubeVersionForAccept); } } } diff --git a/src/SonarQube.Client.Tests/Requests/DefaultConfiguration_Configure.cs b/src/SonarQube.Client.Tests/Requests/DefaultConfiguration_Configure.cs index ea3de6c32f..47cde104da 100644 --- a/src/SonarQube.Client.Tests/Requests/DefaultConfiguration_Configure.cs +++ b/src/SonarQube.Client.Tests/Requests/DefaultConfiguration_Configure.cs @@ -116,7 +116,7 @@ public void ConfigureSonarCloud_Writes_Debug_Messages() "Registered SonarQube.Client.Api.V10_2.GetTaintVulnerabilitiesWithCCTRequest", "Registered SonarQube.Client.Api.V7_20.GetExclusionsRequest", "Registered SonarQube.Client.Api.V9_7.SearchHotspotRequest", - "Registered SonarQube.Client.Api.V10_4.TransitionIssueRequestWithAccept", + "Registered SonarQube.Client.Api.V9_9.TransitionIssueRequestWithWontFix", "Registered SonarQube.Client.Api.V9_9.CommentIssueRequest", "Registered SonarQube.Client.Api.V9_9.SearchFilesByNameRequest" }; diff --git a/src/SonarQube.Client/Api/DefaultConfiguration.cs b/src/SonarQube.Client/Api/DefaultConfiguration.cs index d599020860..84a02489f9 100644 --- a/src/SonarQube.Client/Api/DefaultConfiguration.cs +++ b/src/SonarQube.Client/Api/DefaultConfiguration.cs @@ -95,7 +95,7 @@ public static UnversionedRequestFactory ConfigureSonarCloud(UnversionedRequestFa .RegisterRequest() .RegisterRequest() .RegisterRequest() - .RegisterRequest() + .RegisterRequest() .RegisterRequest() .RegisterRequest();