Skip to content

Commit

Permalink
Make SonarCloud use won't fix (#5101)
Browse files Browse the repository at this point in the history
Fixes #5100
  • Loading branch information
ugras-ergun-sonarsource authored Dec 9, 2023
1 parent 55ea7b3 commit d0e4af9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
2 changes: 1 addition & 1 deletion src/SonarQube.Client/Api/DefaultConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static UnversionedRequestFactory ConfigureSonarCloud(UnversionedRequestFa
.RegisterRequest<IGetTaintVulnerabilitiesRequest, V10_2.GetTaintVulnerabilitiesWithCCTRequest>()
.RegisterRequest<IGetExclusionsRequest, V7_20.GetExclusionsRequest>()
.RegisterRequest<ISearchHotspotRequest, V9_7.SearchHotspotRequest>()
.RegisterRequest<ITransitionIssueRequest, V10_4.TransitionIssueRequestWithAccept>()
.RegisterRequest<ITransitionIssueRequest, V9_9.TransitionIssueRequestWithWontFix>()
.RegisterRequest<ICommentIssueRequest, V9_9.CommentIssueRequest>()
.RegisterRequest<ISearchFilesByNameRequest, V9_9.SearchFilesByNameRequest>();

Expand Down

0 comments on commit d0e4af9

Please sign in to comment.