diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-04-18 12:15:13 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-04-18 14:09:18 +0200 |
commit | bfeca720d3a702b77664b0164aa02ce89b353cec (patch) | |
tree | e68bad3f6151ed92c89667fa7e92e55cc8487401 /plugins/sonar-core-plugin | |
parent | 5857333fb71af4090a6b3dcb3e972d465873f98d (diff) | |
download | sonarqube-bfeca720d3a702b77664b0164aa02ce89b353cec.tar.gz sonarqube-bfeca720d3a702b77664b0164aa02ce89b353cec.zip |
SONAR-5218 Once a module has been turned into a project, its issues are no more visible in the UI
Diffstat (limited to 'plugins/sonar-core-plugin')
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java index 65b2a5a31a6..1838dc5311e 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java @@ -157,6 +157,7 @@ public class IssueTrackingDecorator implements Decorator { issue.setStatus(ref.getStatus()); issue.setAssignee(ref.getAssignee()); issue.setAuthorLogin(ref.getAuthorLogin()); + if (ref.getIssueAttributes() != null) { issue.setAttributes(KeyValueFormat.parse(ref.getIssueAttributes())); } @@ -180,6 +181,7 @@ public class IssueTrackingDecorator implements Decorator { Long debtInMinutes = ref.getDebt(); Duration previousTechnicalDebt = debtInMinutes != null ? Duration.create(debtInMinutes) : null; updater.setPastTechnicalDebt(issue, previousTechnicalDebt, changeContext); + updater.setPastProject(issue, ref.getRootComponentKey(), changeContext); } } diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/IssueTrackingDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/IssueTrackingDecoratorTest.java index 05aa5bdb2d7..121b473d2d8 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/IssueTrackingDecoratorTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/IssueTrackingDecoratorTest.java @@ -508,7 +508,7 @@ public class IssueTrackingDecoratorTest extends AbstractDaoTestCase { @Test public void merge_matched_issue() throws Exception { IssueDto previousIssue = new IssueDto().setKee("ABCDE").setResolution(null).setStatus("OPEN").setRuleKey_unit_test_only("squid", "AvoidCycle") - .setLine(10).setSeverity("MAJOR").setMessage("Message").setEffortToFix(1.5).setDebt(1L); + .setLine(10).setSeverity("MAJOR").setMessage("Message").setEffortToFix(1.5).setDebt(1L).setRootComponentKey_unit_test_only("sample"); DefaultIssue issue = new DefaultIssue(); IssueTrackingResult trackingResult = mock(IssueTrackingResult.class); @@ -521,6 +521,7 @@ public class IssueTrackingDecoratorTest extends AbstractDaoTestCase { verify(updater).setPastMessage(eq(issue), eq("Message"), any(IssueChangeContext.class)); verify(updater).setPastEffortToFix(eq(issue), eq(1.5), any(IssueChangeContext.class)); verify(updater).setPastTechnicalDebt(eq(issue), eq(Duration.create(1L)), any(IssueChangeContext.class)); + verify(updater).setPastProject(eq(issue), eq("sample"), any(IssueChangeContext.class)); } @Test |