From 9dc5ec05a0301fb2b46b621c5de3eb5ef4752119 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 29 Jun 2016 07:22:53 +0200 Subject: [PATCH] Revert "SONAR-7780 table PROJECT_MEASURES should use analysis UUID" This reverts commit 87f2df380bc31b616fa9a1b6376b0ff26ee84ccc. --- .../measure/MeasureToMeasureDto.java | 6 +- .../measure/MeasureRepositoryImplTest.java | 2 - .../measure/MeasureToMeasureDtoTest.java | 11 +- .../step/PersistMeasuresStepTest.java | 8 +- ...eportComputeMeasureVariationsStepTest.java | 25 ++-- ...ViewsComputeMeasureVariationsStepTest.java | 22 ++-- .../shared.xml | 4 - ...ersist_duplication_on_same_file-result.xml | 26 +--- .../persist_duplication_on_same_file.xml | 15 +-- .../insert-from-index-result.xml | 20 +-- .../insert-from-report-result.xml | 20 +-- .../ignore_person_measures.xml | 3 - .../ignore_quality_model_measures.xml | 1 - .../MeasureFilterExecutorTest/shared.xml | 8 -- .../sort_by_alert.xml | 3 - ...58_add_analysis_uuid_column_to_measures.rb | 29 ----- ...1259_populate_analysis_uuid_on_measures.rb | 29 ----- ..._clean_measures_with_null_analysis_uuid.rb | 29 ----- ...make_analysis_uuid_not_null_on_measures.rb | 29 ----- .../java/org/sonar/db/measure/MeasureDto.java | 11 -- .../org/sonar/db/version/DatabaseVersion.java | 2 +- .../sonar/db/version/MigrationStepModule.java | 13 +- .../v60/AddAnalysisUuidColumnToMeasures.java | 45 ------- .../CleanMeasuresWithNullAnalysisUuid.java | 45 ------- .../MakeAnalysisUuidNotNullOnMeasures.java | 45 ------- .../v60/PopulateAnalysisUuidOnMeasures.java | 58 --------- .../org/sonar/db/measure/MeasureMapper.xml | 36 +----- .../org/sonar/db/version/rows-h2.sql | 4 - .../org/sonar/db/version/schema-h2.ddl | 1 - .../org/sonar/db/measure/MeasureDaoTest.java | 4 - .../org/sonar/db/measure/MeasureTesting.java | 3 +- .../db/version/MigrationStepModuleTest.java | 2 +- .../AddAnalysisUuidColumnToMeasuresTest.java | 81 ------------ ...CleanMeasuresWithNullAnalysisUuidTest.java | 90 ------------- ...MakeAnalysisUuidNotNullOnMeasuresTest.java | 89 ------------- .../PopulateAnalysisUuidOnMeasuresTest.java | 107 --------------- .../measure/MeasureDaoTest/insert-result.xml | 1 - .../measure/MeasureDaoTest/past_measures.xml | 6 - .../past_measures_with_person_id.xml | 3 - .../select_by_snapshot_and_metric_keys.xml | 3 - .../db/measure/MeasureDaoTest/shared.xml | 3 - .../with_some_measures_for_developer.xml | 6 - .../shouldDeleteSnapshot-result.xml | 1 - .../shouldDeleteSnapshot.xml | 2 - ...stedMeasuresWhenPurgingSnapshot-result.xml | 87 +++---------- ...eleteWastedMeasuresWhenPurgingSnapshot.xml | 122 +++++------------- .../shouldPurgeSnapshot-result.xml | 2 - .../PurgeCommandsTest/shouldPurgeSnapshot.xml | 2 - .../old_measures.sql | 18 --- .../in_progress_measures.sql | 20 --- .../in_progress_measures.sql | 20 --- .../old_measures.sql | 54 -------- 52 files changed, 101 insertions(+), 1175 deletions(-) delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb delete mode 100644 sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java delete mode 100644 sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java delete mode 100644 sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java delete mode 100644 sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java delete mode 100644 sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java delete mode 100644 sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java delete mode 100644 sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java delete mode 100644 sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java delete mode 100644 sonar-db/src/test/resources/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest/old_measures.sql delete mode 100644 sonar-db/src/test/resources/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest/in_progress_measures.sql delete mode 100644 sonar-db/src/test/resources/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest/in_progress_measures.sql delete mode 100644 sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest/old_measures.sql diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java index 718b3e02c87..bcee6b62bca 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.measure; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import org.sonar.db.measure.MeasureDto; -import org.sonar.server.computation.analysis.AnalysisMetadataHolder; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.DbIdsRepository; import org.sonar.server.computation.component.Developer; @@ -31,11 +30,9 @@ import org.sonar.server.computation.metric.Metric; public class MeasureToMeasureDto { private final DbIdsRepository dbIdsRepository; - private final AnalysisMetadataHolder analysisMetadataHolder; - public MeasureToMeasureDto(DbIdsRepository dbIdsRepository, AnalysisMetadataHolder analysisMetadataHolder) { + public MeasureToMeasureDto(DbIdsRepository dbIdsRepository) { this.dbIdsRepository = dbIdsRepository; - this.analysisMetadataHolder = analysisMetadataHolder; } @Nonnull @@ -43,7 +40,6 @@ public class MeasureToMeasureDto { MeasureDto out = new MeasureDto(); out.setMetricId(metric.getId()); out.setComponentUuid(component.getUuid()); - out.setAnalysisUuid(analysisMetadataHolder.getUuid()); out.setSnapshotId(dbIdsRepository.getSnapshotId(component)); if (measure.hasVariations()) { setVariations(out, measure.getVariations()); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java index 59e55e15855..42530009c89 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java @@ -71,7 +71,6 @@ public class MeasureRepositoryImplTest { @Rule public BatchReportReaderRule reportReader = new BatchReportReaderRule(); - private static final String AN_ANALYSIS_UUID = "a1"; private static final String FILE_COMPONENT_KEY = "file cpt key"; private static final ReportComponent FILE_COMPONENT = ReportComponent.builder(Component.Type.FILE, 1).setKey(FILE_COMPONENT_KEY).build(); private static final ReportComponent OTHER_COMPONENT = ReportComponent.builder(Component.Type.FILE, 2).setKey("some other key").build(); @@ -421,7 +420,6 @@ public class MeasureRepositoryImplTest { return new MeasureDto() .setComponentUuid(componentUuid) .setSnapshotId(snapshotId) - .setAnalysisUuid(AN_ANALYSIS_UUID) .setData(SOME_DATA) .setMetricId(metricId); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java index b6c9a5d852e..ea336c32f8f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java @@ -27,7 +27,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.sonar.db.measure.MeasureDto; -import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.Developer; import org.sonar.server.computation.component.DumbDeveloper; @@ -52,22 +51,18 @@ public class MeasureToMeasureDtoTest { private static final MetricImpl SOME_DOUBLE_METRIC = new MetricImpl(4, "4", "4", Metric.MetricType.FLOAT); private static final MetricImpl SOME_STRING_METRIC = new MetricImpl(5, "5", "5", Metric.MetricType.STRING); private static final MetricImpl SOME_LEVEL_METRIC = new MetricImpl(6, "6", "6", Metric.MetricType.LEVEL); - private static final String ANALYSIS_UUID = "a1"; - private static final Component SOME_COMPONENT = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("uuid_1").build(); - @Rule - public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(SOME_COMPONENT); + static final Component SOME_COMPONENT = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("uuid_1").build(); @Rule - public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule(); + public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(SOME_COMPONENT); - MeasureToMeasureDto underTest = new MeasureToMeasureDto(dbIdsRepository, analysisMetadataHolder); + MeasureToMeasureDto underTest = new MeasureToMeasureDto(dbIdsRepository); @Before public void setUp() throws Exception { dbIdsRepository.setComponentId(SOME_COMPONENT, SOME_COMPONENT_ID); dbIdsRepository.setSnapshotId(SOME_COMPONENT, SOME_SNAPSHOT_ID); - analysisMetadataHolder.setUuid(ANALYSIS_UUID); } @Test(expected = NullPointerException.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java index 8c2d769859f..2a823ba206f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java @@ -30,7 +30,6 @@ import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.rule.RuleDto; -import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.Developer; @@ -81,7 +80,6 @@ public class PersistMeasuresStepTest extends BaseStepTest { private static final long INTERMEDIATE_1_SNAPSHOT_ID = 4L; private static final long INTERMEDIATE_2_SNAPSHOT_ID = 5L; private static final long LEAF_SNAPSHOT_ID = 6L; - private static final String ANALYSIS_UUID = "a1"; @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -94,9 +92,6 @@ public class PersistMeasuresStepTest extends BaseStepTest { @Rule public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(treeRootHolder); - @Rule - public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule(); - DbClient dbClient = dbTester.getDbClient(); RuleDto rule; ComponentDto rootDto; @@ -108,8 +103,7 @@ public class PersistMeasuresStepTest extends BaseStepTest { @Before public void setUp() { - underTest = new PersistMeasuresStep(dbClient, metricRepository, new MeasureToMeasureDto(dbIdsRepository, analysisMetadataHolder), treeRootHolder, measureRepository); - analysisMetadataHolder.setUuid(ANALYSIS_UUID); + underTest = new PersistMeasuresStep(dbClient, metricRepository, new MeasureToMeasureDto(dbIdsRepository), treeRootHolder, measureRepository); } private void setupReportComponents() { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java index 9966397b101..a30a26cd2ac 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java @@ -51,16 +51,16 @@ import static org.sonar.server.computation.measure.Measure.newMeasureBuilder; public class ReportComputeMeasureVariationsStepTest { - private static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); - private static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); - private static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); - private static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); - private static final Metric NEW_DEBT = new MetricImpl(5, "new_debt", "new_debt", Metric.MetricType.WORK_DUR); - private static final String ANALYSIS_UUID = "a1"; - private static final ComponentDto PROJECT_DTO = ComponentTesting.newProjectDto(); - private static final int PROJECT_REF = 1; - private static final Component PROJECT = ReportComponent.builder(Component.Type.PROJECT, PROJECT_REF).setUuid(PROJECT_DTO.uuid()).build(); + static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); + static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); + static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); + static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); + static final Metric NEW_DEBT = new MetricImpl(5, "new_debt", "new_debt", Metric.MetricType.WORK_DUR); + static final ComponentDto PROJECT_DTO = ComponentTesting.newProjectDto(); + + static final int PROJECT_REF = 1; + static final Component PROJECT = ReportComponent.builder(Component.Type.PROJECT, PROJECT_REF).setUuid(PROJECT_DTO.uuid()).build(); @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -319,12 +319,7 @@ public class ReportComputeMeasureVariationsStepTest { } private static MeasureDto newMeasureDto(int metricId, String componentUuid, long snapshotId, double value) { - return new MeasureDto() - .setMetricId(metricId) - .setComponentUuid(componentUuid) - .setSnapshotId(snapshotId) - .setAnalysisUuid(ANALYSIS_UUID) - .setValue(value); + return new MeasureDto().setMetricId(metricId).setComponentUuid(componentUuid).setSnapshotId(snapshotId).setValue(value); } private static Period newPeriod(int index, SnapshotDto snapshotDto) { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java index f014d72529b..4f5cef4e49c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java @@ -49,13 +49,14 @@ import static org.sonar.db.component.SnapshotTesting.newSnapshotForView; public class ViewsComputeMeasureVariationsStepTest { - private static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); - private static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); - private static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); - private static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); - private static final ComponentDto VIEW_DTO = ComponentTesting.newView(); - private static final Component VIEW = ViewsComponent.builder(Component.Type.VIEW, 1).setUuid(VIEW_DTO.uuid()).build(); - private static final String ANALYSIS_UUID = "a1"; + static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); + static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); + static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); + static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); + + static final ComponentDto VIEW_DTO = ComponentTesting.newView(); + + static final Component VIEW = ViewsComponent.builder(Component.Type.VIEW, 1).setUuid(VIEW_DTO.uuid()).build(); @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -222,12 +223,7 @@ public class ViewsComputeMeasureVariationsStepTest { } private static MeasureDto newMeasureDto(int metricId, String componentUuid, long snapshotId, double value) { - return new MeasureDto() - .setMetricId(metricId) - .setComponentUuid(componentUuid) - .setSnapshotId(snapshotId) - .setAnalysisUuid(ANALYSIS_UUID) - .setValue(value); + return new MeasureDto().setMetricId(metricId).setComponentUuid(componentUuid).setSnapshotId(snapshotId).setValue(value); } private static Period newPeriod(int index, SnapshotDto snapshotDto) { diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml index 9a01b234b33..289d321734a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml @@ -91,7 +91,6 @@ VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -100,7 +99,6 @@ VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -110,7 +108,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -119,7 +116,6 @@ VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml index f788fbd156e..68809ddb260 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml @@ -1,29 +1,11 @@ - + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" /> - + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" /> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml index 0b498bd98ff..53ff5efd294 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml @@ -1,17 +1,6 @@ - diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml index 3006765aa14..ae4934573a6 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml @@ -1,18 +1,6 @@ - + diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml index 1cacaf4f14d..b6a2431d6e8 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml @@ -1,18 +1,6 @@ - + diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml index bf07feecd84..87064ba708a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml @@ -66,7 +66,6 @@ metric_id="1" value="500" snapshot_id="101" - analysis_uuid="u101" person_id="[null]" variation_value_1="[null]" variation_value_2="[null]" @@ -84,7 +83,6 @@ metric_id="1" value="300" snapshot_id="101" - analysis_uuid="u101" person_id="30000" variation_value_1="[null]" variation_value_2="[null]" @@ -101,7 +99,6 @@ metric_id="1" value="200" snapshot_id="101" - analysis_uuid="u101" person_id="40000" variation_value_1="[null]" variation_value_2="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml index 0634b49b664..ea433b44e9d 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml @@ -66,7 +66,6 @@ metric_id="1" value="500" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml index 2c8e4c9b202..1458d4aa9f9 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml @@ -258,7 +258,6 @@ metric_id="1" value="510" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -274,7 +273,6 @@ metric_id="1" value="510" snapshot_id="102" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -290,7 +288,6 @@ metric_id="1" value="500" snapshot_id="103" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -306,7 +303,6 @@ metric_id="1" value="10" snapshot_id="104" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -323,7 +319,6 @@ metric_id="2" value="[null]" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -340,7 +335,6 @@ metric_id="3" value="12.3" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -406,7 +400,6 @@ metric_id="1" value="5000" snapshot_id="110" - analysis_uuid="u110" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -422,7 +415,6 @@ metric_id="2" value="[null]" snapshot_id="110" - analysis_uuid="u110" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml index 9b1af0fa97d..ce6f4f3c9cb 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml @@ -68,7 +68,6 @@ metric_id="5" value="510" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -133,7 +132,6 @@ metric_id="5" value="5000" snapshot_id="110" - analysis_uuid="u110" url="[null]" variation_value_1="[null]" variation_value_2="[null]" @@ -199,7 +197,6 @@ metric_id="5" value="5000" snapshot_id="120" - analysis_uuid="u120" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb deleted file mode 100644 index 20544694def..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# 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 6.0 -# -class AddAnalysisUuidColumnToMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.AddAnalysisUuidColumnToMeasures') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb deleted file mode 100644 index 8e4858914f6..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# 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 6.0 -# -class PopulateAnalysisUuidOnMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.PopulateAnalysisUuidOnMeasures') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb deleted file mode 100644 index 7cfe63afcb9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# 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 6.0 -# -class CleanMeasuresWithNullAnalysisUuid < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.CleanMeasuresWithNullAnalysisUuid') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb deleted file mode 100644 index 2faf467f2d3..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# 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 6.0 -# -class MakeAnalysisUuidNotNullOnMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnMeasures') - end -end diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java index 7eeb2c77eec..b8ffe2469cb 100644 --- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java +++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java @@ -42,7 +42,6 @@ public class MeasureDto { private String description; private String componentUuid; private Long snapshotId; - private String analysisUuid; private Integer metricId; private Long developerId; @@ -189,15 +188,6 @@ public class MeasureDto { return this; } - public String getAnalysisUuid() { - return analysisUuid; - } - - public MeasureDto setAnalysisUuid(String s) { - this.analysisUuid = s; - return this; - } - /** * @deprecated in 5.5. Does nothing. Kept for compatibility with developer cockpit plugin, version 1.10 */ @@ -250,7 +240,6 @@ public class MeasureDto { .add("description", description) .add("componentUuid", componentUuid) .add("snapshotId", snapshotId) - .add("analysisUuid", analysisUuid) .add("metricId", metricId) .add("developerId", developerId) .add("metricKey", metricKey) diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java index 1ab5f63e537..09e6fd5afd8 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java +++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java @@ -30,7 +30,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 1_261; + public static final int LAST_VERSION = 1_257; /** * The minimum supported version which can be upgraded. Lower diff --git a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java index f3a9f918812..5dd6b7e55e7 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java +++ b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java @@ -86,7 +86,6 @@ import org.sonar.db.version.v56.FixTypeOfRuleTypeOnMysql; import org.sonar.db.version.v60.AddAnalysisUuidColumnToCeActivity; import org.sonar.db.version.v60.AddAnalysisUuidColumnToDuplicationsIndex; import org.sonar.db.version.v60.AddAnalysisUuidColumnToEvents; -import org.sonar.db.version.v60.AddAnalysisUuidColumnToMeasures; import org.sonar.db.version.v60.AddComponentUuidColumnToDuplicationsIndex; import org.sonar.db.version.v60.AddComponentUuidColumnToMeasures; import org.sonar.db.version.v60.AddComponentUuidColumnsToSnapshots; @@ -100,7 +99,6 @@ import org.sonar.db.version.v60.CleanEventsWithoutSnapshotId; import org.sonar.db.version.v60.CleanOrphanRowsInProjects; import org.sonar.db.version.v60.CleanOrphanRowsInResourceIndex; import org.sonar.db.version.v60.CleanOrphanRowsInSnapshots; -import org.sonar.db.version.v60.CleanMeasuresWithNullAnalysisUuid; import org.sonar.db.version.v60.DeleteOrphanDuplicationsIndexRowsWithoutAnalysis; import org.sonar.db.version.v60.DeleteOrphanDuplicationsIndexRowsWithoutComponent; import org.sonar.db.version.v60.DeleteOrphanMeasuresWithoutComponent; @@ -115,7 +113,6 @@ import org.sonar.db.version.v60.DropSnapshotIdColumnsFromDuplicationsIndex; import org.sonar.db.version.v60.DropUnusedMeasuresColumns; import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnDuplicationsIndex; import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnEvents; -import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnMeasures; import org.sonar.db.version.v60.MakeComponentUuidColumnsNotNullOnSnapshots; import org.sonar.db.version.v60.MakeComponentUuidNotNullOnDuplicationsIndex; import org.sonar.db.version.v60.MakeComponentUuidNotNullOnMeasures; @@ -126,7 +123,6 @@ import org.sonar.db.version.v60.MakeUuidPathColumnNotNullOnProjects; import org.sonar.db.version.v60.PopulateAnalysisUuidColumnOnCeActivity; import org.sonar.db.version.v60.PopulateAnalysisUuidOfDuplicationsIndex; import org.sonar.db.version.v60.PopulateAnalysisUuidOnEvents; -import org.sonar.db.version.v60.PopulateAnalysisUuidOnMeasures; import org.sonar.db.version.v60.PopulateComponentUuidColumnsOfSnapshots; import org.sonar.db.version.v60.PopulateComponentUuidOfDuplicationsIndex; import org.sonar.db.version.v60.PopulateComponentUuidOfMeasures; @@ -279,13 +275,6 @@ public class MigrationStepModule extends Module { // PROJECTS.UUID_PATH AddUuidPathColumnToProjects.class, PopulateUuidPathColumnOnProjects.class, - MakeUuidPathColumnNotNullOnProjects.class, - - // PROJECT_MEASURES.ANALYSIS_UUID - AddAnalysisUuidColumnToMeasures.class, - PopulateAnalysisUuidOnMeasures.class, - CleanMeasuresWithNullAnalysisUuid.class, - MakeAnalysisUuidNotNullOnMeasures.class - ); + MakeUuidPathColumnNotNullOnProjects.class); } } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java deleted file mode 100644 index f78c80181c9..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.AddColumnsBuilder; -import org.sonar.db.version.DdlChange; - -import static org.sonar.db.version.VarcharColumnDef.UUID_VARCHAR_SIZE; -import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder; - -public class AddAnalysisUuidColumnToMeasures extends DdlChange { - - private static final String TABLE_MEASURES = "project_measures"; - - public AddAnalysisUuidColumnToMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_MEASURES) - .addColumn(newVarcharColumnDefBuilder().setColumnName("analysis_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build()) - .build()); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java b/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java deleted file mode 100644 index 2def559c897..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.BaseDataChange; -import org.sonar.db.version.MassUpdate; - -public class CleanMeasuresWithNullAnalysisUuid extends BaseDataChange { - - public CleanMeasuresWithNullAnalysisUuid(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from project_measures where analysis_uuid is null"); - massUpdate.update("delete from project_measures where id=?"); - massUpdate.rowPluralName("measures"); - massUpdate.execute((row, update) -> { - update.setLong(1, row.getLong(1)); - return true; - }); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java deleted file mode 100644 index c7c05717cca..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.AlterColumnsBuilder; -import org.sonar.db.version.DdlChange; - -import static org.sonar.db.version.VarcharColumnDef.UUID_VARCHAR_SIZE; -import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder; - -public class MakeAnalysisUuidNotNullOnMeasures extends DdlChange { - - private static final String TABLE_MEASURES = "project_measures"; - - public MakeAnalysisUuidNotNullOnMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - context.execute(new AlterColumnsBuilder(getDatabase().getDialect(), TABLE_MEASURES) - .updateColumn(newVarcharColumnDefBuilder().setColumnName("analysis_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build()) - .build()); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java deleted file mode 100644 index 8393b129fe6..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.BaseDataChange; -import org.sonar.db.version.MassUpdate; -import org.sonar.db.version.Select; -import org.sonar.db.version.SqlStatement; - -public class PopulateAnalysisUuidOnMeasures extends BaseDataChange { - - public PopulateAnalysisUuidOnMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select distinct m.snapshot_id, root_snapshots.uuid " + - "from project_measures m " + - "inner join snapshots s on m.snapshot_id=s.id " + - "inner join snapshots root_snapshots on s.root_snapshot_id=root_snapshots.id " + - "where m.analysis_uuid is null"); - massUpdate.update("update project_measures set analysis_uuid=? where snapshot_id=? and analysis_uuid is null"); - massUpdate.rowPluralName("measures"); - massUpdate.execute(this::handle); - } - - private boolean handle(Select.Row row, SqlStatement update) throws SQLException { - long snapshotId = row.getLong(1); - String analysisUuid = row.getString(2); - - update.setString(1, analysisUuid); - update.setLong(2, snapshotId); - - return true; - } - -} diff --git a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml index c98feb9fbcf..c256b0b34c7 100644 --- a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml @@ -8,7 +8,6 @@ pm.person_id as developerId, pm.component_uuid as componentUuid, pm.snapshot_id as snapshotId, - pm.analysis_uuid as analysisUuid, pm.value as value, pm.text_value as textValue, pm.alert_status as alertStatus, @@ -218,39 +217,18 @@ INSERT INTO project_measures ( - value, - metric_id, - component_uuid, - snapshot_id, - analysis_uuid, - text_value, - alert_status, - alert_text, - description, - person_id, - variation_value_1, - variation_value_2, - variation_value_3, - variation_value_4, - variation_value_5, - measure_data) + value, metric_id, component_uuid, snapshot_id, text_value, alert_status, alert_text, description, + person_id, variation_value_1, variation_value_2, variation_value_3, variation_value_4, + variation_value_5, measure_data) VALUES ( - #{value, jdbcType=DOUBLE}, - #{metricId, jdbcType=INTEGER}, - #{componentUuid, jdbcType=VARCHAR}, + #{value, jdbcType=DOUBLE}, #{metricId, jdbcType=INTEGER}, #{componentUuid, jdbcType=VARCHAR}, #{snapshotId, jdbcType=INTEGER}, - #{analysisUuid, jdbcType=VARCHAR}, #{textValue, jdbcType=VARCHAR}, - #{alertStatus, jdbcType=VARCHAR}, - #{alertText, jdbcType=VARCHAR}, + #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, - #{developerId, jdbcType=INTEGER}, - #{variation1, jdbcType=DOUBLE}, - #{variation2, jdbcType=DOUBLE}, + #{developerId, jdbcType=INTEGER}, #{variation1, jdbcType=DOUBLE}, #{variation2, jdbcType=DOUBLE}, #{variation3, jdbcType=DOUBLE}, - #{variation4, jdbcType=DOUBLE}, - #{variation5, jdbcType=DOUBLE}, - #{dataValue, jdbcType=BINARY} + #{variation4, jdbcType=DOUBLE}, #{variation5, jdbcType=DOUBLE}, #{dataValue, jdbcType=BINARY} ) diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index 0fd0413b98b..ce75f9372b6 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -464,10 +464,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1254'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1255'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1256'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1257'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1258'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1259'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1260'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1261'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482'); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl index 12313c12212..72e3aa398c7 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl +++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl @@ -199,7 +199,6 @@ CREATE TABLE "PROJECT_MEASURES" ( "VALUE" DOUBLE, "METRIC_ID" INTEGER NOT NULL, "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "ANALYSIS_UUID" VARCHAR(50) NOT NULL, "SNAPSHOT_ID" INTEGER, "TEXT_VALUE" VARCHAR(4000), "ALERT_STATUS" VARCHAR(5), diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java index ab4b11eed84..f2c43e9515c 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java @@ -486,7 +486,6 @@ public class MeasureDaoTest { .setValue(value) .setComponentUuid(componentDto.uuid()) .setSnapshotId(snapshotDto.getId()) - .setAnalysisUuid("u1") .setDeveloperId(developerId); dbClient.measureDao().insert(dbSession, measureDto); dbSession.commit(); @@ -499,7 +498,6 @@ public class MeasureDaoTest { underTest.insert(dbSession, new MeasureDto() .setSnapshotId(2L) - .setAnalysisUuid("u2") .setMetricId(3) .setDeveloperId(23L) .setComponentUuid("FILE1") @@ -524,13 +522,11 @@ public class MeasureDaoTest { underTest.insert(dbSession, new MeasureDto() .setSnapshotId(2L) - .setAnalysisUuid("u2") .setMetricId(3) .setComponentUuid("COMPONENT_1") .setValue(2.0d), new MeasureDto() .setSnapshotId(3L) - .setAnalysisUuid("u2") .setMetricId(4) .setComponentUuid("COMPONENT_2") .setValue(4.0d)); diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java index 9aff2793d0f..fcecfd476b5 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java @@ -37,7 +37,6 @@ public class MeasureTesting { .setMetricId(metricDto.getId()) .setMetricKey(metricDto.getKey()) .setComponentUuid(snapshot.getComponentUuid()) - .setSnapshotId(snapshot.getId()) - .setAnalysisUuid(snapshot.getUuid()); + .setSnapshotId(snapshot.getId()); } } diff --git a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java index b72caa7bfba..a4d75a54649 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java @@ -29,6 +29,6 @@ public class MigrationStepModuleTest { public void verify_count_of_added_MigrationStep_types() { ComponentContainer container = new ComponentContainer(); new MigrationStepModule().configure(container); - assertThat(container.size()).isEqualTo(117); + assertThat(container.size()).isEqualTo(113); } } diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java deleted file mode 100644 index 9f6f288a557..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.sql.Types; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; - -public class AddAnalysisUuidColumnToMeasuresTest { - - private static final String TABLE = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, AddAnalysisUuidColumnToMeasuresTest.class, "old_measures.sql"); - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - private AddAnalysisUuidColumnToMeasures underTest = new AddAnalysisUuidColumnToMeasures(db.database()); - - @Test - public void migration_adds_column_to_empty_table() throws SQLException { - underTest.execute(); - - verifyAddedColumn(); - } - - @Test - public void migration_adds_column_to_populated_table() throws SQLException { - for (int i = 0; i < 9; i++) { - db.executeInsert( - TABLE, - "metric_id", valueOf(i), - "value", valueOf(i + 10), - "snapshot_id", valueOf(i + 100), - "component_uuid", valueOf(i + 1_000) - ); - } - db.commit(); - - underTest.execute(); - - verifyAddedColumn(); - } - - @Test - public void migration_is_not_reentrant() throws SQLException { - underTest.execute(); - - expectedException.expect(IllegalStateException.class); - expectedException.expectMessage("Fail to execute "); - underTest.execute(); - } - - private void verifyAddedColumn() { - db.assertColumnDefinition(TABLE, "analysis_uuid", Types.VARCHAR, 50, true); - } - -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java deleted file mode 100644 index a2d049ccdfe..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.util.List; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; -import static org.assertj.core.api.Assertions.assertThat; - -public class CleanMeasuresWithNullAnalysisUuidTest { - - private static final String TABLE_MEASURES = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, CleanMeasuresWithNullAnalysisUuidTest.class, - "in_progress_measures.sql"); - - private CleanMeasuresWithNullAnalysisUuid underTest = new CleanMeasuresWithNullAnalysisUuid(db.database()); - - @Test - public void migration_has_no_effect_on_empty_table() throws SQLException { - underTest.execute(); - - assertThat(db.countRowsOfTable(TABLE_MEASURES)).isEqualTo(0); - } - - @Test - public void migration_deletes_rows_with_null_analysis_uuid() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, "U1"); - insertMeasure(3, null); - db.commit(); - - underTest.execute(); - - assertThat(idsOfRows()).containsOnly(1L, 2L); - } - - @Test - public void migration_is_reentrant() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, null); - db.commit(); - - underTest.execute(); - assertThat(idsOfRows()).containsOnly(1L); - - underTest.execute(); - assertThat(idsOfRows()).containsOnly(1L); - } - - private void insertMeasure(long id, @Nullable String analysisUuid) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(id + 10), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300), - "ANALYSIS_UUID", analysisUuid); - } - - private List idsOfRows() { - return db.select("select ID from project_measures").stream().map(map -> (Long) map.get("ID")).collect(Collectors.toList()); - } -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java deleted file mode 100644 index 1c6089bbc4c..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.sql.Types; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; - - -public class MakeAnalysisUuidNotNullOnMeasuresTest { - - private static final String TABLE_MEASURES = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, MakeAnalysisUuidNotNullOnMeasuresTest.class, - "in_progress_measures.sql"); - - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - private MakeAnalysisUuidNotNullOnMeasures underTest = new MakeAnalysisUuidNotNullOnMeasures(db.database()); - - @Test - public void migration_makes_analysis_uuid_not_nullable_on_empty_table() throws SQLException { - underTest.execute(); - - verifyColumnDefinitions(); - } - - @Test - public void migration_makes_analysis_uuid_not_nullable_on_populated_table() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, "U2"); - - underTest.execute(); - - verifyColumnDefinitions(); - } - - @Test - public void migration_fails_if_some_uuid_columns_are_null() throws SQLException { - insertMeasure(2, null); - - expectedException.expect(IllegalStateException.class); - expectedException.expectMessage("Fail to execute"); - - underTest.execute(); - } - - private void insertMeasure(long id, @Nullable String analysisUuid) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(id + 10), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300), - "ANALYSIS_UUID", analysisUuid); - } - - private void verifyColumnDefinitions() { - db.assertColumnDefinition(TABLE_MEASURES, "analysis_uuid", Types.VARCHAR, 50, false); - } - -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java deleted file mode 100644 index 54c6c68d2f6..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.util.Map; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.resources.Qualifiers; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; -import static org.assertj.core.api.Assertions.assertThat; - -public class PopulateAnalysisUuidOnMeasuresTest { - - private static final String TABLE_MEASURES = "project_measures"; - private static final String TABLE_SNAPSHOTS = "snapshots"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, PopulateAnalysisUuidOnMeasuresTest.class, - "old_measures.sql"); - - private PopulateAnalysisUuidOnMeasures underTest = new PopulateAnalysisUuidOnMeasures(db.database()); - - @Test - public void migration_has_no_effect_on_empty_tables() throws SQLException { - underTest.execute(); - - assertThat(db.countRowsOfTable(TABLE_MEASURES)).isEqualTo(0); - } - - @Test - public void migration_populates_analysis_uuids() throws SQLException { - insertSnapshot(1, "U1", Qualifiers.PROJECT, 1); - insertSnapshot(2, "U2", Qualifiers.DIRECTORY, 1); - insertSnapshot(3, "U3", Qualifiers.FILE, 1); - insertMeasure(21, 1); - insertMeasure(22, 2); - insertMeasure(23, 3); - db.commit(); - - underTest.execute(); - - verifyAnalysisUuid(21, "U1"); - verifyAnalysisUuid(22, "U1"); - verifyAnalysisUuid(23, "U1"); - } - - @Test - public void migration_is_reentrant() throws SQLException { - insertSnapshot(1, "U1", Qualifiers.PROJECT, 1); - insertMeasure(21, 1); - - underTest.execute(); - verifyAnalysisUuid(21, "U1"); - - underTest.execute(); - verifyAnalysisUuid(21, "U1"); - } - - private void verifyAnalysisUuid(int measureId, @Nullable String expectedAnalysisUuid) { - Map rows = db.selectFirst("select analysis_uuid as \"analysisUuid\" from project_measures where id=" + measureId); - assertThat(rows.get("analysisUuid")).isEqualTo(expectedAnalysisUuid); - } - - private String insertSnapshot(long id, String uuid, String qualifier, long rootSnapshotId) { - db.executeInsert( - TABLE_SNAPSHOTS, - "ID", valueOf(id), - "UUID", uuid, - "COMPONENT_UUID", valueOf(id + 10), - "ROOT_COMPONENT_UUID", valueOf(id + 10), - "ROOT_SNAPSHOT_ID", valueOf(rootSnapshotId), - "QUALIFIER", qualifier); - return uuid; - } - - private void insertMeasure(long id, long snapshotId) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(snapshotId), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300)); - } -} diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml index 2072fa6c6a3..e2080221686 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml @@ -2,7 +2,6 @@ @@ -145,7 +144,6 @@ VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="[null]" component_uuid="ABCD"/> @@ -154,7 +152,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" - analysis_uuid="u1000" person_id="[null]" component_uuid="BCDE"/> @@ -162,7 +159,6 @@ VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" - analysis_uuid="u1000" person_id="[null]" component_uuid="BCDE"/> @@ -171,7 +167,6 @@ VALUE="5" METRIC_ID="1" SNAPSHOT_ID="1002" - analysis_uuid="u1000" person_id="[null]" component_uuid="CDEF"/> @@ -179,7 +174,6 @@ VALUE="60" METRIC_ID="2" SNAPSHOT_ID="1002" - analysis_uuid="u1000" person_id="[null]" component_uuid="CDEF"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml index 260f36f3c49..90bae067103 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml @@ -44,7 +44,6 @@ VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="[null]" component_uuid="ABCD"/> @@ -52,7 +51,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="20" component_uuid="ABCD"/> @@ -60,7 +58,6 @@ VALUE="40" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="21" component_uuid="ABCD"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml index bdd864aa9ee..8c287369351 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml @@ -22,7 +22,6 @@ -