@Override public Collection<ValidationStamp> getSourceItems() { return structureService.getValidationStampListForBranch(sourceBranch.getId()); }
@Override public Collection<ValidationStamp> getTargetItems() { return structureService.getValidationStampListForBranch(targetBranch.getId()); }
private DataFetcher branchValidationStampsFetcher() { return environment -> { Object source = environment.getSource(); Optional<String> name = GraphqlUtils.getStringArgument(environment, "name"); if (source instanceof Branch) { Branch branch = (Branch) source; if (name.isPresent()) { return structureService.findValidationStampByName( branch.getProject().getName(), branch.getName(), name.get() ) .map(Collections::singletonList) .orElse(Collections.emptyList()); } else { return structureService.getValidationStampListForBranch(branch.getId()); } } else { return Collections.emptyList(); } }; }
private void onNewValidationRun(Event event) { // Passed validation? ValidationRun validationRun = event.getEntity(ProjectEntityType.VALIDATION_RUN); if (Objects.equals( validationRun.getLastStatus().getStatusID(), ValidationRunStatusID.STATUS_PASSED)) { // Branch Branch branch = event.getEntity(ProjectEntityType.BRANCH); // Build Build build = event.getEntity(ProjectEntityType.BUILD); // Gets all promotion levels for this branch List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branch.getId()); // Gets all validation stamps for this branch List<ValidationStamp> validationStamps = structureService.getValidationStampListForBranch(branch.getId()); // Gets the promotion levels which have an auto promotion property promotionLevels.forEach(promotionLevel -> checkPromotionLevel(build, promotionLevel, validationStamps)); } }
.label("Validation stamps") .items( structureService.getValidationStampListForBranch(promotionLevel.getBranch().getId()) .stream() .map(vs -> new ValidationStampSelection(