use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class OpenPullRequestProviderTest method createPullRequest.
private static PullRequest createPullRequest(String id, PullRequestStatus status) {
PullRequest existingPullRequest = new PullRequest();
existingPullRequest.setId(id);
existingPullRequest.setTitle("title " + id);
existingPullRequest.setSource("source");
existingPullRequest.setTarget("target");
existingPullRequest.setStatus(status);
return existingPullRequest;
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class AllReviewerApprovedRuleTest method shouldReturnFailedIfReviewerHaveNotApproved.
@Test
void shouldReturnFailedIfReviewerHaveNotApproved() {
PullRequest pullRequest = TestData.createPullRequest();
pullRequest.addReviewer("trillian");
pullRequest.addReviewer("dent");
Context context = new Context(REPOSITORY, pullRequest);
Result result = rule.validate(context);
assertThat(result.isFailed()).isTrue();
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class MergeObstacleCheckHook method checkForObstacles.
@Subscribe(async = false)
public void checkForObstacles(PreReceiveRepositoryHookEvent event) {
HookContext context = event.getContext();
Repository repository = event.getRepository();
if (ignoreHook(context, repository)) {
return;
}
List<PullRequest> pullRequests = pullRequestService.getAll(repository.getNamespace(), repository.getName());
new Worker(event).process(pullRequests);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class StatusCheckHook method checkStatus.
@Subscribe(async = false)
public void checkStatus(PostReceiveRepositoryHookEvent event) {
Repository repository = event.getRepository();
if (ignoreHook(event.getContext(), repository)) {
return;
}
List<PullRequest> pullRequests = pullRequestService.getAll(repository.getNamespace(), repository.getName());
new Worker(event).process(pullRequests);
}
use of com.cloudogu.scm.review.pullrequest.service.PullRequest in project scm-review-plugin by scm-manager.
the class CommentService method addCommentOnEmergencyMerge.
@Subscribe
public void addCommentOnEmergencyMerge(PullRequestEmergencyMergedEvent mergedEvent) {
PullRequest pullRequest = mergedEvent.getPullRequest();
Comment comment = new Comment();
comment.setEmergencyMerged(true);
comment.setComment(pullRequest.getOverrideMessage());
addWithoutPermissionCheck(mergedEvent.getRepository(), pullRequest.getId(), comment);
}
Aggregations