Skip to content

Commit

Permalink
Add SonarQubeIssueTransitionResult (#5033)
Browse files Browse the repository at this point in the history
Part of #5022
  • Loading branch information
georgii-borovinskikh-sonarsource authored Nov 21, 2023
1 parent c131345 commit f4c4957
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/SonarQube.Client/ISonarQubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ Task<IList<SonarQubeNotification>> GetNotificationEventsAsync(string projectKey,
/// Sets review status for an issue and adds an optional comment.
/// See api/issues/do_transition and api/issues/add_comment
/// </summary>
Task TransitionIssueAsync(string issueKey, SonarQubeIssueTransition transition, string optionalComment, CancellationToken token);
Task<SonarQubeIssueTransitionResult> TransitionIssueAsync(string issueKey, SonarQubeIssueTransition transition, string optionalComment, CancellationToken token);
}
}
30 changes: 30 additions & 0 deletions src/SonarQube.Client/Models/SonarQubeIssueTransitionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* SonarLint for Visual Studio
* Copyright (C) 2016-2023 SonarSource SA
* mailto:info AT sonarsource DOT 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.
*/

namespace SonarQube.Client.Models
{
public enum SonarQubeIssueTransitionResult
{
Success,
InsufficientRights ,
FailedToTransition,
CommentAdditionFailed
}
}
4 changes: 2 additions & 2 deletions src/SonarQube.Client/SonarQubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ public async Task<IList<SonarQubeHotspotSearch>> SearchHotspotsAsync(string proj
token);

[ExcludeFromCodeCoverage]
public Task TransitionIssueAsync(string issueKey, SonarQubeIssueTransition transition, string optionalComment, CancellationToken token)
public Task<SonarQubeIssueTransitionResult> TransitionIssueAsync(string issueKey, SonarQubeIssueTransition transition, string optionalComment, CancellationToken token)
{
// no-op, will be implemented later
return Task.CompletedTask;
return Task.FromResult(SonarQubeIssueTransitionResult.Success);
}

public async Task<IList<SonarQubeIssue>> GetTaintVulnerabilitiesAsync(string projectKey, string branch, CancellationToken token)
Expand Down

0 comments on commit f4c4957

Please sign in to comment.