import org.sonar.server.search.IndexClient;
import javax.annotation.Nullable;
-
import java.util.Date;
import static org.sonar.core.purge.PurgeConfiguration.newDefaultPurgeConfiguration;
private final IndexClient indexClient;
public ProjectCleaner(PurgeDao purgeDao, DefaultPeriodCleaner periodCleaner, PurgeProfiler profiler, PurgeListener purgeListener,
- ProjectSettingsFactory projectSettingsFactory, IndexClient indexClient) {
+ ProjectSettingsFactory projectSettingsFactory, IndexClient indexClient) {
this.purgeDao = purgeDao;
this.periodCleaner = periodCleaner;
this.profiler = profiler;
profiler.reset();
Settings settings = projectSettingsFactory.newProjectSettings(session, idUuidPair.getId());
- PurgeConfiguration configuration = newDefaultPurgeConfiguration(settings, idUuidPair.getId());
+ PurgeConfiguration configuration = newDefaultPurgeConfiguration(settings, idUuidPair);
- cleanHistoricalData(session, configuration.rootProjectId(), settings);
+ cleanHistoricalData(session, configuration.rootProjectIdUuid().getId(), settings);
doPurge(session, configuration);
deleteIndexedIssuesBefore(idUuidPair.getUuid(), configuration.maxLiveDateOfClosedIssues());
purgeDao.purge(session, configuration, purgeListener);
} catch (Exception e) {
// purge errors must no fail the report analysis
- LOG.error("Fail to purge data [id=" + configuration.rootProjectId() + "]", e);
+ LOG.error("Fail to purge data [id=" + configuration.rootProjectIdUuid().getId() + "]", e);
}
}
}
private DefaultIssue setComponent(DefaultIssue issue, @Nullable ReportComponent component) {
if (component != null) {
- issue.setComponentId((long) component.id());
issue.setComponentUuid(component.uuid());
}
return issue;
boolean saved = false;
if (issue.isNew()) {
Integer ruleId = ruleCache.get(issue.ruleKey()).getId();
- mapper.insert(IssueDto.toDtoForComputationInsert(issue, issue.componentId(), context.getProject().getId(), ruleId, system2.now()));
+ mapper.insert(IssueDto.toDtoForComputationInsert(issue, ruleId, system2.now()));
count++;
saved = true;
} else if (issue.isChanged()) {
- IssueDto dto = IssueDto.toDtoForUpdate(issue, context.getProject().getId(), system2.now());
+ IssueDto dto = IssueDto.toDtoForUpdate(issue, system2.now());
if (Issue.STATUS_CLOSED.equals(issue.status()) || issue.selectedAt() == null) {
// Issue is closed by scan or changed by end-user
mapper.update(dto);
@Override
protected void doUpdate(DbSession session, long now, DefaultIssue issue) {
- IssueDto dto = IssueDto.toDtoForUpdate(issue, project(session, issue).getId(), now);
+ IssueDto dto = IssueDto.toDtoForUpdate(issue, now);
dbClient.issueDao().update(session, dto);
}
private static final String SQL_ALL = "select " + StringUtils.join(FIELDS, ",") + " from issues i " +
"inner join rules r on r.id=i.rule_id " +
- "inner join projects p on p.id=i.component_id " +
- "inner join projects root on root.id=i.root_component_id";
+ "inner join projects p on p.uuid=i.component_uuid " +
+ "inner join projects root on root.uuid=i.project_uuid";
private static final String SQL_AFTER_DATE = SQL_ALL + " where i.updated_at>?";
storage.save(issue);
- checkTables("should_insert_new_issues", new String[]{"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes");
+ checkTables("should_insert_new_issues", new String[] {"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes");
}
@Test
.setNew(false)
.setChanged(true)
- // updated fields
+ // updated fields
.setLine(5000)
+ .setProjectUuid("CDEF")
.setDebt(Duration.create(10L))
.setChecksum("FFFFF")
.setAuthorLogin("simon")
.setUpdateDate(date)
.setCloseDate(date)
- // unmodifiable fields
+ // unmodifiable fields
.setRuleKey(RuleKey.of("xxx", "unknown"))
.setComponentKey("struts:Action")
.setProjectKey("struts");
storage.save(issue);
- checkTables("should_update_issues", new String[]{"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes");
+ checkTables("should_update_issues", new String[] {"id", "created_at", "updated_at", "issue_change_creation_date"}, "issues", "issue_changes");
}
static class FakeRuleFinder implements RuleFinder {
IssueDto issue = sut.selectByKey(session, "ABCDE");
assertThat(issue.getKee()).isEqualTo("ABCDE");
assertThat(issue.getId()).isEqualTo(100L);
- assertThat(issue.getComponentId()).isEqualTo(401);
- assertThat(issue.getProjectId()).isEqualTo(399);
+ assertThat(issue.getComponentUuid()).isEqualTo("CDEF");
+ assertThat(issue.getProjectUuid()).isEqualTo("ABCD");
assertThat(issue.getRuleId()).isEqualTo(500);
assertThat(issue.getLanguage()).isEqualTo("java");
assertThat(issue.getSeverity()).isEqualTo("BLOCKER");
IssueDto issue = issues.get(0);
assertThat(issue.getKee()).isEqualTo("ABCDE");
assertThat(issue.getActionPlanKey()).isEqualTo("AP-1");
- assertThat(issue.getComponentId()).isEqualTo(401);
- assertThat(issue.getProjectId()).isEqualTo(399);
+ assertThat(issue.getComponentUuid()).isEqualTo("CDEF");
+ assertThat(issue.getProjectUuid()).isEqualTo("ABCD");
assertThat(issue.getRuleId()).isEqualTo(500);
assertThat(issue.getLanguage()).isEqualTo("java");
assertThat(issue.getSeverity()).isEqualTo("BLOCKER");
<issues
id="101"
kee="FGHI"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="501"
severity="CRITICAL"
manual_severity="[true]"
<dataset>
<!-- Multi module project -->
- <projects id="399" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." path="[null]"/>
- <projects id="400" kee="struts-core" root_id="399" qualifier="BRC" scope="PRJ" uuid="BCDE" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD.BCDE."
+ <projects id="399" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" uuid="ABCD" project_uuid="ABCD"
+ module_uuid="[null]" module_uuid_path="." path="[null]"/>
+ <projects id="400" kee="struts-core" root_id="399" qualifier="BRC" scope="PRJ" uuid="BCDE" project_uuid="ABCD"
+ module_uuid="ABCD" module_uuid_path=".ABCD.BCDE."
path="struts-core"/>
- <projects id="401" kee="Action.java" root_id="400" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD" module_uuid="BCDE" module_uuid_path=".ABCD.BCDE."
+ <projects id="401" kee="Action.java" root_id="400" qualifier="CLA" scope="PRJ" uuid="CDEF" project_uuid="ABCD"
+ module_uuid="BCDE" module_uuid_path=".ABCD.BCDE."
path="src/main/java/Action.java"/>
<rules id="500" tags="[null]" system_tags="[null]" plugin_rule_key="AvoidCycle" plugin_name="squid" language="java"/>
<issues
id="100"
kee="EFGH"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
technical_debt="10"
message="[null]"
line="5000"
- component_id="100"
component_uuid="BCDE"
project_uuid="ABCD"
- root_component_id="10"
rule_id="200"
created_at="1000000000"
updated_at="1000000000"
technical_debt="10"
message="[null]"
line="5000"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="10"
+ component_uuid="BCDE"
+ project_uuid="CDEF"
rule_id="200"
created_at="1000000000"
updated_at="2000000000"
technical_debt="[null]"
message="[null]"
line="3000"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="10"
+ component_uuid="BCDE"
+ project_uuid="ABCD"
rule_id="200"
created_at="1000000000"
updated_at="1000000000"
issue_creation_date="2010-01-01"
issue_update_date="2010-02-02"
issue_close_date="[null]"
- />
+ />
</dataset>
<issues
id="100"
kee="ABCDE"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
component_uuid="component-uuid"
project_uuid="project-uuid"
- root_component_id="100"
rule_id="200"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="100"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="102"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="103"
kee="103"
- component_id="400"
- root_component_id="399"
+ component_uuid="BCDE"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="104"
kee="104"
- component_id="399"
- root_component_id="399"
+ component_uuid="ABCD"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="1000"
kee="1000"
- component_id="1001"
- root_component_id="1000"
+ component_uuid="EDCB"
+ project_uuid="DBCA"
rule_id="500"
severity="BLOCKER"
manual_severity="[true]"
<issues
id="100"
kee="100"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="102"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="103"
kee="103"
- component_id="400"
- root_component_id="399"
+ component_uuid="BCDE"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="104"
kee="104"
- component_id="399"
- root_component_id="399"
+ component_uuid="ABCD"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="1000"
kee="1000"
- component_id="1001"
- root_component_id="1000"
+ component_uuid="EDCB"
+ project_uuid="DBCA"
rule_id="500"
severity="BLOCKER"
manual_severity="[true]"
--- /dev/null
+<dataset>
+ <issues
+ id="100"
+ kee="ABCDE"
+ component_uuid="123"
+ project_uuid="101"
+ rule_id="200"
+ severity="BLOCKER"
+ manual_severity="[false]"
+ message="the message"
+ line="500"
+ effort_to_fix="3.14"
+ technical_debt="10"
+ status="RESOLVED"
+ resolution="FIXED"
+ checksum="123456789"
+ reporter="emmerik"
+ author_login="morgan"
+ assignee="karadoc"
+ issue_attributes="JIRA=FOO-1234"
+ tags="[null]"
+ issue_creation_date="2013-05-18"
+ issue_update_date="2013-05-19"
+ issue_close_date="2013-05-20"
+ created_at="1400000000000"
+ updated_at="1450000000000"
+ action_plan_key="current_sprint"
+ />
+</dataset>
--- /dev/null
+<dataset>
+ <issues
+ id="100"
+ kee="ABCDE"
+ component_uuid="123"
+ project_uuid="100"
+ rule_id="200"
+ severity="INFO"
+ manual_severity="[false]"
+ message="old"
+ line="[null]"
+ effort_to_fix="[null]"
+ technical_debt="[null]"
+ status="OPEN"
+ resolution="[null]"
+ checksum="[null]"
+ reporter="[null]"
+ author_login="[null]"
+ assignee="[null]"
+ issue_attributes="[null]"
+ issue_creation_date="[null]"
+ issue_update_date="[null]"
+ issue_close_date="[null]"
+ created_at="1400000000000"
+ updated_at="1400000000000"
+ action_plan_key="[null]"
+ />
+</dataset>
<projects id="10" scope="PRJ" qualifier="TRK" kee="the_project" name="TheProject"
uuid="THE_PROJECT" module_uuid="[null]" module_uuid_path="." path="[null]"/>
<projects id="11" scope="FIL" qualifier="FIL" kee="abcde" name="TheFile"
- uuid="THE_FILE" module_uuid="THE_PROJECT" module_uuid_path=".THE_PROJECT." path="src/main/java/TheFile.java"/>
+ uuid="THE_FILE" module_uuid="THE_PROJECT" module_uuid_path=".THE_PROJECT."
+ path="src/main/java/TheFile.java"/>
<issues id="1"
kee="ABCDE"
technical_debt="[null]"
message="[null]"
line="444"
- component_id="11"
- root_component_id="10"
+ component_uuid="THE_FILE"
+ project_uuid="THE_PROJECT"
rule_id="1"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
issue_creation_date="2005-05-12 00:00:00.0"
issue_update_date="2013-05-18 00:00:00.0"
issue_close_date="[null]"
- />
+ />
</dataset>
technical_debt="10"
message="[null]"
line="444"
- component_id="100"
- root_component_id="10"
+ component_uuid="FILE1"
+ project_uuid="PROJECT1"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
technical_debt="15"
message="[null]"
line="444"
- component_id="101"
- root_component_id="10"
+ component_uuid="ROOT_FILE1"
+ project_uuid="PROJECT1"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
technical_debt="15"
message="[null]"
line="444"
- component_id="10"
- root_component_id="10"
+ component_uuid="PROJECT1"
+ project_uuid="PROJECT1"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
technical_debt="10"
message="[null]"
line="444"
- component_id="100"
- root_component_id="10"
+ component_uuid="FILE1"
+ project_uuid="PROJECT1"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
technical_debt="15"
message="[null]"
line="444"
- component_id="100"
- root_component_id="10"
+ component_uuid="FILE1"
+ project_uuid="PROJECT1"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
--- /dev/null
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube 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.
+#
+# SonarQube 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.
+#
+
+#
+# SonarQube 5.1
+#
+class RemoveIssueComponentIds < ActiveRecord::Migration
+
+ def self.up
+ remove_index 'issues', :name => 'issues_component_id'
+ remove_index 'issues', :name => 'issues_root_component_id'
+ remove_column 'issues', 'component_id'
+ remove_column 'issues', 'root_component_id'
+ change_column 'issues', :component_uuid, :string, :limit => 50, :null => false
+ change_column 'issues', :project_uuid, :string, :limit => 50, :null => false
+ end
+end
import org.sonar.batch.user.User;
import org.sonar.batch.user.UserRepository;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
+import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;
private final UserRepository userRepository;
public JSONReport(Settings settings, FileSystem fileSystem, Server server, ActiveRules activeRules, IssueCache issueCache,
- Project rootModule, InputPathCache fileCache, UserRepository userRepository) {
+ Project rootModule, InputPathCache fileCache, UserRepository userRepository) {
this.settings = settings;
this.fileSystem = fileSystem;
this.server = server;
@Override
public DefaultPurgeTask purge(long resourceId) {
long start = System.currentTimeMillis();
- String resourceQualifier = resourceDao.getResource(resourceId).getQualifier();
- if (isNotViewNorSubview(resourceQualifier)) {
+ ResourceDto component = resourceDao.getResource(resourceId);
+ if (isNotViewNorSubview(component.getQualifier())) {
profiler.reset();
cleanHistoricalData(resourceId);
- doPurge(resourceId);
+ doPurge(new IdUuidPair(component.getId(), component.getUuid()));
if (settings.getBoolean(CoreProperties.PROFILING_LOG_PROPERTY)) {
long duration = System.currentTimeMillis() - start;
LOG.info("\n -------- Profiling for purge: " + TimeUtils.formatDuration(duration) + " --------\n");
}
}
- private void doPurge(long resourceId) {
+ private void doPurge(IdUuidPair componentIdUuid) {
try {
- purgeDao.purge(newPurgeConfigurationOnResource(resourceId), PurgeListener.EMPTY);
+ purgeDao.purge(newPurgeConfigurationOnResource(componentIdUuid), PurgeListener.EMPTY);
} catch (Exception e) {
// purge errors must not fail the report analysis
- LOG.error("Fail to purge data [id=" + resourceId + "]", e);
+ LOG.error("Fail to purge data [id=" + componentIdUuid + "]", e);
}
}
- public PurgeConfiguration newPurgeConfigurationOnResource(long resourceId) {
- return newDefaultPurgeConfiguration(settings, resourceId);
+ public PurgeConfiguration newPurgeConfigurationOnResource(IdUuidPair componentIdUuid) {
+ return newDefaultPurgeConfiguration(settings, componentIdUuid);
}
}
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
private Long id;
private String kee;
- private Long componentId;
- private Long projectId;
+ private String componentUuid;
+ private String projectUuid;
private Integer ruleId;
private String severity;
private boolean manualSeverity;
private String ruleRepo;
private String language;
private String componentKey;
- private String componentUuid;
private String moduleUuid;
private String moduleUuidPath;
private String projectKey;
- private String projectUuid;
private String filePath;
private String tags;
return this;
}
- public Long getComponentId() {
- return componentId;
- }
-
public IssueDto setComponent(ComponentDto component) {
- this.componentId = component.getId();
this.componentKey = component.getKey();
this.componentUuid = component.uuid();
this.moduleUuid = component.moduleUuid();
return this;
}
- /**
- * please use setComponent(ComponentDto component)
- */
- public IssueDto setComponentId(Long componentId) {
- this.componentId = componentId;
- return this;
- }
-
- public Long getProjectId() {
- return projectId;
- }
-
public IssueDto setProject(ComponentDto project) {
- this.projectId = project.getId();
this.projectKey = project.getKey();
this.projectUuid = project.uuid();
return this;
}
- /**
- * please use setProject
- */
- public IssueDto setProjectId(Long projectId) {
- this.projectId = projectId;
- return this;
- }
-
public Integer getRuleId() {
return ruleId;
}
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setRule(org.sonar.core.rule.RuleDto)} instead
*/
public IssueDto setRuleKey(String repo, String rule) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setRule(org.sonar.core.rule.RuleDto)} instead
*/
public IssueDto setLanguage(String language) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setComponent(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setComponentKey(String componentKey) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setComponent(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setComponentUuid(@Nullable String componentUuid) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setComponent(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setModuleUuid(@Nullable String moduleUuid) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setComponent(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setModuleUuidPath(@Nullable String moduleUuidPath) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setProjectKey(String projectKey) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setProjectUuid(@Nullable String projectUuid) {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead
*/
public String getFilePath() {
/**
* Should only be used to persist in E/S
- *
+ * <p/>
* Please use {@link #setProject(org.sonar.core.component.ComponentDto)} instead
*/
public IssueDto setFilePath(String filePath) {
/**
* On batch side, component keys and uuid are useless
*/
- public static IssueDto toDtoForComputationInsert(DefaultIssue issue, long componentId, long projectId, int ruleId, long now) {
+ public static IssueDto toDtoForComputationInsert(DefaultIssue issue, int ruleId, long now) {
return new IssueDto()
.setKee(issue.key())
.setLine(issue.line())
.setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule())
.setTags(issue.tags())
.setComponentUuid(issue.componentUuid())
- .setComponentId(componentId)
.setComponentKey(issue.componentKey())
.setModuleUuid(issue.moduleUuid())
.setModuleUuidPath(issue.moduleUuidPath())
.setComponentUuid(issue.componentUuid())
.setProjectUuid(issue.projectUuid())
- .setProjectId(projectId)
.setProjectKey(issue.projectKey())
.setActionPlanKey(issue.actionPlanKey())
.setIssueAttributes(KeyValueFormat.format(issue.attributes()))
* On server side, we need component keys and uuid
*/
public static IssueDto toDtoForServerInsert(DefaultIssue issue, ComponentDto component, ComponentDto project, int ruleId, long now) {
- return toDtoForComputationInsert(issue, component.getId(), project.getId(), ruleId, now)
+ return toDtoForComputationInsert(issue, ruleId, now)
.setComponent(component)
.setProject(project);
}
- public static IssueDto toDtoForUpdate(DefaultIssue issue, Long rootComponentId, long now) {
+ public static IssueDto toDtoForUpdate(DefaultIssue issue, long now) {
// Invariant fields, like key and rule, can't be updated
return new IssueDto()
.setKee(issue.key())
.setModuleUuidPath(issue.moduleUuidPath())
.setProjectUuid(issue.projectUuid())
.setProjectKey(issue.projectKey())
- .setProjectId(rootComponentId)
.setIssueCreationDate(issue.creationDate())
.setIssueCloseDate(issue.closeDate())
.setIssueUpdateDate(issue.updateDate())
.setSelectedAt(issue.selectedAt())
- // technical date
+ // technical date
.setUpdatedAt(now);
}
issue.setAssignee(assignee);
issue.setAttributes(KeyValueFormat.parse(Objects.firstNonNull(issueAttributes, "")));
issue.setComponentKey(componentKey);
- issue.setComponentId(componentId);
issue.setComponentUuid(componentUuid);
issue.setModuleUuid(moduleUuid);
issue.setModuleUuidPath(moduleUuidPath);
public static IssueDto createFor(Project project, RuleDto rule) {
return new IssueDto()
- .setProjectId(Long.valueOf(project.getId()))
+ .setProjectUuid(project.getUuid())
.setRuleId(rule.getId())
.setKee(Uuids.create());
}
IssueDto dbIssue = mapper.selectByKey(issue.key());
if (dbIssue != null) {
mergeFields(dbIssue, issue);
- mapper.update(IssueDto.toDtoForUpdate(issue, dbIssue.getProjectId(), System.currentTimeMillis()));
+ mapper.update(IssueDto.toDtoForUpdate(issue, System.currentTimeMillis()));
}
}
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 772;
+ public static final int LAST_VERSION = 773;
/**
* List of all the tables.n
import java.sql.SQLException;
public class PreviewDatabaseFactory implements ServerComponent {
+ public static final String H2_FILE_SUFFIX = ".h2.db";
private static final String DIALECT = "h2";
private static final String DRIVER = "org.h2.Driver";
private static final String URL = "jdbc:h2:";
- public static final String H2_FILE_SUFFIX = ".h2.db";
private static final String SONAR = "sonar";
private static final String USER = SONAR;
private static final String PASSWORD = SONAR;
.append(" INNER JOIN (")
.append(projectQuery(projectId, true))
.append(") resources")
- .append(" ON issues.component_id=resources.id")
+ .append(" ON issues.component_uuid=resources.uuid")
.append(" AND status <> '").append(Issue.STATUS_CLOSED).append("'");
template.copyTable(source, dest, "issues", issueQuery.toString());
}
private String projectQuery(Long projectId, boolean returnOnlyIds) {
return new StringBuilder()
- .append("SELECT p.").append(returnOnlyIds ? "id" : "*")
+ .append("SELECT p.").append(returnOnlyIds ? "id, p.uuid" : "*")
.append(" FROM projects p INNER JOIN snapshots s ON p.id = s.project_id")
.append(" WHERE s.islast=").append(database.getDialect().getTrueSqlValue())
.append(" AND s.root_project_id=").append(projectId)
.append(" UNION")
- .append(" SELECT p.").append(returnOnlyIds ? "id" : "*")
+ .append(" SELECT p.").append(returnOnlyIds ? "id, p.uuid" : "*")
.append(" FROM projects p")
.append(" WHERE p.id=").append(projectId)
.append(" OR p.root_id=").append(projectId).toString();
package org.sonar.core.purge;
+import com.google.common.base.Function;
import com.google.common.collect.Lists;
import java.util.List;
}
public static List<Long> ids(List<IdUuidPair> pairs) {
- List<Long> ids = Lists.newArrayList();
-
- for (IdUuidPair idUuidPair : pairs) {
- ids.add(idUuidPair.getId());
- }
-
- return ids;
+ return Lists.transform(pairs, new Function<IdUuidPair, Long>() {
+ @Override
+ public Long apply(IdUuidPair pair) {
+ return pair.getId();
+ }
+ });
}
- public static List<String> uuids(List<IdUuidPair> idUuidPairList) {
- List<String> uuids = Lists.newArrayList();
-
- for (IdUuidPair idUuidPair : idUuidPairList) {
- uuids.add(idUuidPair.getUuid());
- }
-
- return uuids;
+ public static List<String> uuids(List<IdUuidPair> pairs) {
+ return Lists.transform(pairs, new Function<IdUuidPair, String>() {
+ @Override
+ public String apply(IdUuidPair pair) {
+ return pair.getUuid();
+ }
+ });
}
}
return purgeMapper.selectSnapshotIds(query);
}
- void deleteResources(List<Long> resourceIds) {
- List<List<Long>> resourceIdsPartition = Lists.partition(resourceIds, MAX_RESOURCES_PER_QUERY);
+ void deleteResources(List<IdUuidPair> componentIdUuids) {
+ List<List<Long>> componentIdPartitions = Lists.partition(IdUuidPairs.ids(componentIdUuids), MAX_RESOURCES_PER_QUERY);
+ List<List<String>> componentUuidsPartitions = Lists.partition(IdUuidPairs.uuids(componentIdUuids), MAX_RESOURCES_PER_QUERY);
// Note : do not merge the delete statements into a single loop of resource ids. It's
// voluntarily grouped by tables in order to benefit from JDBC batch mode.
// Batch requests can only relate to the same PreparedStatement.
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
deleteSnapshots(purgeMapper.selectSnapshotIdsByResource(partResourceIds));
}
// possible missing optimization: filter requests according to resource scope
profiler.start("deleteResourceLinks (project_links)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceLinks(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceProperties (properties)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceProperties(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceIndex (resource_index)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceIndex(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceGroupRoles (group_roles)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceGroupRoles(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceUserRoles (user_roles)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceUserRoles(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceManualMeasures (manual_measures)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceManualMeasures(partResourceIds);
}
session.commit();
profiler.stop();
- profiler.start("deleteResourceIssueChanges (issue_changes)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
- purgeMapper.deleteResourceIssueChanges(partResourceIds);
+ profiler.start("deleteComponentIssueChanges (issue_changes)");
+ for (List<String> componentUuidPartition : componentUuidsPartitions) {
+ purgeMapper.deleteComponentIssueChanges(componentUuidPartition);
}
session.commit();
profiler.stop();
- profiler.start("deleteResourceIssues (issues)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
- purgeMapper.deleteResourceIssues(partResourceIds);
+ profiler.start("deleteComponentIssues (issues)");
+ for (List<String> componentUuidPartition : componentUuidsPartitions) {
+ purgeMapper.deleteComponentIssues(componentUuidPartition);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceActionPlans (action_plans)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceActionPlans(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceEvents (events)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceEvents(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResourceGraphs (graphs)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResourceGraphs(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteResource (projects)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteResource(partResourceIds);
}
session.commit();
profiler.stop();
profiler.start("deleteAuthors (authors)");
- for (List<Long> partResourceIds : resourceIdsPartition) {
+ for (List<Long> partResourceIds : componentIdPartitions) {
purgeMapper.deleteAuthors(partResourceIds);
}
session.commit();
import org.sonar.core.computation.dbcleaner.DbCleanerConstants;
import javax.annotation.CheckForNull;
-
import java.util.Date;
public class PurgeConfiguration {
- private final long rootProjectId;
+ private final IdUuidPair rootProjectIdUuid;
private final String[] scopesWithoutHistoricalData;
private final int maxAgeInDaysOfClosedIssues;
private final System2 system2;
- public PurgeConfiguration(long rootProjectId, String[] scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues) {
+ public PurgeConfiguration(IdUuidPair rootProjectId, String[] scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues) {
this(rootProjectId, scopesWithoutHistoricalData, maxAgeInDaysOfClosedIssues, System2.INSTANCE);
}
@VisibleForTesting
- PurgeConfiguration(long rootProjectId, String[] scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues, System2 system2) {
- this.rootProjectId = rootProjectId;
+ PurgeConfiguration(IdUuidPair rootProjectId, String[] scopesWithoutHistoricalData, int maxAgeInDaysOfClosedIssues, System2 system2) {
+ this.rootProjectIdUuid = rootProjectId;
this.scopesWithoutHistoricalData = scopesWithoutHistoricalData;
this.maxAgeInDaysOfClosedIssues = maxAgeInDaysOfClosedIssues;
this.system2 = system2;
}
- public static PurgeConfiguration newDefaultPurgeConfiguration(Settings settings, long resourceId) {
- String[] scopes = new String[] {Scopes.FILE};
+ public static PurgeConfiguration newDefaultPurgeConfiguration(Settings settings, IdUuidPair idUuidPair) {
+ String[] scopes = new String[]{Scopes.FILE};
if (settings.getBoolean(DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY)) {
- scopes = new String[] {Scopes.DIRECTORY, Scopes.FILE};
+ scopes = new String[]{Scopes.DIRECTORY, Scopes.FILE};
}
- return new PurgeConfiguration(resourceId, scopes, settings.getInt(DbCleanerConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES));
+ return new PurgeConfiguration(idUuidPair, scopes, settings.getInt(DbCleanerConstants.DAYS_BEFORE_DELETING_CLOSED_ISSUES));
}
- public long rootProjectId() {
- return rootProjectId;
+ public IdUuidPair rootProjectIdUuid() {
+ return rootProjectIdUuid;
}
public String[] scopesWithoutHistoricalData() {
public void purge(DbSession session, PurgeConfiguration conf, PurgeListener purgeListener) {
PurgeMapper mapper = session.getMapper(PurgeMapper.class);
PurgeCommands commands = new PurgeCommands(session, mapper, profiler);
- List<ResourceDto> projects = getProjects(conf.rootProjectId(), session);
+ List<ResourceDto> projects = getProjects(conf.rootProjectIdUuid().getId(), session);
for (ResourceDto project : projects) {
LOG.info("-> Clean " + project.getLongName() + " [id=" + project.getId() + "]");
deleteAbortedBuilds(project, commands);
private void deleteOldClosedIssues(PurgeConfiguration conf, PurgeMapper mapper) {
Date toDate = conf.maxLiveDateOfClosedIssues();
- mapper.deleteOldClosedIssueChanges(conf.rootProjectId(), toDate);
- mapper.deleteOldClosedIssues(conf.rootProjectId(), toDate);
+ mapper.deleteOldClosedIssueChanges(conf.rootProjectIdUuid().getUuid(), toDate);
+ mapper.deleteOldClosedIssues(conf.rootProjectIdUuid().getUuid(), toDate);
}
private void deleteAbortedBuilds(ResourceDto project, PurgeCommands commands) {
LOG.info("<- Delete aborted builds");
PurgeSnapshotQuery query = PurgeSnapshotQuery.create()
.setIslast(false)
- .setStatus(new String[] {"U"})
+ .setStatus(new String[]{"U"})
.setRootProjectId(project.getId());
commands.deleteSnapshots(query);
}
private boolean hasAbortedBuilds(Long projectId, PurgeCommands commands) {
PurgeSnapshotQuery query = PurgeSnapshotQuery.create()
.setIslast(false)
- .setStatus(new String[] {"U"})
+ .setStatus(new String[]{"U"})
.setResourceId(projectId);
return !commands.selectSnapshotIds(query).isEmpty();
}
.setResourceId(project.getId())
.setIslast(false)
.setNotPurged(true)
- );
+ );
for (final Long projectSnapshotId : projectSnapshotIds) {
LOG.info("<- Clean snapshot " + projectSnapshotId);
if (!ArrayUtils.isEmpty(scopesWithoutHistoricalData)) {
}
private void disableOrphanResources(final ResourceDto project, final SqlSession session, final PurgeMapper purgeMapper, final PurgeListener purgeListener) {
- session.select("org.sonar.core.purge.PurgeMapper.selectResourceIdsToDisable", project.getId(), new ResultHandler() {
+ session.select("org.sonar.core.purge.PurgeMapper.selectComponentIdUuidsToDisable", project.getId(), new ResultHandler() {
@Override
public void handleResult(ResultContext resultContext) {
- IdUuidPair resourceIdUuid = (IdUuidPair) resultContext.getResultObject();
- if (resourceIdUuid.getId() != null) {
- disableResource(resourceIdUuid, purgeMapper);
- purgeListener.onComponentDisabling(resourceIdUuid.getUuid());
+ IdUuidPair componentIdUuid = (IdUuidPair) resultContext.getResultObject();
+ if (componentIdUuid.getId() != null) {
+ disableResource(componentIdUuid, purgeMapper);
+ purgeListener.onComponentDisabling(componentIdUuid.getUuid());
}
}
});
final DbSession session = mybatis.openSession(true);
final PurgeMapper mapper = session.getMapper(PurgeMapper.class);
try {
- deleteProject(rootIdUuid.getId(), mapper, new PurgeCommands(session, profiler));
+ deleteProject(rootIdUuid, mapper, new PurgeCommands(session, profiler));
deleteFileSources(rootIdUuid.getUuid(), new PurgeCommands(session, profiler));
return this;
} finally {
commands.deleteFileSources(rootUuid);
}
- private void deleteProject(long rootProjectId, PurgeMapper mapper, PurgeCommands commands) {
- List<Long> childrenIds = mapper.selectProjectIdsByRootId(rootProjectId);
- for (Long childId : childrenIds) {
+ private void deleteProject(IdUuidPair rootProjectId, PurgeMapper mapper, PurgeCommands commands) {
+ List<IdUuidPair> childrenIdUuid = mapper.selectProjectIdUuidsByRootId(rootProjectId.getId());
+ for (IdUuidPair childId : childrenIdUuid) {
deleteProject(childId, mapper, commands);
}
- List<Long> resourceIds = mapper.selectResourceIdsByRootId(rootProjectId);
- commands.deleteResources(resourceIds);
+ List<IdUuidPair> componentIdUuids = mapper.selectComponentIdUuidsByRootId(rootProjectId.getId());
+ commands.deleteResources(componentIdUuids);
}
- private void disableResource(IdUuidPair resourceIdUuid, PurgeMapper mapper) {
- long resourceId = resourceIdUuid.getId();
- mapper.deleteResourceIndex(Arrays.asList(resourceId));
- mapper.setSnapshotIsLastToFalse(resourceId);
- mapper.deleteFileSourcesByUuid(resourceIdUuid.getUuid());
- mapper.disableResource(resourceId);
- mapper.resolveResourceIssuesNotAlreadyResolved(resourceId, new Date(system2.now()), system2.now());
+ private void disableResource(IdUuidPair componentIdUuid, PurgeMapper mapper) {
+ long componentId = componentIdUuid.getId();
+ mapper.deleteResourceIndex(Arrays.asList(componentId));
+ mapper.setSnapshotIsLastToFalse(componentId);
+ mapper.deleteFileSourcesByUuid(componentIdUuid.getUuid());
+ mapper.disableResource(componentId);
+ mapper.resolveResourceIssuesNotAlreadyResolved(componentIdUuid.getUuid(), new Date(system2.now()), system2.now());
}
public PurgeDao deleteSnapshots(PurgeSnapshotQuery query) {
import org.apache.ibatis.annotations.Param;
import javax.annotation.Nullable;
-
import java.util.Date;
import java.util.List;
List<Long> selectSnapshotIdsByResource(@Param("resourceIds") List<Long> resourceIds);
- List<Long> selectProjectIdsByRootId(long rootResourceId);
+ List<IdUuidPair> selectProjectIdUuidsByRootId(long rootResourceId);
+
+ List<IdUuidPair> selectComponentIdUuidsByRootId(long rootProjectId);
void deleteSnapshot(@Param("snapshotIds") List<Long> snapshotIds);
void disableResource(long resourceId);
- void resolveResourceIssuesNotAlreadyResolved(@Param("resourceId") long resourceId, @Param("date") Date date, @Param("dateAsLong") Long dateAsLong);
+ void resolveResourceIssuesNotAlreadyResolved(@Param("componentUuid") String componentUuid, @Param("date") Date date, @Param("dateAsLong") Long dateAsLong);
void deleteResourceIndex(@Param("resourceIds") List<Long> resourceIds);
List<PurgeableSnapshotDto> selectPurgeableSnapshotsWithoutEvents(long resourceId);
- List<Long> selectResourceIdsByRootId(long rootProjectId);
-
- void deleteResourceIssueChanges(@Param("resourceIds") List<Long> resourceIds);
+ void deleteComponentIssueChanges(@Param("componentUuids") List<String> componentUuids);
- void deleteResourceIssues(@Param("resourceIds") List<Long> resourceIds);
+ void deleteComponentIssues(@Param("componentUuids") List<String> componentUuids);
- void deleteOldClosedIssueChanges(@Param("rootProjectId") long rootProjectId, @Nullable @Param("toDate") Date toDate);
+ void deleteOldClosedIssueChanges(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Date toDate);
- void deleteOldClosedIssues(@Param("rootProjectId") long rootProjectId, @Nullable @Param("toDate") Date toDate);
+ void deleteOldClosedIssues(@Param("projectUuid") String projectUuid, @Nullable @Param("toDate") Date toDate);
void deleteFileSourcesByProjectUuid(String rootProjectUuid);
<include refid="issueChangeColumns"/>
from issue_changes c
inner join issues i on i.kee = c.issue_key
- inner join (select p.id,p.kee from projects p where (p.root_id=#{componentId} and p.qualifier <> 'BRC') or
- (p.id=#{componentId})) p on p.id=i.component_id
+ inner join (select p.id, p.uuid, p.kee from projects p where (p.root_id=#{componentId} and p.qualifier <> 'BRC') or
+ (p.id=#{componentId})) p on p.uuid=i.component_uuid
<where>
and c.change_type=#{changeType}
and i.status <> 'CLOSED'
<sql id="issueColumns">
i.id,
i.kee as kee,
- i.component_id as componentId,
- i.root_component_id as projectId,
i.rule_id as ruleId,
i.action_plan_key as actionPlanKey,
i.severity as severity,
r.plugin_name as ruleRepo,
r.language as language,
p.kee as componentKey,
- p.uuid as componentUuid,
+ i.component_uuid as componentUuid,
p.module_uuid as moduleUuid,
p.module_uuid_path as moduleUuidPath,
p.path as filePath,
root.kee as projectKey,
- root.uuid as projectUuid
+ i.project_uuid as projectUuid
</sql>
<sql id="sortColumn">
</sql>
<insert id="insert" parameterType="Issue" useGeneratedKeys="false" keyProperty="id">
- INSERT INTO issues (kee, component_id, root_component_id, rule_id, action_plan_key, severity, manual_severity,
+ INSERT INTO issues (kee, rule_id, action_plan_key, severity, manual_severity,
message, line, effort_to_fix, technical_debt, status, tags,
resolution, checksum, reporter, assignee, author_login, issue_attributes, issue_creation_date, issue_update_date,
issue_close_date, created_at, updated_at, component_uuid, project_uuid)
- VALUES (#{kee,jdbcType=VARCHAR}, #{componentId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT},
- #{ruleId,jdbcType=INTEGER}, #{actionPlanKey,jdbcType=VARCHAR}, #{severity,jdbcType=VARCHAR},
+ VALUES (#{kee,jdbcType=VARCHAR}, #{ruleId,jdbcType=INTEGER}, #{actionPlanKey,jdbcType=VARCHAR},
+ #{severity,jdbcType=VARCHAR},
#{manualSeverity,jdbcType=BOOLEAN}, #{message,jdbcType=VARCHAR}, #{line,jdbcType=INTEGER},
#{effortToFix,jdbcType=DOUBLE}, #{debt,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR},
#{tagsString,jdbcType=VARCHAR}, #{resolution,jdbcType=VARCHAR}, #{checksum,jdbcType=VARCHAR},
assignee=#{assignee},
author_login=#{authorLogin},
tags=#{tagsString},
- root_component_id=#{projectId},
project_uuid=#{projectUuid},
issue_attributes=#{issueAttributes},
issue_creation_date=#{issueCreationDate},
assignee=#{assignee},
author_login=#{authorLogin},
tags=#{tagsString},
- root_component_id=#{projectId},
project_uuid=#{projectUuid},
issue_attributes=#{issueAttributes},
issue_creation_date=#{issueCreationDate},
<include refid="issueColumns"/>
from issues i
inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
+ inner join projects p on p.uuid=i.component_uuid
+ inner join projects root on root.uuid=i.project_uuid
where i.kee=#{kee}
</select>
select
i.id,
i.kee as kee,
- i.component_id as componentId,
- i.root_component_id as projectId,
i.rule_id as ruleId,
i.component_uuid as componentUuid,
i.project_uuid as projectUuid,
p.kee as componentKey,
root.kee as projectKey
from issues i
- inner join (select p.id,p.kee from projects p where (p.root_id=#{id} and p.qualifier <> 'BRC') or
- (p.id=#{id})) p on p.id=i.component_id
+ inner join (select p.id, p.uuid,p.kee from projects p where (p.root_id=#{id} and p.qualifier <> 'BRC') or
+ (p.id=#{id})) p on p.uuid=i.component_uuid
inner join rules r on r.id=i.rule_id
- left outer join projects root on root.id=i.root_component_id
+ left outer join projects root on root.uuid=i.project_uuid
where i.status <> 'CLOSED'
</select>
r.plugin_name as ruleRepo,
component.kee as componentKey
FROM issues i
- INNER JOIN (SELECT p.id,p.kee FROM projects p WHERE p.module_uuid=#{uuid} OR p.uuid=#{uuid}) component ON
- component.id=i.component_id
+ INNER JOIN (SELECT p.id,p.uuid, p.kee FROM projects p WHERE p.module_uuid=#{uuid} OR p.uuid=#{uuid}) component ON
+ component.uuid=i.component_uuid
INNER JOIN rules r ON r.id=i.rule_id
WHERE i.status <> 'CLOSED'
</select>
r.plugin_name as ruleRepo,
component.kee as componentKey
FROM issues i
- INNER JOIN projects component on component.id=i.component_id
- INNER JOIN projects project on project.uuid=component.project_uuid AND project.uuid=#{uuid}
+ INNER JOIN projects component on component.uuid=i.component_uuid
INNER JOIN rules r ON r.id=i.rule_id
- WHERE i.status <> 'CLOSED'
+ WHERE i.status <> 'CLOSED' AND i.project_uuid=#{uuid}
</select>
<select id="selectByKeys" parameterType="map" resultType="Issue">
<include refid="issueColumns"/>
from issues i
inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
+ inner join projects p on p.uuid=i.component_uuid
+ inner join projects root on root.uuid=i.project_uuid
where i.kee in
<foreach collection="list" open="(" close=")" item="key" separator=",">
#{key}
<include refid="issueColumns"/>
from issues i
inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
+ inner join projects p on p.uuid=i.component_uuid
+ inner join projects root on root.uuid=i.project_uuid
<where>
and i.action_plan_key=#{action_plan}
</where>
SELECT
<include refid="org.sonar.core.rule.RuleMapper.selectColumns"/>
FROM issues i
- INNER JOIN projects p on p.id=i.component_id
+ INNER JOIN projects p on p.uuid=i.component_uuid
INNER JOIN rules r on r.id=i.rule_id
WHERE
p.kee=#{componentKey}
<select id="findSeveritiesByComponent" parameterType="String" resultType="String">
SELECT i.severity
FROM issues i
- INNER JOIN projects on projects.id=i.component_id
+ INNER JOIN projects on projects.uuid=i.component_uuid
INNER JOIN rules on rules.id=i.rule_id
WHERE
projects.kee=#{componentKey}
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('770');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('771');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('772');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('773');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
CREATE TABLE "ISSUES" (
"ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"KEE" VARCHAR(50) UNIQUE NOT NULL,
- "COMPONENT_ID" INTEGER NOT NULL,
- "COMPONENT_UUID" VARCHAR(50),
- "ROOT_COMPONENT_ID" INTEGER,
- "PROJECT_UUID" VARCHAR(50),
+ "COMPONENT_UUID" VARCHAR(50) NOT NULL,
+ "PROJECT_UUID" VARCHAR(50) NOT NULL,
"RULE_ID" INTEGER,
"SEVERITY" VARCHAR(10),
"MANUAL_SEVERITY" BOOLEAN NOT NULL,
CREATE UNIQUE INDEX "ISSUES_KEE" ON "ISSUES" ("KEE");
-CREATE INDEX "ISSUES_COMPONENT_ID" ON "ISSUES" ("COMPONENT_ID");
-
CREATE INDEX "ISSUES_COMPONENT_UUID" ON "ISSUES" ("COMPONENT_UUID");
-CREATE INDEX "ISSUES_ROOT_COMPONENT_ID" ON "ISSUES" ("ROOT_COMPONENT_ID");
-
CREATE INDEX "ISSUES_PROJECT_UUID" ON "ISSUES" ("PROJECT_UUID");
CREATE INDEX "ISSUES_RULE_ID" ON "ISSUES" ("RULE_ID");
not exists(select e.id from events e where e.snapshot_id=s.id)
</select>
- <select id="selectResourceIdsToDisable" resultType="IdUuidPair" parameterType="long">
+ <select id="selectComponentIdUuidsToDisable" resultType="IdUuidPair" parameterType="long">
select p.id, p.uuid from projects p
where (p.id=#{id} or p.root_id=#{id}) and p.enabled=${_true}
and not exists(select s.project_id from snapshots s where s.islast=${_true} and s.project_id=p.id)
select id from metrics where delete_historical_data=${_true}
</select>
- <select id="selectProjectIdsByRootId" resultType="long" parameterType="long">
- select id from projects where root_id=#{id} and scope='PRJ'
+ <select id="selectProjectIdUuidsByRootId" resultType="IdUuidPair" parameterType="long">
+ select id, uuid from projects where root_id=#{id} and scope='PRJ'
</select>
- <select id="selectResourceIdsByRootId" resultType="long" parameterType="long">
- select id from projects where root_id=#{id} or id=#{id}
+ <select id="selectComponentIdUuidsByRootId" resultType="IdUuidPair" parameterType="long">
+ select id, uuid from projects where root_id=#{id} or id=#{id}
</select>
<delete id="deleteSnapshotMeasures" parameterType="map">
<update id="resolveResourceIssuesNotAlreadyResolved" parameterType="map">
UPDATE issues SET status='CLOSED',resolution='REMOVED',updated_at=#{dateAsLong},issue_close_date=#{date},
issue_update_date=#{date}
- WHERE component_id=#{resourceId} AND resolution IS NULL
+ WHERE component_uuid=#{componentUuid} AND resolution IS NULL
</update>
<delete id="deleteResourceIndex" parameterType="map">
update snapshots set islast=${_false} where project_id=#{id}
</update>
- <delete id="deleteResourceIssueChanges" parameterType="map">
+ <delete id="deleteComponentIssueChanges" parameterType="map">
delete from issue_changes ic
- where exists (select * from issues i where i.kee=ic.issue_key and i.component_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
+ where exists (select * from issues i where i.kee=ic.issue_key and i.component_uuid in
+ <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
+ #{componentUuid}
</foreach>
)
</delete>
<!-- Mssql -->
- <delete id="deleteResourceIssueChanges" databaseId="mssql" parameterType="map">
+ <delete id="deleteComponentIssueChanges" databaseId="mssql" parameterType="map">
delete issue_changes from issue_changes
inner join issues on issue_changes.issue_key=issues.kee
- where issues.component_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
+ where issues.component_uuid in
+ <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
+ #{componentUuid}
</foreach>
</delete>
<!-- Mysql -->
- <delete id="deleteResourceIssueChanges" databaseId="mysql" parameterType="map">
- delete ic from issue_changes as ic, issues as i where ic.issue_key=i.kee and i.component_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
+ <delete id="deleteComponentIssueChanges" databaseId="mysql" parameterType="map">
+ delete ic from issue_changes as ic, issues as i where ic.issue_key=i.kee and i.component_uuid in
+ <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
+ #{componentUuid}
</foreach>
</delete>
- <delete id="deleteResourceIssues" parameterType="map">
- delete from issues where component_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
+ <delete id="deleteComponentIssues" parameterType="map">
+ delete from issues where component_uuid in
+ <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
+ #{componentUuid}
</foreach>
</delete>
delete from issue_changes ic
where exists (
select * from issues i
- where i.root_component_id=#{rootProjectId} and i.kee=ic.issue_key
+ where i.project_uuid=#{projectUuid} and i.kee=ic.issue_key
<choose>
<when test="toDate == null">
and i.issue_close_date is not null
<delete id="deleteOldClosedIssueChanges" databaseId="mssql" parameterType="map">
delete issue_changes from issue_changes
inner join issues on issue_changes.issue_key=issues.kee
- where issues.root_component_id=#{rootProjectId}
+ where issues.project_uuid=#{projectUuid}
<choose>
<when test="toDate == null">
and issues.issue_close_date is not null
<delete id="deleteOldClosedIssueChanges" databaseId="mysql" parameterType="map">
delete ic
from issue_changes as ic, issues as i
- where i.root_component_id=#{rootProjectId}
+ where i.project_uuid=#{projectUuid}
and ic.issue_key=i.kee
<choose>
<when test="toDate == null">
<delete id="deleteOldClosedIssues" parameterType="map">
delete from issues
- where root_component_id=#{rootProjectId}
+ where project_uuid=#{projectUuid}
<choose>
<when test="toDate == null">
and issue_close_date is not null
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Scopes;
-import org.sonar.core.purge.*;
import org.sonar.core.computation.dbcleaner.period.DefaultPeriodCleaner;
+import org.sonar.core.purge.*;
import org.sonar.core.resource.ResourceDao;
import org.sonar.core.resource.ResourceDto;
public void before() throws Exception {
this.purgeDao = mock(PurgeDao.class);
this.resourceDao = mock(ResourceDao.class);
- when(resourceDao.getResource(anyLong())).thenReturn(new ResourceDto().setQualifier(Qualifiers.PROJECT));
+ when(resourceDao.getResource(anyLong())).thenReturn(new ResourceDto().setQualifier(Qualifiers.PROJECT).setUuid("1").setId(1L));
this.settings = mock(Settings.class);
this.periodCleaner = mock(DefaultPeriodCleaner.class);
@Override
public boolean matches(Object o) {
PurgeConfiguration conf = (PurgeConfiguration) o;
- return conf.rootProjectId() == 1L && conf.scopesWithoutHistoricalData().length == 1 && conf.scopesWithoutHistoricalData()[0].equals(Scopes.FILE);
+ return conf.rootProjectIdUuid().getId() == 1L && conf.scopesWithoutHistoricalData().length == 1 && conf.scopesWithoutHistoricalData()[0].equals(Scopes.FILE);
}
}), any(PurgeListener.class));
}
@Override
public boolean matches(Object o) {
PurgeConfiguration conf = (PurgeConfiguration) o;
- return conf.rootProjectId() == 1L &&
+ return conf.rootProjectIdUuid().getId() == 1L &&
conf.scopesWithoutHistoricalData().length == 2 &&
conf.scopesWithoutHistoricalData()[0].equals(Scopes.DIRECTORY) &&
conf.scopesWithoutHistoricalData()[1].equals(Scopes.FILE);
@Test
public void shouldNotFailOnErrors() {
PurgeDao purgeDao = mock(PurgeDao.class);
- when(purgeDao.purge(any(PurgeConfiguration.class),any(PurgeListener.class))).thenThrow(new RuntimeException());
+ when(purgeDao.purge(any(PurgeConfiguration.class), any(PurgeListener.class))).thenThrow(new RuntimeException());
DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, resourceDao, new Settings(), mock(DefaultPeriodCleaner.class), mock(PurgeProfiler.class));
task.purge(1L);
@Test
public void shouldDumpProfiling() {
- PurgeConfiguration conf = new PurgeConfiguration(1L, new String[0], 30);
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30);
PurgeDao purgeDao = mock(PurgeDao.class);
when(purgeDao.purge(conf, PurgeListener.EMPTY)).thenThrow(new RuntimeException());
Settings settings = new Settings(new PropertyDefinitions(DataCleanerProperties.all()));
assertThat(issue.getRule()).isEqualTo("AvoidCycle");
assertThat(issue.getComponentUuid()).isEqualTo("CDEF");
assertThat(issue.getComponentKey()).isEqualTo("Action.java");
- assertThat(issue.getComponentId()).isEqualTo(401);
assertThat(issue.getModuleUuid()).isEqualTo("BCDE");
assertThat(issue.getModuleUuidPath()).isEqualTo(".ABCD.BCDE.");
assertThat(issue.getProjectKey()).isEqualTo("struts"); // ABCD
assertThat(issue.getProjectUuid()).isEqualTo("ABCD"); // null
- assertThat(issue.getProjectId()).isEqualTo(399);
}
@Test
.setLanguage("xoo")
.setComponentKey("org.sonar.sample:Sample")
.setComponentUuid("CDEF")
+ .setProjectUuid("GHIJ")
.setModuleUuid("BCDE")
.setModuleUuidPath("ABCD.BCDE.")
- .setProjectUuid("ABCD")
.setProjectKey("org.sonar.sample")
- .setComponentId(1l)
- .setProjectId(1l)
.setStatus(Issue.STATUS_CLOSED)
.setResolution(Issue.RESOLUTION_FALSE_POSITIVE)
.setEffortToFix(15.0)
assertThat(issue.ruleKey().toString()).isEqualTo("squid:AvoidCycle");
assertThat(issue.language()).isEqualTo("xoo");
assertThat(issue.componentUuid()).isEqualTo("CDEF");
+ assertThat(issue.projectUuid()).isEqualTo("GHIJ");
assertThat(issue.componentKey()).isEqualTo("org.sonar.sample:Sample");
- assertThat(issue.componentId()).isEqualTo(1L);
assertThat(issue.moduleUuid()).isEqualTo("BCDE");
assertThat(issue.moduleUuidPath()).isEqualTo("ABCD.BCDE.");
- assertThat(issue.projectUuid()).isEqualTo("ABCD");
assertThat(issue.projectKey()).isEqualTo("org.sonar.sample");
assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED);
assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FALSE_POSITIVE);
@Test
public void insert() throws Exception {
IssueDto dto = new IssueDto();
- dto.setComponentId(123l);
- dto.setComponentUuid("component-uuid");
- dto.setProjectId(100l);
- dto.setProjectUuid("project-uuid");
+ dto.setComponentUuid("uuid-123");
+ dto.setProjectUuid("uuid-100");
dto.setRuleId(200);
dto.setKee("ABCDE");
dto.setLine(500);
setupData("testUpdate");
IssueDto dto = new IssueDto();
- dto.setComponentId(123l);
- dto.setProjectId(101l);
- dto.setProjectUuid("project-uuid-2");
+ dto.setComponentUuid("uuid-123");
+ dto.setProjectUuid("uuid-101");
dto.setRuleId(200);
dto.setKee("ABCDE");
dto.setLine(500);
setupData("testUpdate");
IssueDto dto = new IssueDto();
- dto.setComponentId(123l);
- dto.setProjectId(101l);
- dto.setProjectUuid("project-uuid-2");
+ dto.setComponentUuid("uuid-123");
+ dto.setProjectUuid("uuid-101");
dto.setRuleId(200);
dto.setKee("ABCDE");
dto.setLine(500);
setupData("updateBeforeSelectedDate_with_conflict");
IssueDto dto = new IssueDto();
- dto.setComponentId(123l);
- dto.setProjectId(101l);
- dto.setProjectUuid("project-uuid-2");
+ dto.setComponentUuid("uuid-123");
+ dto.setProjectUuid("uuid-101");
dto.setRuleId(200);
dto.setKee("ABCDE");
dto.setLine(500);
.setUpdateDate(date)
.setCloseDate(date)
- .setComponentUuid("component-uuid")
- .setProjectUuid("project-uuid")
+ .setComponentUuid("uuid-100")
+ .setProjectUuid("uuid-10")
.setComponentKey("struts:Action");
saver.save(issue);
.setUpdateDate(date)
.setCloseDate(date)
- .setComponentUuid("component-uuid")
- .setProjectUuid("project-uuid")
+ .setComponentUuid("uuid-100")
+ .setProjectUuid("uuid-10")
.setComponentKey("struts:Action");
saver.save(session, issue);
@Test
public void server_insert_new_issues_with_session() throws Exception {
- ComponentDto project = new ComponentDto().setId(10L).setUuid("project-uuid");
- ComponentDto component = new ComponentDto().setId(100L).setUuid("component-uuid");
+ ComponentDto project = new ComponentDto().setId(10L).setUuid("uuid-10");
+ ComponentDto component = new ComponentDto().setId(100L).setUuid("uuid-100");
FakeServerSaver saver = new FakeServerSaver(getMyBatis(), new FakeRuleFinder(), component, project);
DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
.setCreationDate(date)
.setUpdateDate(date)
.setCloseDate(date)
+ .setComponentUuid("uuid-100")
+ .setProjectUuid("uuid-10")
// unmodifiable fields
.setRuleKey(RuleKey.of("xxx", "unknown"))
public void server_update_issues() throws Exception {
setupData("should_update_issues");
- ComponentDto project = new ComponentDto().setId(10L);
- ComponentDto component = new ComponentDto().setId(100L);
+ ComponentDto project = new ComponentDto().setId(10L).setUuid("whatever-uuid");
+ ComponentDto component = new ComponentDto().setId(100L).setUuid("whatever-uuid-2");
FakeServerSaver saver = new FakeServerSaver(getMyBatis(), new FakeRuleFinder(), component, project);
DefaultIssueComment comment = DefaultIssueComment.create("ABCDE", "emmerik", "the comment");
.setCreationDate(date)
.setUpdateDate(date)
.setCloseDate(date)
+ .setProjectUuid("uuid-10")
// unmodifiable fields
.setRuleKey(RuleKey.of("xxx", "unknown"))
@Override
protected void doInsert(DbSession session, long now, DefaultIssue issue) {
int ruleId = rule(issue).getId();
- IssueDto dto = IssueDto.toDtoForComputationInsert(issue, 100l, 10l, ruleId, now);
+ IssueDto dto = IssueDto.toDtoForComputationInsert(issue, ruleId, now);
session.getMapper(IssueMapper.class).insert(dto);
}
@Override
protected void doUpdate(DbSession session, long now, DefaultIssue issue) {
- IssueDto dto = IssueDto.toDtoForUpdate(issue, 10l, now);
+ IssueDto dto = IssueDto.toDtoForUpdate(issue, now);
session.getMapper(IssueMapper.class).update(dto);
}
}
@Override
protected void doUpdate(DbSession session, long now, DefaultIssue issue) {
- IssueDto dto = IssueDto.toDtoForUpdate(issue, 10l, now);
+ IssueDto dto = IssueDto.toDtoForUpdate(issue, now);
session.getMapper(IssueMapper.class).update(dto);
}
}
.setKee("ABCDE")
.setRuleId(10)
.setRuleKey("squid", "AvoidCycles")
- .setComponentId(100L)
.setComponentKey("struts:org.apache.struts.Action")
.setLine(10)
.setStatus(Issue.STATUS_OPEN)
.setKee("ABCDE")
.setRuleId(10)
.setRuleKey("squid", "AvoidCycles")
- .setComponentId(100L)
+ .setComponentUuid("100")
.setComponentKey("struts:org.apache.struts.Action")
.setLine(10)
.setResolution(Issue.RESOLUTION_FALSE_POSITIVE)
import org.sonar.core.persistence.AbstractDaoTestCase;
import org.sonar.core.persistence.MyBatis;
-import java.util.Arrays;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
setupData("shouldDeleteResource");
SqlSession session = getMyBatis().openSession();
try {
- new PurgeCommands(session, profiler).deleteResources(Arrays.asList(1L));
+ new PurgeCommands(session, profiler).deleteResources(newArrayList(new IdUuidPair(1L, "1")));
} finally {
MyBatis.closeQuietly(session);
}
public void should_not_fail_when_deleting_huge_number_of_resources() {
SqlSession session = getMyBatis().openSession();
try {
- new PurgeCommands(session, profiler).deleteResources(getHugeNumberOfIds());
+ new PurgeCommands(session, profiler).deleteResources(getHugeNumberOfIdUuids());
} finally {
MyBatis.closeQuietly(session);
}
// The goal of this test is only to check that the query do no fail, not to check result
}
+ private List<IdUuidPair> getHugeNumberOfIdUuids() {
+ List<IdUuidPair> hugeNbOfSnapshotIds = newArrayList();
+ for (long i = 0; i < 4500; i++) {
+ hugeNbOfSnapshotIds.add(new IdUuidPair(i, String.valueOf(i)));
+ }
+ return hugeNbOfSnapshotIds;
+ }
+
private List<Long> getHugeNumberOfIds() {
List<Long> hugeNbOfSnapshotIds = newArrayList();
for (long i = 0; i < 4500; i++) {
public class PurgeConfigurationTest {
@Test
public void should_delete_all_closed_issues() throws Exception {
- PurgeConfiguration conf = new PurgeConfiguration(1L, new String[0], 0);
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 0);
assertThat(conf.maxLiveDateOfClosedIssues()).isNull();
- conf = new PurgeConfiguration(1L, new String[0], -1);
+ conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], -1);
assertThat(conf.maxLiveDateOfClosedIssues()).isNull();
}
public void should_delete_only_old_closed_issues() throws Exception {
Date now = DateUtils.parseDate("2013-05-18");
- PurgeConfiguration conf = new PurgeConfiguration(1L, new String[0], 30);
+ PurgeConfiguration conf = new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30);
Date toDate = conf.maxLiveDateOfClosedIssues(now);
assertThat(toDate.getYear()).isEqualTo(113);//=2013
sut = new PurgeDao(getMyBatis(), new ResourceDao(getMyBatis(), system2), new PurgeProfiler(), system2);
}
+
@After
public void after() {
MyBatis.closeQuietly(dbSession);
@Test
public void shouldDeleteAbortedBuilds() {
setupData("shouldDeleteAbortedBuilds");
- sut.purge(new PurgeConfiguration(1L, new String[0], 30), PurgeListener.EMPTY);
+ sut.purge(newConfigurationWith30Days(), PurgeListener.EMPTY);
checkTables("shouldDeleteAbortedBuilds", "snapshots");
}
@Test
public void should_purge_project() {
setupData("shouldPurgeProject");
- sut.purge(new PurgeConfiguration(1L, new String[0], 30), PurgeListener.EMPTY);
+ sut.purge(newConfigurationWith30Days(), PurgeListener.EMPTY);
checkTables("shouldPurgeProject", "projects", "snapshots");
}
+ private PurgeConfiguration newConfigurationWith30Days() {
+ return new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30);
+ }
+
+ private PurgeConfiguration newConfigurationWith30Days(System2 system2) {
+ return new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 30, system2);
+ }
+
+
@Test
public void delete_file_sources_of_disabled_resources() {
setupData("delete_file_sources_of_disabled_resources");
- sut.purge(new PurgeConfiguration(1L, new String[0], 30, system2), PurgeListener.EMPTY);
+ sut.purge(newConfigurationWith30Days(system2), PurgeListener.EMPTY);
checkTables("delete_file_sources_of_disabled_resources", "file_sources");
}
@Test
public void shouldDeleteHistoricalDataOfDirectoriesAndFiles() {
setupData("shouldDeleteHistoricalDataOfDirectoriesAndFiles");
- sut.purge(new PurgeConfiguration(1L, new String[] {Scopes.DIRECTORY, Scopes.FILE}, 30), PurgeListener.EMPTY);
+ sut.purge(new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[]{Scopes.DIRECTORY, Scopes.FILE}, 30), PurgeListener.EMPTY);
checkTables("shouldDeleteHistoricalDataOfDirectoriesAndFiles", "projects", "snapshots");
}
@Test
public void disable_resources_without_last_snapshot() {
setupData("disable_resources_without_last_snapshot");
- sut.purge(new PurgeConfiguration(1L, new String[0], 30, system2), PurgeListener.EMPTY);
+ sut.purge(newConfigurationWith30Days(system2), PurgeListener.EMPTY);
checkTables("disable_resources_without_last_snapshot", new String[]{"issue_close_date", "issue_update_date"}, "projects", "snapshots", "issues");
}
@Test
public void should_delete_old_closed_issues() {
setupData("should_delete_old_closed_issues");
- sut.purge(new PurgeConfiguration(1L, new String[0], 30), PurgeListener.EMPTY);
+ sut.purge(newConfigurationWith30Days(), PurgeListener.EMPTY);
checkTables("should_delete_old_closed_issues", "issues", "issue_changes");
}
@Test
public void should_delete_all_closed_issues() {
setupData("should_delete_all_closed_issues");
- sut.purge(new PurgeConfiguration(1L, new String[0], 0), PurgeListener.EMPTY);
+ sut.purge(new PurgeConfiguration(new IdUuidPair(1L, "1"), new String[0], 0), PurgeListener.EMPTY);
checkTables("should_delete_all_closed_issues", "issues", "issue_changes");
}
<dataset>
<action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]" />
+ user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
<issues
id="100"
kee="ABCDE"
- component_id="400"
+ component_uuid="uuid-400"
+ project_uuid="uuid-400"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="ABCDF"
- component_id="400"
+ component_uuid="uuid-400"
+ project_uuid="uuid-400"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="102"
kee="ABCDG"
- component_id="400"
+ component_uuid="uuid-400"
+ project_uuid="uuid-400"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<dataset>
- <projects id="399" uuid="1" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" />
- <projects id="400" uuid="2" kee="struts-core" root_id="399" qualifier="BRC" scope="PRJ" />
- <projects id="401" uuid="3" kee="Action.java" root_id="400" qualifier="CLA" scope="PRJ" />
- <projects id="402" uuid="4" kee="Filter.java" root_id="400" qualifier="CLA" scope="PRJ" />
+ <projects id="399" uuid="uuid-399" kee="struts" root_id="[null]" project_uuid="[null]" qualifier="TRK" scope="PRJ" />
+ <projects id="400" uuid="uuid-400" kee="struts-core" root_id="399" project_uuid="uuid-399" qualifier="BRC" scope="PRJ" />
+ <projects id="401" uuid="uuid-401" kee="Action.java" root_id="400" project_uuid="uuid-400" qualifier="CLA" scope="PRJ" />
+ <projects id="402" uuid="uuid-402" kee="Filter.java" root_id="400" project_uuid="uuid-400" qualifier="CLA" scope="PRJ" />
<!-- Open Issue on a file -->
<issues
id="100"
kee="100"
- component_id="401"
- root_component_id="399"
+ component_uuid="uuid-401"
+ project_uuid="uuid-399"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="402"
- root_component_id="399"
+ component_uuid="uuid-402"
+ project_uuid="uuid-399"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="102"
- component_id="402"
- root_component_id="399"
+ component_uuid="uuid-402"
+ project_uuid="uuid-399"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="103"
kee="103"
- component_id="400"
- root_component_id="399"
+ component_uuid="uuid-400"
+ project_uuid="uuid-399"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="104"
kee="104"
- component_id="399"
- root_component_id="399"
+ component_uuid="uuid-399"
+ project_uuid="uuid-399"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<dataset>
- <projects id="399" uuid="1" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" />
+ <projects id="399" uuid="uuid-399" kee="struts" root_id="[null]" project_uuid="[null]" qualifier="TRK" scope="PRJ" />
<!-- Open Issue on a root module -->
<issues
id="104"
kee="104"
- component_id="399"
- root_component_id="399"
+ component_uuid="uuid-399"
+ project_uuid="uuid-399"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE-1"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="ABCDE-2"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="102"
kee="ABCDE-3"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="501"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE-1"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="ABCDE-2"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="ABCDE-3"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="501"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE-1"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="ABCDE-2"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="102"
kee="ABCDE-3"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="501"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="100"
- component_id="401"
- root_component_id="399"
+ component_uuid="CDEF"
+ project_uuid="ABCD"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="102"
- component_id="402"
- root_component_id="399"
+ component_uuid="DEFG"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="103"
kee="103"
- component_id="400"
- root_component_id="399"
+ component_uuid="BCDE"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="104"
kee="104"
- component_id="399"
- root_component_id="399"
+ component_uuid="ABCD"
+ project_uuid="ABCD"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="100"
kee="100"
- component_id="401"
- root_component_id="111"
+ component_uuid="CDEF"
+ project_uuid="uuid-111"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="402"
- root_component_id="111"
+ component_uuid="DEFG"
+ project_uuid="uuid-111"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="102"
kee="102"
- component_id="402"
- root_component_id="111"
+ component_uuid="DEFG"
+ project_uuid="uuid-111"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="103"
kee="103"
- component_id="400"
- root_component_id="111"
+ component_uuid="BCDE"
+ project_uuid="uuid-111"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="100"
+ component_uuid="uuid-123"
+ project_uuid="uuid-100"
rule_id="200"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
- component_uuid="component-uuid"
- project_uuid="project-uuid-2"
- root_component_id="101"
+ component_uuid="uuid-123"
+ project_uuid="uuid-101"
rule_id="200"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="100"
+ component_uuid="uuid-123"
+ project_uuid="uuid-100"
rule_id="200"
severity="INFO"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="100"
+ component_uuid="uuid-123"
+ project_uuid="uuid-100"
rule_id="200"
severity="INFO"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE"
- component_id="123"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="100"
+ component_uuid="uuid-123"
+ project_uuid="uuid-100"
rule_id="200"
severity="INFO"
manual_severity="[false]"
<issues
id="100"
kee="ABCDE-1"
- component_id="401"
- root_component_id="399"
+ component_uuid="uuid-401"
+ project_uuid="uuid-399"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="ABCDE-2"
- component_id="401"
- root_component_id="399"
+ component_uuid="uuid-401"
+ project_uuid="uuid-399"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="102"
kee="ABCDE-3"
- component_id="401"
- root_component_id="399"
+ component_uuid="uuid-401"
+ project_uuid="uuid-399"
rule_id="501"
severity="BLOCKER"
manual_severity="[false]"
technical_debt="10"
message="[null]"
line="5000"
- component_id="100"
- root_component_id="10"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
+ component_uuid="uuid-100"
+ project_uuid="uuid-10"
rule_id="200"
created_at="[null]"
updated_at="[null]"
technical_debt="[null]"
message="[null]"
line="444"
- component_id="100"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="10"
+ component_uuid="uuid-100"
+ project_uuid="uuid-10"
rule_id="200"
reporter="[null]"
issue_attributes="JIRA=http://jira.com"
technical_debt="[null]"
message="[null]"
line="1"
- component_id="100"
- component_uuid="component-uuid"
- project_uuid="project-uuid"
- root_component_id="10"
+ component_uuid="uuid-100"
+ project_uuid="uuid-10"
rule_id="200"
reporter="[null]"
issue_attributes=""
technical_debt="10"
message="[null]"
line="5000"
- component_id="100"
- component_uuid="component-uuid"
- project_uuid="[null]"
- root_component_id="10"
+ component_uuid="uuid-100"
+ project_uuid="uuid-10"
rule_id="200"
created_at="2013-05-18"
updated_at="2013-05-18"
technical_debt="[null]"
message="[null]"
line="3000"
- component_id="100"
- component_uuid="component-uuid"
- project_uuid="[null]"
- root_component_id="10"
+ component_uuid="uuid-100"
+ project_uuid="uuid-11"
rule_id="200"
created_at="1400000000000"
updated_at="1400000000000"
-->
<dataset>
<metrics id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
- enabled="[true]" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="[false]" delete_historical_data="[null]"/>
+ enabled="[true]" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0"
+ hidden="[false]" delete_historical_data="[null]"/>
<metrics id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
- enabled="[true]" worst_value="0" optimized_best_value="[true]" best_value="100" direction="1" hidden="[false]" delete_historical_data="[null]"/>
+ enabled="[true]" worst_value="0" optimized_best_value="[true]" best_value="100" direction="1"
+ hidden="[false]" delete_historical_data="[null]"/>
<rules_profiles id="1" name="Sonar way with Findbugs" language="java" parent_kee="" kee="sonar_way_with_findbugs"/>
- <projects id="300" uuid="A" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ" />
- <projects id="301" uuid="B" kee="struts-core" root_id="300" qualifier="BRC" scope="PRJ" />
- <projects id="302" uuid="C" kee="struts-el" root_id="300" qualifier="BRC" scope="PRJ" />
- <projects id="303" uuid="D" kee="Action.java" root_id="301" qualifier="CLA" scope="FIL" />
+ <projects id="300" uuid="A" kee="struts" root_id="[null]" qualifier="TRK" scope="PRJ"/>
+ <projects id="301" uuid="B" kee="struts-core" root_id="300" qualifier="BRC" scope="PRJ"/>
+ <projects id="302" uuid="C" kee="struts-el" root_id="300" qualifier="BRC" scope="PRJ"/>
+ <projects id="303" uuid="D" kee="Action.java" root_id="301" qualifier="CLA" scope="FIL"/>
<snapshots id="3000" project_id="300" root_project_id="300" root_snapshot_id="[null]" path="" islast="[true]"/>
<snapshots id="3001" project_id="301" root_project_id="300" root_snapshot_id="3000" path="3000." islast="[true]"/>
<snapshots id="3002" project_id="302" root_project_id="300" root_snapshot_id="3000" path="3000." islast="[true]"/>
- <snapshots id="3003" project_id="303" root_project_id="300" root_snapshot_id="3000" path="3000.3001." islast="[true]"/>
+ <snapshots id="3003" project_id="303" root_project_id="300" root_snapshot_id="3000" path="3000.3001."
+ islast="[true]"/>
<snapshots id="3010" project_id="300" root_project_id="300" root_snapshot_id="[null]" path="" islast="[false]"/>
<snapshots id="3011" project_id="301" root_project_id="300" root_snapshot_id="3010" path="3010." islast="[false]"/>
<snapshots id="3012" project_id="302" root_project_id="300" root_snapshot_id="3010" path="3010." islast="[false]"/>
- <snapshots id="3013" project_id="303" root_project_id="300" root_snapshot_id="3010" path="3010.3011." islast="[false]"/>
+ <snapshots id="3013" project_id="303" root_project_id="300" root_snapshot_id="3010" path="3010.3011."
+ islast="[false]"/>
- <project_measures id="1" value="12" metric_id="1" snapshot_id="3000" />
- <project_measures id="2" value="5" metric_id="1" snapshot_id="3001" />
- <project_measures id="3" value="7" metric_id="1" snapshot_id="3002" />
- <project_measures id="4" value="5" metric_id="1" snapshot_id="3003" />
+ <project_measures id="1" value="12" metric_id="1" snapshot_id="3000"/>
+ <project_measures id="2" value="5" metric_id="1" snapshot_id="3001"/>
+ <project_measures id="3" value="7" metric_id="1" snapshot_id="3002"/>
+ <project_measures id="4" value="5" metric_id="1" snapshot_id="3003"/>
- <project_measures id="5" value="35" metric_id="2" snapshot_id="3000" />
- <project_measures id="6" value="20" metric_id="2" snapshot_id="3001" />
- <project_measures id="7" value="30" metric_id="2" snapshot_id="3002" />
- <project_measures id="8" value="20" metric_id="2" snapshot_id="3003" />
+ <project_measures id="5" value="35" metric_id="2" snapshot_id="3000"/>
+ <project_measures id="6" value="20" metric_id="2" snapshot_id="3001"/>
+ <project_measures id="7" value="30" metric_id="2" snapshot_id="3002"/>
+ <project_measures id="8" value="20" metric_id="2" snapshot_id="3003"/>
- <project_measures id="11" value="112" metric_id="1" snapshot_id="3010" />
- <project_measures id="12" value="15" metric_id="1" snapshot_id="3011" />
- <project_measures id="13" value="17" metric_id="1" snapshot_id="3012" />
- <project_measures id="14" value="15" metric_id="1" snapshot_id="3013" />
+ <project_measures id="11" value="112" metric_id="1" snapshot_id="3010"/>
+ <project_measures id="12" value="15" metric_id="1" snapshot_id="3011"/>
+ <project_measures id="13" value="17" metric_id="1" snapshot_id="3012"/>
+ <project_measures id="14" value="15" metric_id="1" snapshot_id="3013"/>
- <project_measures id="15" value="135" metric_id="2" snapshot_id="3010" />
- <project_measures id="16" value="120" metric_id="2" snapshot_id="3011" />
- <project_measures id="17" value="130" metric_id="2" snapshot_id="3012" />
- <project_measures id="18" value="120" metric_id="2" snapshot_id="3013" />
+ <project_measures id="15" value="135" metric_id="2" snapshot_id="3010"/>
+ <project_measures id="16" value="120" metric_id="2" snapshot_id="3011"/>
+ <project_measures id="17" value="130" metric_id="2" snapshot_id="3012"/>
+ <project_measures id="18" value="120" metric_id="2" snapshot_id="3013"/>
<rules tags="[null]" system_tags="[null]" id="500" plugin_rule_key="AvoidCycle" plugin_name="squid"/>
<issues
id="100"
kee="ISSUE-100"
- component_id="303"
- root_component_id="300"
+ component_uuid="D"
+ project_uuid="A"
rule_id="500"
severity="BLOCKER"
<issues
id="101"
kee="ISSUE-101"
- component_id="303"
- root_component_id="300"
+ component_uuid="D"
+ project_uuid="A"
rule_id="501"
severity="MAJOR"
<dataset>
<metrics id="1" name="ncloc" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
- enabled="[true]" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="[false]" delete_historical_data="[null]"/>
+ enabled="[true]" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0"
+ hidden="[false]" delete_historical_data="[null]"/>
<metrics id="2" name="coverage" VAL_TYPE="INT" DESCRIPTION="[null]" domain="[null]" short_name=""
- enabled="[true]" worst_value="0" optimized_best_value="[true]" best_value="100" direction="1" hidden="[false]" delete_historical_data="[null]"/>
+ enabled="[true]" worst_value="0" optimized_best_value="[true]" best_value="100" direction="1"
+ hidden="[false]" delete_historical_data="[null]"/>
<rules_profiles id="1" name="Sonar way with Findbugs" language="java" parent_kee="" kee="sonar_way_with_findbugs"/>
<issues
id="100"
kee="100"
- component_id="400"
+ component_uuid="B"
+ project_uuid="A"
rule_id="500"
severity="BLOCKER"
manual_severity="[false]"
<issues
id="101"
kee="101"
- component_id="401"
+ component_uuid="C"
+ project_uuid="A"
rule_id="501"
severity="MAJOR"
manual_severity="[false]"
<dataset>
- <projects id="1" enabled="[true]" root_id="[null]"
+ <projects id="1" uuid="1" enabled="[true]" root_id="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" />
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"/>
<snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]"
status="P" islast="[false]" purge_status="[null]"
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
- <issues id="1" kee="ABCDE" component_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
+ <issues id="1" kee="ABCDE" component_uuid="1" project_uuid="1" status="CLOSED" resolution="[null]" line="200"
+ severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
updated_at="[null]"
/>
- <issue_changes id="1" kee="ABDA" issue_key="ABCDE" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="this is a comment"/>
+ <issue_changes id="1" kee="ABDA" issue_key="ABCDE" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="this is a comment"/>
- <authors id="1" person_id="1" login="tartanpion" created_at="[null]" updated_at="[null]" />
- <authors id="2" person_id="1" login="fanfoue" created_at="[null]" updated_at="[null]" />
+ <authors id="1" person_id="1" login="tartanpion" created_at="[null]" updated_at="[null]"/>
+ <authors id="2" person_id="1" login="fanfoue" created_at="[null]" updated_at="[null]"/>
</dataset>
<dataset>
<!-- the project -->
- <projects id="1" enabled="[false]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." created_at="[null]"
+ <projects id="1" enabled="[false]" root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]"
+ module_uuid_path="." created_at="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/>
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ deprecated_kee="[null]" authorization_updated_at="[null]"/>
<!-- the directory -->
- <projects id="2" enabled="[false]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="." created_at="[null]"
+ <projects id="2" enabled="[false]" root_id="1" uuid="EFGH" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path="."
+ created_at="[null]"
long_name="[null]" scope="DIR" qualifier="DIR" kee="project:my/dir" name="my/dir"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]"/>
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ deprecated_kee="[null]" authorization_updated_at="[null]"/>
<!-- the file -->
- <projects id="3" enabled="[false]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." created_at="[null]"
+ <projects id="3" enabled="[false]" root_id="1" uuid="GHIJ" project_uuid="ABCD" module_uuid="ABCD"
+ module_uuid_path=".ABCD." created_at="[null]"
long_name="[null]" scope="FIL" qualifier="FIL" kee="project:my/dir/File.java" name="my/dir/File.java"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]" deprecated_kee="[null]" authorization_updated_at="[null]" />
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ deprecated_kee="[null]" authorization_updated_at="[null]"/>
<snapshots id="1"
project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<snapshots id="2"
project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<snapshots id="3"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<!-- Open issue on file -->
<issues id="1" kee="ISSUE-1"
- component_id="3"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="GHIJ"
+ project_uuid="ABCD"
status="CLOSED"
issue_close_date="2014-04-09"
- resolution="REMOVED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
+ resolution="REMOVED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09"
+ created_at="1450000000000" tags="[null]"/>
<!-- Open issue on directory -->
<issues id="2" kee="ISSUE-2"
- component_id="2"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="EFGH"
+ project_uuid="ABCD"
status="CLOSED"
issue_close_date="2014-04-09"
- resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
+ resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09"
+ created_at="1450000000000" tags="[null]"/>
<!-- Open issue on project -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="ABCD"
+ project_uuid="ABCD"
status="CLOSED"
issue_close_date="2014-04-09"
- resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
+ resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09"
+ created_at="1450000000000" tags="[null]"/>
<!-- Resolved issue on file -> not to be updated -->
<issues id="4" kee="ISSUE-4"
- component_id="3"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="GHIJ"
+ project_uuid="ABCD"
status="CLOSED"
issue_close_date="2015-12-08"
- resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08" created_at="1450000000000" tags="[null]"/>
+ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08"
+ created_at="1450000000000" tags="[null]"/>
</dataset>
<!-- Open issue on file -->
<issues id="1" kee="ISSUE-1"
- component_id="3"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="GHIJ"
+ project_uuid="ABCD"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<!-- Open issue on directory -->
<issues id="2" kee="ISSUE-2"
- component_id="2"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="EFGH"
+ project_uuid="ABCD"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<!-- Open issue on project -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="ABCD"
+ project_uuid="ABCD"
status="CONFIRM"
issue_close_date="[null]"
resolution="[null]" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<!-- Resolved issue on file -> not to be updated -->
<issues id="4" kee="ISSUE-4"
- component_id="3"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="GHIJ"
+ project_uuid="ABCD"
status="CLOSED"
issue_close_date="2015-12-08"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<action_plans id="1" kee="ABCD" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
- <issues id="1" kee="ABCDE" component_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
+ <issues id="1" kee="ABCDE" component_uuid="A" project_uuid="A" status="CLOSED" resolution="[null]" line="200"
+ severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
issue_close_date="2013-04-16"
/>
- <issues id="2" kee="ABCDF" component_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
+ <issues id="2" kee="ABCDF" component_uuid="A" project_uuid="A" status="CLOSED" resolution="[null]" line="200"
+ severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
manual_severity="[false]"
message="[null]"
-->
<dataset>
- <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]"
+ <projects id="1" uuid="1" enabled="[true]" root_id="[null]" created_at="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/>
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"
+ authorization_updated_at="[null]"/>
<snapshots id="1"
project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<!-- old closed issues on file and project -->
<!--
<issues id="1" kee="ISSUE-1"
- component_id="100"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="2" kee="ISSUE-2"
- component_id="1"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<!-- old open issues -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
- resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]" tags="[null]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<!-- recent open and closed issues -->
<issues id="4" kee="ISSUE-4"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
- resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]" tags="[null]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<!--
<issues id="5" kee="ISSUE-5"
- component_id="100"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2025-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<dataset>
- <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]"
+ <projects id="1" uuid="1" enabled="[true]" root_id="[null]" created_at="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"
authorization_updated_at="[null]"/>
<!-- old closed issues on file and project -->
<issues id="1" kee="ISSUE-1"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="2" kee="ISSUE-2"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
<!-- old open issues -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
<!-- recent open and closed issues -->
<issues id="4" kee="ISSUE-4"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="5" kee="ISSUE-5"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2025-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
<dataset>
- <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]"
+ <projects id="1" uuid="1" enabled="[true]" root_id="[null]" created_at="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/>
<!-- old closed issues on file and project -> to be purged -->
<!--
<issues id="1" kee="ISSUE-1"
- component_id="100"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="2" kee="ISSUE-2"
- component_id="1"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
<!-- old open issues -> do not purge -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
<!-- recent open and closed issues -> do not purge -->
<issues id="4" kee="ISSUE-4"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
<issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="5" kee="ISSUE-5"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2025-01-01"
resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
<dataset>
- <projects id="1" enabled="[true]" root_id="[null]" created_at="[null]"
+ <projects id="1" uuid="1" enabled="[true]" root_id="[null]" created_at="[null]"
long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
- description="[null]" language="java" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]"/>
+ description="[null]" language="java" copy_resource_id="[null]" person_id="[null]"
+ authorization_updated_at="[null]"/>
<snapshots id="1"
project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
period3_mode="[null]" period3_param="[null]" period3_date="[null]"
period4_mode="[null]" period4_param="[null]" period4_date="[null]"
period5_mode="[null]" period5_param="[null]" period5_date="[null]"
- depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
+ depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00"
+ build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<!-- old closed issues on file and project -> to be purged -->
<issues id="1" kee="ISSUE-1"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
- resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="1" kee="[null]" issue_key="ISSUE-1" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="2" kee="ISSUE-2"
- component_id="1"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2010-01-01"
- resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="2" kee="[null]" issue_key="ISSUE-2" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<!-- old open issues -> do not purge -->
<issues id="3" kee="ISSUE-3"
- component_id="1"
- root_component_id="1"
+ component_uuid="1"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
- resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<!-- recent open and closed issues -> do not purge -->
<issues id="4" kee="ISSUE-4"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="OPEN"
issue_close_date="[null]"
- resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
<issues id="5" kee="ISSUE-5"
- component_id="100"
- component_uuid="[null]"
- project_uuid="[null]"
- root_component_id="1"
+ component_uuid="100"
+ project_uuid="1"
status="CLOSED"
issue_close_date="2025-01-01"
- resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
- message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
- updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
- <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
+ resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500"
+ manual_severity="[false]"
+ message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]"
+ issue_attributes="[null]" checksum="[null]" author_login="[null]"
+ updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16"
+ created_at="1400000000000"/>
+ <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin"
+ change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
</dataset>
private String componentUuid;
private String componentKey;
- private Long componentId;
private String moduleUuid;
private String moduleUuidPath;
return this;
}
- /**
- * The component id not populated on batch side
- */
- @CheckForNull
- public Long componentId() {
- return componentId;
- }
-
- public DefaultIssue setComponentId(@Nullable Long s) {
- this.componentId = s;
- return this;
- }
-
@CheckForNull
public String moduleUuid() {
return moduleUuid;
public void test_setters_and_getters() throws Exception {
issue.setKey("ABCD")
.setComponentKey("org.sample.Sample")
- .setComponentId(1L)
.setProjectKey("Sample")
.setRuleKey(RuleKey.of("squid", "S100"))
.setLanguage("xoo")
assertThat(issue.key()).isEqualTo("ABCD");
assertThat(issue.componentKey()).isEqualTo("org.sample.Sample");
- assertThat(issue.componentId()).isEqualTo(1L);
assertThat(issue.projectKey()).isEqualTo("Sample");
assertThat(issue.ruleKey()).isEqualTo(RuleKey.of("squid", "S100"));
assertThat(issue.language()).isEqualTo("xoo");