private final Long pullRequestCount;
private final String scm;
private final String ci;
- private final String alm;
+ private final String devopsPlatform;
- ProjectStatistics(String projectUuid, Long branchCount, Long pullRequestCount, @Nullable String scm, @Nullable String ci, @Nullable String alm) {
+ ProjectStatistics(String projectUuid, Long branchCount, Long pullRequestCount, @Nullable String scm, @Nullable String ci, @Nullable String devopsPlatform) {
this.projectUuid = projectUuid;
this.branchCount = branchCount;
this.pullRequestCount = pullRequestCount;
this.scm = scm;
this.ci = ci;
- this.alm = alm;
+ this.devopsPlatform = devopsPlatform;
}
public String getProjectUuid() {
}
@CheckForNull
- public String getAlm() {
- return alm;
+ public String getDevopsPlatform() {
+ return devopsPlatform;
}
}
}
json.prop("pullRequestCount", project.getPullRequestCount());
json.prop("scm", project.getScm());
json.prop("ci", project.getCi());
- json.prop("alm", project.getAlm());
+ json.prop("devopsPlatform", project.getDevopsPlatform());
json.endObject();
});
json.endArray();
" \"pullRequestCount\": 2," +
" \"scm\": \"scm-0\"," +
" \"ci\": \"ci-0\"," +
- " \"alm\": \"alm-0\"" +
+ " \"devopsPlatform\": \"devops-0\"" +
" }," +
" {" +
" \"projectUuid\": \"uuid-1\"," +
" \"pullRequestCount\": 4," +
" \"scm\": \"scm-1\"," +
" \"ci\": \"ci-1\"," +
- " \"alm\": \"alm-1\"" +
+ " \"devopsPlatform\": \"devops-1\"" +
" }," +
" {" +
" \"projectUuid\": \"uuid-2\"," +
" \"pullRequestCount\": 6," +
" \"scm\": \"scm-2\"," +
" \"ci\": \"ci-2\"," +
- " \"alm\": \"alm-2\"" +
+ " \"devopsPlatform\": \"devops-2\"" +
" }" +
" ]" +
"}");
}
private List<TelemetryData.ProjectStatistics> getProjectStats() {
- return IntStream.range(0, 3).mapToObj(i -> new TelemetryData.ProjectStatistics("uuid-" + i, (i + 1L) * 2L, (i + 1L) * 2L, "scm-" + i, "ci-" + i, "alm-" + i))
+ return IntStream.range(0, 3).mapToObj(i -> new TelemetryData.ProjectStatistics("uuid-" + i, (i + 1L) * 2L, (i + 1L) * 2L, "scm-" + i, "ci-" + i, "devops-" + i))
.collect(Collectors.toList());
}
import org.sonar.db.component.AnalysisPropertyValuePerProject;
import org.sonar.db.component.PrAndBranchCountByProjectDto;
import org.sonar.db.measure.ProjectMeasureDto;
-import org.sonar.server.measure.index.ProjectMeasuresIndex;
import org.sonar.server.platform.DockerSupport;
import org.sonar.server.property.InternalProperties;
import org.sonar.server.telemetry.TelemetryData.Database;
Long pullRequestCount = Optional.ofNullable(prAndBranchCountByProjects.get(projectUuid)).map(PrAndBranchCountByProjectDto::getPullRequest).orElse(0L);
String scm = Optional.ofNullable(scmByProject.get(projectUuid)).orElse(UNDETECTED);
String ci = Optional.ofNullable(ciByProject.get(projectUuid)).orElse(UNDETECTED);
- String alm = null;
+ String devopsPlatform = null;
if (almAndUrlByProject.containsKey(projectUuid)) {
ProjectAlmKeyAndProject projectAlmKeyAndProject = almAndUrlByProject.get(projectUuid);
- alm = getAlmName(projectAlmKeyAndProject.getAlmId(), projectAlmKeyAndProject.getUrl());
+ devopsPlatform = getAlmName(projectAlmKeyAndProject.getAlmId(), projectAlmKeyAndProject.getUrl());
}
- alm = Optional.ofNullable(alm).orElse(UNDETECTED);
+ devopsPlatform = Optional.ofNullable(devopsPlatform).orElse(UNDETECTED);
- projectStatistics.add(new TelemetryData.ProjectStatistics(projectUuid, branchCount, pullRequestCount, scm, ci, alm));
+ projectStatistics.add(new TelemetryData.ProjectStatistics(projectUuid, branchCount, pullRequestCount, scm, ci, devopsPlatform));
}
data.setProjectStatistics(projectStatistics);
import org.sonar.db.metric.MetricDto;
import org.sonar.db.user.UserDto;
import org.sonar.db.user.UserTelemetryDto;
-import org.sonar.server.es.EsTester;
-import org.sonar.server.measure.index.ProjectMeasuresIndex;
-import org.sonar.server.measure.index.ProjectMeasuresIndexer;
import org.sonar.server.platform.DockerSupport;
import org.sonar.server.property.InternalProperties;
import org.sonar.server.property.MapInternalProperties;
tuple(project2.uuid(), "js", 20L, analysisDate));
assertThat(data.getProjectStatistics())
.extracting(TelemetryData.ProjectStatistics::getBranchCount, TelemetryData.ProjectStatistics::getPullRequestCount,
- TelemetryData.ProjectStatistics::getScm, TelemetryData.ProjectStatistics::getCi, TelemetryData.ProjectStatistics::getAlm)
+ TelemetryData.ProjectStatistics::getScm, TelemetryData.ProjectStatistics::getCi, TelemetryData.ProjectStatistics::getDevopsPlatform)
.containsExactlyInAnyOrder(
tuple(1L, 0L, "scm-1", "ci-1", "azure_devops_cloud"),
tuple(1L, 0L, "scm-2", "ci-2", "github_cloud"));
db.components().insertPublicProject();
TelemetryData data = communityUnderTest.load();
assertThat(data.getProjectStatistics())
- .extracting(TelemetryData.ProjectStatistics::getAlm, TelemetryData.ProjectStatistics::getScm, TelemetryData.ProjectStatistics::getCi)
+ .extracting(TelemetryData.ProjectStatistics::getDevopsPlatform, TelemetryData.ProjectStatistics::getScm, TelemetryData.ProjectStatistics::getCi)
.containsExactlyInAnyOrder(tuple("undetected", "undetected", "undetected"));
}