/** * A SVN change log works always on the same branch. */ @JsonIgnore public Branch getBranch() { return getFrom().getBuild().getBranch(); } }
public static BuildView of(Build build) { return new BuildView(build, Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); }
protected void validateIssues(List<I> issuesList, SCMChangeLog<T> changeLog) { // Same branch only if (changeLog.isSameBranch()) { // Gets the branch Branch branch = changeLog.getFrom().getBuild().getBranch(); // Gets the list of validators for this branch List<Property<?>> properties = propertyService.getProperties(branch).stream() .filter(property -> !property.isEmpty() && property.getType() instanceof SCMChangeLogIssueValidator) .collect(Collectors.toList()); // Validates each issues issuesList.forEach(issue -> validateIssue(issue, properties, changeLog)); } }
protected SCMBuildView<SVNHistory> getSCMBuildView(SVNRepository svnRepository, ID buildId) { // Gets the build view BuildView buildView = getBuildView(buildId); // Gets the history for the build SVNHistory history = getBuildSVNHistory(svnRepository, buildView.getBuild()); // OK return new SCMBuildView<>(buildView, history); }
@Override public List<Link> links(SVNChangeLog changeLog, ResourceContext resourceContext) { return resourceContext.links() .link("_revisions", on(SVNController.class).changeLogRevisions(changeLog.getUuid())) .link("_issues", on(SVNController.class).changeLogIssues(changeLog.getUuid()), changeLog.getRepository().getConfiguredIssueService() != null) .link("_files", on(SVNController.class).changeLogFiles(changeLog.getUuid())) .link("_changeLogFileFilters", on(SCMController.class).getChangeLogFileFilters(changeLog.getProject().getId())) .link("_diff", on(SVNController.class).diff(null)) .link("_exportFormats", on(SVNController.class).changeLogExportFormats(changeLog.getBranch().getId())) .link("_exportIssues", on(SVNController.class).changeLog(new IssueChangeLogExportRequest())) .page( "_page", "extension/svn/changelog?from=%d&to=%d", changeLog.getFrom().getBuild().id(), changeLog.getTo().getBuild().id() ) .build(); }