Browse Source

SONAR-12026 Update status names, transition names and description

* Replace INREVIEW and TOREVIEW to IN_REVIEW and TO_REVIEW
* Update transition names and descriptions
tags/7.8
Julien Lancelot 5 years ago
parent
commit
c7c20741bd

+ 2
- 2
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v78/UpdateSecurityHotspotsStatuses.java View File

@@ -45,8 +45,8 @@ public class UpdateSecurityHotspotsStatuses extends DataChange {
private static final String STATUS_REOPENED = "REOPENED";
private static final String STATUS_RESOLVED = "RESOLVED";

private static final String STATUS_TO_REVIEW = "TOREVIEW";
private static final String STATUS_IN_REVIEW = "INREVIEW";
private static final String STATUS_TO_REVIEW = "TO_REVIEW";
private static final String STATUS_IN_REVIEW = "IN_REVIEW";
private static final String STATUS_REVIEWED = "REVIEWED";

private static final int RULE_TYPE_SECURITY_HOTSPOT = 4;

+ 9
- 9
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v78/UpdateSecurityHotspotsStatusesTest.java View File

@@ -68,8 +68,8 @@ public class UpdateSecurityHotspotsStatusesTest {
underTest.execute();

assertIssues(
tuple(issue1, "TOREVIEW", null, 4, NOW),
tuple(issue2, "TOREVIEW", null, 4, NOW),
tuple(issue1, "TO_REVIEW", null, 4, NOW),
tuple(issue2, "TO_REVIEW", null, 4, NOW),
// Not updated
tuple(issue3, "OPEN", null, 1, PAST),
tuple(issue4, "REOPENED", null, 2, PAST),
@@ -89,7 +89,7 @@ public class UpdateSecurityHotspotsStatusesTest {
underTest.execute();

assertIssues(
tuple(issue1, "INREVIEW", null, 4, NOW),
tuple(issue1, "IN_REVIEW", null, 4, NOW),
tuple(issue2, "REVIEWED", "FIXED", 4, NOW),
// Not updated
tuple(issue3, "RESOLVED", "FIXED", 1, PAST),
@@ -109,8 +109,8 @@ public class UpdateSecurityHotspotsStatusesTest {
underTest.execute();

assertIssueChanges(
tuple(issue1, "diff", "status=REOPENED|TOREVIEW,resolution=", NOW, NOW, NOW),
tuple(issue3, "diff", "status=RESOLVED|INREVIEW,resolution=FIXED|", NOW, NOW, NOW),
tuple(issue1, "diff", "status=REOPENED|TO_REVIEW,resolution=", NOW, NOW, NOW),
tuple(issue3, "diff", "status=RESOLVED|IN_REVIEW,resolution=FIXED|", NOW, NOW, NOW),
tuple(issue4, "diff", "status=RESOLVED|REVIEWED,resolution=WONTFIX|FIXED", NOW, NOW, NOW));
}

@@ -159,15 +159,15 @@ public class UpdateSecurityHotspotsStatusesTest {

underTest.execute();
assertIssues(
tuple(issue1, "TOREVIEW", null, 4, NOW),
tuple(issue2, "TOREVIEW", null, 4, NOW));
tuple(issue1, "TO_REVIEW", null, 4, NOW),
tuple(issue2, "TO_REVIEW", null, 4, NOW));

// Set a new date for NOW in order to check that issues has not been updated again
system2.setNow(NOW + 1_000_000_000L);
underTest.execute();
assertIssues(
tuple(issue1, "TOREVIEW", null, 4, NOW),
tuple(issue2, "TOREVIEW", null, 4, NOW));
tuple(issue1, "TO_REVIEW", null, 4, NOW),
tuple(issue2, "TO_REVIEW", null, 4, NOW));
}

@Test

+ 0
- 2
server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/State.java View File

@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.CheckForNull;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.issue.Issue;

public class State {
@@ -36,7 +35,6 @@ public class State {

public State(String key, Transition[] outTransitions) {
Preconditions.checkArgument(!Strings.isNullOrEmpty(key), "State key must be set");
Preconditions.checkArgument(StringUtils.isAllUpperCase(key), "State key must be upper-case");
checkDuplications(outTransitions, key);

this.key = key;

+ 1
- 9
server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/StateTest.java View File

@@ -28,7 +28,7 @@ public class StateTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();

Transition t1 = Transition.builder("close").from("OPEN").to("CLOSED").build();
private Transition t1 = Transition.builder("close").from("OPEN").to("CLOSED").build();

@Test
public void key_should_be_set() {
@@ -38,14 +38,6 @@ public class StateTest {
new State("", new Transition[0]);
}

@Test
public void key_should_be_upper_case() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("State key must be upper-case");

new State("close", new Transition[0]);
}

@Test
public void no_duplicated_out_transitions() {
expectedException.expect(IllegalArgumentException.class);

+ 3
- 3
server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java View File

@@ -115,7 +115,7 @@ public class SearchActionFacetsTest {
.executeProtobuf(SearchWsResponse.class);

Map<String, Number> expectedStatuses = ImmutableMap.<String, Number>builder().put("OPEN", 1L).put("CONFIRMED", 0L)
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("INREVIEW", 0L).put("TOREVIEW", 0L).put("REVIEWED", 0L).build();
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("IN_REVIEW", 0L).put("TO_REVIEW", 0L).put("REVIEWED", 0L).build();

assertThat(response.getFacets().getFacetsList())
.extracting(Common.Facet::getProperty, facet -> facet.getValuesList().stream().collect(toMap(FacetValue::getVal, FacetValue::getCount)))
@@ -153,7 +153,7 @@ public class SearchActionFacetsTest {
.executeProtobuf(SearchWsResponse.class);

Map<String, Number> expectedStatuses = ImmutableMap.<String, Number>builder().put("OPEN", 10L).put("CONFIRMED", 0L)
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("INREVIEW", 0L).put("TOREVIEW", 0L).put("REVIEWED", 0L).build();
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("IN_REVIEW", 0L).put("TO_REVIEW", 0L).put("REVIEWED", 0L).build();

assertThat(response.getFacets().getFacetsList())
.extracting(Common.Facet::getProperty, facet -> facet.getValuesList().stream().collect(toMap(FacetValue::getVal, FacetValue::getCount)))
@@ -507,7 +507,7 @@ public class SearchActionFacetsTest {
.executeProtobuf(SearchWsResponse.class);

Map<String, Number> expectedStatuses = ImmutableMap.<String, Number>builder().put("OPEN", 1L).put("CONFIRMED", 0L)
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("INREVIEW", 0L).put("TOREVIEW", 0L).put("REVIEWED", 0L).build();
.put("REOPENED", 0L).put("RESOLVED", 0L).put("CLOSED", 0L).put("IN_REVIEW", 0L).put("TO_REVIEW", 0L).put("REVIEWED", 0L).build();

assertThat(response.getFacets().getFacetsList())
.extracting(Common.Facet::getProperty, facet -> facet.getValuesList().stream().collect(toMap(FacetValue::getVal, FacetValue::getCount)))

+ 1
- 1
server/sonar-web/src/main/js/apps/issues/sidebar/StatusFacet.tsx View File

@@ -39,7 +39,7 @@ interface Props {
}

const STATUSES = ['OPEN', 'CONFIRMED', 'REOPENED', 'RESOLVED'];
const HOTSPOT_STATUSES = ['TOREVIEW', 'REVIEWED', 'INREVIEW'];
const HOTSPOT_STATUSES = ['TO_REVIEW', 'REVIEWED', 'IN_REVIEW'];
const COMMON_STATUSES = ['CLOSED'];

export default class StatusFacet extends React.PureComponent<Props> {

+ 5
- 5
server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/StatusFacet-test.tsx View File

@@ -35,7 +35,7 @@ it('should toggle status facet', () => {

it('should clear status facet', () => {
const onChange = jest.fn();
const wrapper = shallowRender({ onChange, statuses: ['TOREVIEW'] });
const wrapper = shallowRender({ onChange, statuses: ['TO_REVIEW'] });
wrapper.children('FacetHeader').prop<Function>('onClear')();
expect(onChange).toBeCalledWith({ statuses: [] });
});
@@ -43,8 +43,8 @@ it('should clear status facet', () => {
it('should select a status', () => {
const onChange = jest.fn();
const wrapper = shallowRender({ onChange });
clickAndCheck('TOREVIEW');
clickAndCheck('OPEN', true, ['OPEN', 'TOREVIEW']);
clickAndCheck('TO_REVIEW');
clickAndCheck('OPEN', true, ['OPEN', 'TO_REVIEW']);
clickAndCheck('CONFIRMED');

function clickAndCheck(status: string, multiple = false, expected = [status]) {
@@ -70,8 +70,8 @@ function shallowRender(props: Partial<StatusFacet['props']> = {}) {
REOPENED: 0,
RESOLVED: 0,
CLOSED: 8,
TOREVIEW: 150,
INREVIEW: 7,
TO_REVIEW: 150,
IN_REVIEW: 7,
REVIEWED: 1105
}}
statuses={[]}

+ 8
- 8
server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/StatusFacet-test.tsx.snap View File

@@ -90,17 +90,17 @@ exports[`should render correctly 1`] = `
active={false}
disabled={false}
halfWidth={true}
key="TOREVIEW"
key="TO_REVIEW"
loading={false}
name={
<StatusHelper
status="TOREVIEW"
status="TO_REVIEW"
/>
}
onClick={[Function]}
stat="150"
tooltip="issue.status.TOREVIEW"
value="TOREVIEW"
tooltip="issue.status.TO_REVIEW"
value="TO_REVIEW"
/>
<FacetItem
active={false}
@@ -122,17 +122,17 @@ exports[`should render correctly 1`] = `
active={false}
disabled={false}
halfWidth={true}
key="INREVIEW"
key="IN_REVIEW"
loading={false}
name={
<StatusHelper
status="INREVIEW"
status="IN_REVIEW"
/>
}
onClick={[Function]}
stat="7"
tooltip="issue.status.INREVIEW"
value="INREVIEW"
tooltip="issue.status.IN_REVIEW"
value="IN_REVIEW"
/>
</FacetItemsList>
<FacetItemsList

+ 7
- 7
sonar-core/src/main/resources/org/sonar/l10n/core.properties View File

@@ -619,17 +619,17 @@ issue.transition.close.description=
issue.transition.wontfix=Resolve as won't fix
issue.transition.wontfix.description=This issue can be ignored because the rule is irrelevant in this context. Its effort won't be counted.
issue.transition.setinreview=Set as In Review
issue.transition.setinreview.description=A review is required to check for a Vulnerability
issue.transition.setinreview.description=A review is in progress to check for a vulnerability
issue.transition.openasvulnerability=Open as Vulnerability
issue.transition.openasvulnerability.description=There's a Vulnerability in the code that must be fixed
issue.transition.resolveasreviewed=Resolve as Reviewed
issue.transition.resolveasreviewed.description=There is no Vulnerability in the code
issue.transition.resetastoreview=Reset as To Review
issue.transition.resetastoreview.description=The Security Hotspot should be analyzed again
vulnerability.transition.resetastoreview=Reset as Security Hotspot To Review
vulnerability.transition.resetastoreview.description=The Vulnerability can't be fixed as is and needs more details
vulnerability.transition.resolveasreviewed=Resolve as Reviewed Security Hotspot
vulnerability.transition.resolveasreviewed.description=The Vulnerability has been fixed
vulnerability.transition.resetastoreview=Reset as To Review
vulnerability.transition.resetastoreview.description=The vulnerability can't be fixed as is and needs more details. The security hotspot needs to be reviewed again
vulnerability.transition.resolveasreviewed=Resolve as Reviewed
vulnerability.transition.resolveasreviewed.description=The vulnerability has been fixed. The security hotspot is considered reviewed

issue.set_severity=Change Severity
issue.set_type=Change Type
@@ -648,8 +648,8 @@ issue.status.RESOLVED=Resolved
issue.status.OPEN=Open
issue.status.CONFIRMED=Confirmed
issue.status.CLOSED=Closed
issue.status.TOREVIEW=To Review
issue.status.INREVIEW=In Review
issue.status.TO_REVIEW=To Review
issue.status.IN_REVIEW=In Review
issue.status.REVIEWED=Reviewed

issue.resolution.FALSE-POSITIVE=False Positive

+ 2
- 2
sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java View File

@@ -79,12 +79,12 @@ public interface Issue extends Serializable {
/**
* @since 7.8
*/
String STATUS_TO_REVIEW = "TOREVIEW";
String STATUS_TO_REVIEW = "TO_REVIEW";

/**
* @since 7.8
*/
String STATUS_IN_REVIEW = "INREVIEW";
String STATUS_IN_REVIEW = "IN_REVIEW";

/**
* @since 7.8

Loading…
Cancel
Save