Search in sources :

Example 26 with Base32LongID

use of org.jboss.pnc.model.Base32LongID 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;
}
Also used : Base32LongID(org.jboss.pnc.model.Base32LongID) BuildPushResult(org.jboss.pnc.dto.BuildPushResult) BuildRecordPushResult(org.jboss.pnc.model.BuildRecordPushResult)

Aggregations

Base32LongID (org.jboss.pnc.model.Base32LongID)26 BuildRecord (org.jboss.pnc.model.BuildRecord)18 Test (org.junit.Test)7 Build (org.jboss.pnc.dto.Build)6 BuildConfigurationAudited (org.jboss.pnc.model.BuildConfigurationAudited)6 Date (java.util.Date)5 BuildPageInfo (org.jboss.pnc.facade.providers.api.BuildPageInfo)5 IdRev (org.jboss.pnc.model.IdRev)5 BuildTask (org.jboss.pnc.spi.coordinator.BuildTask)5 List (java.util.List)4 Map (java.util.Map)4 Set (java.util.Set)4 BuildConfigSetRecord (org.jboss.pnc.model.BuildConfigSetRecord)4 Collectors (java.util.stream.Collectors)3 Stateless (javax.ejb.Stateless)3 Inject (javax.inject.Inject)3 BuildConfiguration (org.jboss.pnc.model.BuildConfiguration)3 BuildConfigurationAuditedRepository (org.jboss.pnc.spi.datastore.repositories.BuildConfigurationAuditedRepository)3 BuildRecordRepository (org.jboss.pnc.spi.datastore.repositories.BuildRecordRepository)3 Logger (org.slf4j.Logger)3