From 361f445eb6093e524b2df524d9bde14012e83263 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 22 Jan 2015 17:06:09 +0100 Subject: [PATCH] SONAR-4624 rename issue transition "mute" to "wontfix" and resolution "MUTED" to "WONTFIX" --- .../SearchActionMediumTest/display_facets.json | 2 +- .../display_zero_facets.json | 2 +- .../issues/facets/resolution-facet.coffee | 2 +- .../core/issue/workflow/IssueWorkflow.java | 14 +++++++------- .../resources/org/sonar/l10n/core.properties | 4 ++-- .../core/issue/workflow/IssueWorkflowTest.java | 18 +++++++++--------- .../sonar/api/issue/DefaultTransitions.java | 4 ++-- .../main/java/org/sonar/api/issue/Issue.java | 4 ++-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json index 20a42e280a0..cce233e23e7 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_facets.json @@ -82,7 +82,7 @@ "count": 0 }, { - "val": "MUTED", + "val": "WONTFIX", "count": 0 } ] diff --git a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json index d4debbcb81f..693bbe898bf 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/issue/ws/SearchActionMediumTest/display_zero_facets.json @@ -82,7 +82,7 @@ "count": 0 }, { - "val": "MUTED", + "val": "WONTFIX", "count": 0 } ] diff --git a/server/sonar-web/src/main/coffee/issues/facets/resolution-facet.coffee b/server/sonar-web/src/main/coffee/issues/facets/resolution-facet.coffee index 267cf954c5a..a18b5b1c0b1 100644 --- a/server/sonar-web/src/main/coffee/issues/facets/resolution-facet.coffee +++ b/server/sonar-web/src/main/coffee/issues/facets/resolution-facet.coffee @@ -36,6 +36,6 @@ define [ sortValues: (values) -> - order = ['', 'FIXED', 'FALSE-POSITIVE', 'MUTED', 'REMOVED'] + order = ['', 'FIXED', 'FALSE-POSITIVE', 'WONTFIX', 'REMOVED'] _.sortBy values, (v) -> order.indexOf v.val diff --git a/sonar-core/src/main/java/org/sonar/core/issue/workflow/IssueWorkflow.java b/sonar-core/src/main/java/org/sonar/core/issue/workflow/IssueWorkflow.java index c12bce14343..f1b66748c15 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/workflow/IssueWorkflow.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/workflow/IssueWorkflow.java @@ -106,20 +106,20 @@ public class IssueWorkflow implements BatchComponent, ServerComponent, Startable .requiredProjectPermission(UserRole.ISSUE_ADMIN) .build()) - // resolve as muted - .transition(Transition.builder(DefaultTransitions.MUTE) + // resolve as won't fix + .transition(Transition.builder(DefaultTransitions.WONT_FIX) .from(Issue.STATUS_OPEN).to(Issue.STATUS_RESOLVED) - .functions(new SetResolution(Issue.RESOLUTION_MUTED), SetAssignee.UNASSIGN) + .functions(new SetResolution(Issue.RESOLUTION_WONT_FIX), SetAssignee.UNASSIGN) .requiredProjectPermission(UserRole.ISSUE_ADMIN) .build()) - .transition(Transition.builder(DefaultTransitions.MUTE) + .transition(Transition.builder(DefaultTransitions.WONT_FIX) .from(Issue.STATUS_REOPENED).to(Issue.STATUS_RESOLVED) - .functions(new SetResolution(Issue.RESOLUTION_MUTED), SetAssignee.UNASSIGN) + .functions(new SetResolution(Issue.RESOLUTION_WONT_FIX), SetAssignee.UNASSIGN) .requiredProjectPermission(UserRole.ISSUE_ADMIN) .build()) - .transition(Transition.builder(DefaultTransitions.MUTE) + .transition(Transition.builder(DefaultTransitions.WONT_FIX) .from(Issue.STATUS_CONFIRMED).to(Issue.STATUS_RESOLVED) - .functions(new SetResolution(Issue.RESOLUTION_MUTED), SetAssignee.UNASSIGN) + .functions(new SetResolution(Issue.RESOLUTION_WONT_FIX), SetAssignee.UNASSIGN) .requiredProjectPermission(UserRole.ISSUE_ADMIN) .build() ); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 573613916fa..92e7d89d03d 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -659,7 +659,7 @@ issue.transition.resolve=Resolve issue.transition.falsepositive=False Positive issue.transition.reopen=Reopen issue.transition.close=Close -issue.transition.mute=Mute +issue.transition.wontfix=Won't fix issue.set_severity=Change Severity issue.set_severity.submit=Change Severity issue.do_plan=Plan @@ -674,7 +674,7 @@ issue.status.CONFIRMED=Confirmed issue.status.CLOSED=Closed issue.resolution.FALSE-POSITIVE=False Positive issue.resolution.FIXED=Fixed -issue.resolution.MUTED=Muted +issue.resolution.WONTFIX=Won't fix issue.resolution.REMOVED=Removed issue.updated=Updated: issue.planned_for_x=Planned for {0} diff --git a/sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java b/sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java index 46d0db5ba0d..1eb2430420a 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java @@ -72,7 +72,7 @@ public class IssueWorkflowTest { DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_OPEN); List transitions = workflow.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("confirm", "falsepositive", "resolve", "mute"); + assertThat(keys(transitions)).containsOnly("confirm", "falsepositive", "resolve", "wontfix"); } @Test @@ -81,7 +81,7 @@ public class IssueWorkflowTest { DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_CONFIRMED); List transitions = workflow.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("unconfirm", "falsepositive", "resolve", "mute"); + assertThat(keys(transitions)).containsOnly("unconfirm", "falsepositive", "resolve", "wontfix"); } @Test @@ -99,7 +99,7 @@ public class IssueWorkflowTest { DefaultIssue issue = new DefaultIssue().setStatus(Issue.STATUS_REOPENED); List transitions = workflow.outTransitions(issue); - assertThat(keys(transitions)).containsOnly("confirm", "mute", "resolve", "falsepositive", "mute"); + assertThat(keys(transitions)).containsOnly("confirm", "resolve", "falsepositive", "wontfix"); } @Test @@ -250,7 +250,7 @@ public class IssueWorkflowTest { } @Test - public void mute() throws Exception { + public void wont_fix() throws Exception { DefaultIssue issue = new DefaultIssue() .setKey("ABCDE") .setStatus(Issue.STATUS_OPEN) @@ -258,9 +258,9 @@ public class IssueWorkflowTest { .setAssignee("morgan"); workflow.start(); - workflow.doTransition(issue, DefaultTransitions.MUTE, IssueChangeContext.createScan(new Date())); + workflow.doTransition(issue, DefaultTransitions.WONT_FIX, IssueChangeContext.createScan(new Date())); - assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_MUTED); + assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_WONT_FIX); assertThat(issue.status()).isEqualTo(Issue.STATUS_RESOLVED); // should remove assignee @@ -282,7 +282,7 @@ public class IssueWorkflowTest { Transition.create("confirm", "OPEN", "CONFIRMED"), Transition.create("resolve", "OPEN", "RESOLVED"), Transition.create("falsepositive", "OPEN", "RESOLVED"), - Transition.create("mute", "OPEN", "RESOLVED") + Transition.create("wontfix", "OPEN", "RESOLVED") ); workflow.doTransition(issue, "resolve", mock(IssueChangeContext.class)); @@ -313,7 +313,7 @@ public class IssueWorkflowTest { Transition.create("confirm", "OPEN", "CONFIRMED"), Transition.create("resolve", "OPEN", "RESOLVED"), Transition.create("falsepositive", "OPEN", "RESOLVED"), - Transition.create("mute", "OPEN", "RESOLVED") + Transition.create("wontfix", "OPEN", "RESOLVED") ); workflow.doTransition(issue, "confirm", mock(IssueChangeContext.class)); @@ -324,7 +324,7 @@ public class IssueWorkflowTest { Transition.create("unconfirm", "CONFIRMED", "REOPENED"), Transition.create("resolve", "CONFIRMED", "RESOLVED"), Transition.create("falsepositive", "CONFIRMED", "RESOLVED"), - Transition.create("mute", "CONFIRMED", "RESOLVED") + Transition.create("wontfix", "CONFIRMED", "RESOLVED") ); // keep confirmed and unresolved diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/DefaultTransitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/DefaultTransitions.java index b8de744b266..7b1e01e0673 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/DefaultTransitions.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/DefaultTransitions.java @@ -38,10 +38,10 @@ public interface DefaultTransitions { /** * @since 5.1 */ - String MUTE = "mute"; + String WONT_FIX = "wontfix"; /** * @since 4.4 */ - List ALL = ImmutableList.of(CONFIRM, UNCONFIRM, REOPEN, RESOLVE, FALSE_POSITIVE, MUTE, CLOSE); + List ALL = ImmutableList.of(CONFIRM, UNCONFIRM, REOPEN, RESOLVE, FALSE_POSITIVE, WONT_FIX, CLOSE); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java index 391830e4131..778b57135c7 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issue.java @@ -66,9 +66,9 @@ public interface Issue extends Serializable { * Issue is irrelevant in the context and was muted by user. * @since 5.1 */ - String RESOLUTION_MUTED = "MUTED"; + String RESOLUTION_WONT_FIX = "WONTFIX"; - List RESOLUTIONS = ImmutableList.of(RESOLUTION_FALSE_POSITIVE, RESOLUTION_MUTED, RESOLUTION_FIXED, RESOLUTION_REMOVED); + List RESOLUTIONS = ImmutableList.of(RESOLUTION_FALSE_POSITIVE, RESOLUTION_WONT_FIX, RESOLUTION_FIXED, RESOLUTION_REMOVED); /** * Return all available statuses -- 2.39.5