diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2019-08-06 13:21:21 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-09-24 20:21:12 +0200 |
commit | ba41dbfdf353e6b1d50a9b2af75d57faa65eeb95 (patch) | |
tree | e48fcec174177e7b75783a3e98aa9a8185cdf913 /server/sonar-ce-task-projectanalysis/src/main/java | |
parent | d2bba782392ad2390d790b15c8eddb24f37acd1e (diff) | |
download | sonarqube-ba41dbfdf353e6b1d50a9b2af75d57faa65eeb95.tar.gz sonarqube-ba41dbfdf353e6b1d50a9b2af75d57faa65eeb95.zip |
SONAR-12364 - switch from manual baseline to New Code Period concept
Diffstat (limited to 'server/sonar-ce-task-projectanalysis/src/main/java')
-rw-r--r-- | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStep.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStep.java index 5894c17a8ce..c153c31afe9 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadPeriodsStep.java @@ -52,6 +52,7 @@ import org.sonar.db.component.BranchType; import org.sonar.db.component.SnapshotDto; import org.sonar.db.component.SnapshotQuery; import org.sonar.db.event.EventDto; +import org.sonar.db.newcodeperiod.NewCodePeriodDto; import static com.google.common.base.Preconditions.checkState; import static java.lang.String.format; @@ -84,7 +85,7 @@ public class LoadPeriodsStep implements ComputationStep { private final ConfigurationRepository configRepository; public LoadPeriodsStep(AnalysisMetadataHolder analysisMetadataHolder, TreeRootHolder treeRootHolder, PeriodHolderImpl periodsHolder, - System2 system2, DbClient dbClient, ConfigurationRepository configRepository) { + System2 system2, DbClient dbClient, ConfigurationRepository configRepository) { this.analysisMetadataHolder = analysisMetadataHolder; this.treeRootHolder = treeRootHolder; this.periodsHolder = periodsHolder; @@ -134,7 +135,9 @@ public class LoadPeriodsStep implements ComputationStep { } private Period resolveByManualBaseline(DbSession dbSession, String projectUuid, BranchDto branchDto) { - String baselineAnalysisUuid = branchDto.getManualBaseline(); + String baselineAnalysisUuid = dbClient.newCodePeriodDao().selectByBranch(dbSession, projectUuid, branchDto.getUuid()) + .map(NewCodePeriodDto::getValue) + .orElse(null); if (baselineAnalysisUuid == null) { return null; } |