@@ -265,7 +265,8 @@ public class SearchActionFacetsIT { | |||
RuleDto rule = db.rules().insertIssueRule(); | |||
db.issues().insertIssue(rule, project, file, i -> i.setAssigneeUuid(user.getUuid()) | |||
.setStatus(ISSUE_STATUSES[random.nextInt(ISSUE_STATUSES.length)]) | |||
.setStatus(Issue.STATUS_RESOLVED) | |||
.setResolution(Issue.RESOLUTION_FIXED) | |||
.setType(rule.getType())); | |||
}); | |||
@@ -72,6 +72,8 @@ public class AddCommentAction implements IssuesWsAction { | |||
"Requires authentication and the following permission: 'Browse' on the project of the specified issue.") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -75,6 +75,8 @@ public class AssignAction implements IssuesWsAction { | |||
.setDescription("Assign/Unassign an issue. Requires authentication and Browse permission on project") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -60,6 +60,8 @@ public class DeleteCommentAction implements IssuesWsAction { | |||
"Requires authentication and the following permission: 'Browse' on the project of the specified issue.") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -82,6 +82,8 @@ public class DoTransitionAction implements IssuesWsAction { | |||
"The transitions involving security hotspots require the permission 'Administer Security Hotspot'.") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -66,6 +66,8 @@ public class EditCommentAction implements IssuesWsAction { | |||
"Requires authentication and the following permission: 'Browse' on the project of the specified issue.") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -24,6 +24,7 @@ import java.util.EnumSet; | |||
import java.util.List; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.rules.RuleType; | |||
import org.sonar.api.server.ws.Change; | |||
import org.sonar.api.server.ws.Request; | |||
import org.sonar.api.server.ws.Response; | |||
import org.sonar.api.server.ws.WebService; | |||
@@ -90,10 +91,14 @@ public class ListAction implements IssuesWsAction { | |||
.setHandler(this) | |||
.setInternal(true) | |||
.setDescription("List issues. This endpoint is used in degraded mode, when issue indexation is running." + | |||
"<br>Either 'project' or 'component' parameter is required." + | |||
"<br>Total number of issues will be always equal to a page size, as this counting all issues is not supported. " + | |||
"<br>Requires the 'Browse' permission on the specified project. ") | |||
"<br>Either 'project' or 'component' parameter is required." + | |||
"<br>Total number of issues will be always equal to a page size, as this counting all issues is not supported. " + | |||
"<br>Requires the 'Browse' permission on the specified project. ") | |||
.setSince("10.2") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response.") | |||
) | |||
.setResponseExample(getClass().getResource("list-example.json")); | |||
action.addPagingParams(100, MAX_PAGE_SIZE); |
@@ -37,6 +37,7 @@ import org.sonar.api.utils.DateUtils; | |||
import org.sonar.api.utils.Duration; | |||
import org.sonar.api.utils.Durations; | |||
import org.sonar.api.utils.Paging; | |||
import org.sonar.core.issue.status.SimpleStatus; | |||
import org.sonar.db.component.BranchDto; | |||
import org.sonar.db.component.BranchType; | |||
import org.sonar.db.component.ComponentDto; | |||
@@ -204,6 +205,7 @@ public class SearchResponseFormat { | |||
ofNullable(data.getUserByUuid(dto.getAssigneeUuid())).ifPresent(assignee -> issueBuilder.setAssignee(assignee.getLogin())); | |||
ofNullable(emptyToNull(dto.getResolution())).ifPresent(issueBuilder::setResolution); | |||
issueBuilder.setStatus(dto.getStatus()); | |||
issueBuilder.setSimpleStatus(SimpleStatus.of(dto.getStatus(), dto.getResolution()).name()); | |||
issueBuilder.setMessage(nullToEmpty(dto.getMessage())); | |||
issueBuilder.addAllMessageFormattings(MessageFormattingUtils.dbMessageFormattingToWs(dto.parseMessageFormattings())); | |||
issueBuilder.addAllTags(dto.getTags()); |
@@ -79,6 +79,8 @@ public class SetSeverityAction implements IssuesWsAction { | |||
"</ul>") | |||
.setSince("3.6") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "This endpoint is now deprecated."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), |
@@ -74,6 +74,8 @@ public class SetTagsAction implements IssuesWsAction { | |||
.setDescription("Set tags on an issue. <br/>" + | |||
"Requires authentication and Browse permission on project") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), | |||
new Change("8.8", "The response field components.uuid is removed"), |
@@ -83,6 +83,8 @@ public class SetTypeAction implements IssuesWsAction { | |||
"</ul>") | |||
.setSince("5.5") | |||
.setChangelog( | |||
new Change("10.4", "The response fields 'status' and 'resolution' are deprecated. Please use 'simpleStatus' instead."), | |||
new Change("10.4", "Add 'simpleStatus' field to the response."), | |||
new Change("10.2", "Add 'impacts', 'cleanCodeAttribute', 'cleanCodeAttributeCategory' fields to the response"), | |||
new Change("10.2", "This endpoint is now deprecated."), | |||
new Change("9.6", "Response field 'ruleDescriptionContextKey' added"), |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -22,6 +22,7 @@ | |||
}, | |||
"flows": [], | |||
"status": "CONFIRMED", | |||
"simpleStatus": "CONFIRMED", | |||
"message": "Provide multiple methods instead of using \"modal\" to determine which action to take.", | |||
"effort": "15min", | |||
"debt": "15min", |
@@ -33,6 +33,7 @@ import org.sonar.api.resources.Languages; | |||
import org.sonar.api.rules.CleanCodeAttribute; | |||
import org.sonar.api.utils.Duration; | |||
import org.sonar.api.utils.Durations; | |||
import org.sonar.core.issue.status.SimpleStatus; | |||
import org.sonar.db.DbTester; | |||
import org.sonar.db.component.BranchDto; | |||
import org.sonar.db.component.BranchType; | |||
@@ -280,6 +281,16 @@ public class SearchResponseFormatFormatOperationTest { | |||
assertThat(result.getIssue().hasSeverity()).isFalse(); | |||
} | |||
@Test | |||
public void formatOperation_shouldReturnExpectedSimpleStatus() { | |||
issueDto.setStatus(org.sonar.api.issue.Issue.STATUS_RESOLVED); | |||
issueDto.setResolution(org.sonar.api.issue.Issue.RESOLUTION_WONT_FIX); | |||
Operation result = searchResponseFormat.formatOperation(searchResponseData); | |||
assertThat(result.getIssue().getSimpleStatus()).isEqualTo(SimpleStatus.ACCEPTED.name()); | |||
} | |||
private SearchResponseData newSearchResponseDataMainBranch() { | |||
ComponentDto projectDto = db.components().insertPublicProject().getMainBranchComponent(); | |||
BranchDto branchDto = db.getDbClient().branchDao().selectByUuid(db.getSession(), projectDto.uuid()).get(); |
@@ -166,6 +166,7 @@ message Issue { | |||
optional sonarqube.ws.commons.CleanCodeAttribute cleanCodeAttribute = 40; | |||
optional sonarqube.ws.commons.CleanCodeAttributeCategory cleanCodeAttributeCategory = 41; | |||
repeated sonarqube.ws.commons.Impact impacts = 42; | |||
optional string simpleStatus = 43; | |||
} | |||
message Transitions { |