@Override public Collection<PromotionLevel> getSourceItems() { return structureService.getPromotionLevelListForBranch(sourceBranch.getId()); }
@Override public Collection<PromotionLevel> getTargetItems() { return structureService.getPromotionLevelListForBranch(targetBranch.getId()); }
private DataFetcher branchPromotionLevelsFetcher() { return environment -> { Object source = environment.getSource(); if (source instanceof Branch) { Branch branch = (Branch) source; return structureService.getPromotionLevelListForBranch(branch.getId()); } else { return Collections.emptyList(); } }; }
private void onDeleteValidationStamp(Event event) { // Gets the validation stamp ID int validationStampId = event.getIntValue("validation_stamp_id"); // Branch Branch branch = event.getEntity(ProjectEntityType.BRANCH); // Gets all promotion levels for this branch List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branch.getId()); // Checks all promotion levels promotionLevels.forEach(promotionLevel -> cleanPromotionLevel(promotionLevel, validationStampId)); }
@Override public List<Build> filterBranchBuilds(Branch branch, Object data) { List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branch.getId());
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)); } }
@Override protected Form blankForm(ID branchId) { List<PromotionLevel> promotionLevels = structureService.getPromotionLevelListForBranch(branchId);