use of org.jboss.pnc.dto.BuildPushResult in project pnc by project-ncl.
the class BrewPusherImpl method getBrewPushResult.
@Override
public BuildPushResult getBrewPushResult(String buildId) {
Base32LongID id = BuildMapper.idMapper.toEntity(buildId);
BuildPushResult result = null;
Optional<InProgress.Context> pushContext = buildResultPushManager.getContext(id);
if (pushContext.isPresent()) {
result = BuildPushResult.builder().buildId(buildId).status(BuildPushStatus.ACCEPTED).logContext(pushContext.get().getPushResultId()).build();
} else {
BuildRecordPushResult latestForBuildRecord = buildRecordPushResultRepository.getLatestForBuildRecord(id);
if (latestForBuildRecord != null) {
return buildPushResultMapper.toDTO(latestForBuildRecord);
}
}
return result;
}
Aggregations