Not the key of the technicalprojectcopytags/7.5
@@ -28,12 +28,14 @@ import static java.util.Objects.requireNonNull; | |||
@Immutable | |||
public class ProjectViewAttributes { | |||
private final String projectUuid; | |||
private final String originalKey; | |||
@CheckForNull | |||
private final Long analysisDate; | |||
private final String branchName; | |||
public ProjectViewAttributes(String projectUuid, @Nullable Long analysisDate, @Nullable String branchName) { | |||
public ProjectViewAttributes(String projectUuid, String originalKey, @Nullable Long analysisDate, @Nullable String branchName) { | |||
this.projectUuid = requireNonNull(projectUuid, "projectUuid can't be null"); | |||
this.originalKey = requireNonNull(originalKey, "projectKey can't be null");; | |||
this.analysisDate = analysisDate; | |||
this.branchName = branchName; | |||
} | |||
@@ -52,6 +54,10 @@ public class ProjectViewAttributes { | |||
return branchName; | |||
} | |||
public String getOriginalKey() { | |||
return originalKey; | |||
} | |||
@Override | |||
public String toString() { | |||
return "ProjectViewAttributes{" + |
@@ -470,7 +470,7 @@ public class ViewsPersistComponentsStepTest extends BaseStepTest { | |||
.setUuid(PROJECT_VIEW_1_UUID) | |||
.setName(PROJECT_VIEW_1_NAME) | |||
.setDescription("project view description is not persisted") | |||
.setProjectViewAttributes(new ProjectViewAttributes(project.uuid(), analysisDate, project.getBranch())); | |||
.setProjectViewAttributes(new ProjectViewAttributes(project.uuid(), project.getDbKey(), analysisDate, project.getBranch())); | |||
} | |||
private void persistComponents(ComponentDto... componentDtos) { |
@@ -31,7 +31,6 @@ import org.sonar.api.server.ws.Response; | |||
import org.sonar.api.server.ws.WebService; | |||
import org.sonar.api.server.ws.WebService.Param; | |||
import org.sonar.api.web.UserRole; | |||
import org.sonar.core.util.stream.MoreCollectors; | |||
import org.sonar.db.DbClient; | |||
import org.sonar.db.DbSession; | |||
import org.sonar.db.component.ComponentDto; | |||
@@ -46,6 +45,7 @@ import static com.google.common.base.Preconditions.checkArgument; | |||
import static org.sonar.api.utils.DateUtils.parseEndingDateOrDateTime; | |||
import static org.sonar.api.utils.DateUtils.parseStartingDateOrDateTime; | |||
import static org.sonar.core.util.Protobuf.setNullable; | |||
import static org.sonar.core.util.stream.MoreCollectors.toList; | |||
import static org.sonar.db.component.SnapshotQuery.SORT_FIELD.BY_DATE; | |||
import static org.sonar.db.component.SnapshotQuery.SORT_ORDER.DESC; | |||
import static org.sonar.server.projectanalysis.ws.EventCategory.OTHER; | |||
@@ -166,7 +166,7 @@ public class SearchAction implements ProjectAnalysesWsAction { | |||
} | |||
private void addEvents(SearchData.Builder data) { | |||
List<String> analyses = data.getAnalyses().stream().map(SnapshotDto::getUuid).collect(MoreCollectors.toList()); | |||
List<String> analyses = data.getAnalyses().stream().map(SnapshotDto::getUuid).collect(toList()); | |||
data.setEvents(dbClient.eventDao().selectByAnalysisUuids(data.getDbSession(), analyses)); | |||
data.setComponentChanges(dbClient.eventComponentChangeDao().selectByAnalysisUuids(data.getDbSession(), analyses)); | |||
} |
@@ -30,7 +30,6 @@ import java.util.stream.Collectors; | |||
import javax.annotation.Nullable; | |||
import org.sonar.api.utils.log.Logger; | |||
import org.sonar.api.utils.log.Loggers; | |||
import org.sonar.core.util.stream.MoreCollectors; | |||
import org.sonar.db.component.SnapshotDto; | |||
import org.sonar.db.event.EventComponentChangeDto; | |||
import org.sonar.db.event.EventDto; | |||
@@ -44,6 +43,7 @@ import static java.lang.String.format; | |||
import static java.util.stream.Collectors.toList; | |||
import static org.sonar.api.utils.DateUtils.formatDateTime; | |||
import static org.sonar.core.util.Protobuf.setNullable; | |||
import static org.sonar.core.util.stream.MoreCollectors.index; | |||
import static org.sonar.server.projectanalysis.ws.EventCategory.fromLabel; | |||
class SearchResponseBuilder { | |||
@@ -148,7 +148,7 @@ class SearchResponseBuilder { | |||
} | |||
ListMultimap<String, EventComponentChangeDto> componentChangeByKey = eventComponentChangeDtos.stream() | |||
.collect(MoreCollectors.index(EventComponentChangeDto::getComponentKey)); | |||
.collect(index(EventComponentChangeDto::getComponentKey)); | |||
try { | |||
wsDefinitionChange.addAllProjects( |