Search in sources :

Example 11 with Subscribe

use of com.github.legman.Subscribe in project scm-review-plugin by scm-manager.

the class EmailNotificationHook method handleRejectedPullRequest.

@Subscribe
public void handleRejectedPullRequest(PullRequestRejectedEvent event) {
    PullRequest pullRequest = event.getPullRequest();
    handleEvent(event, new PullRequestRejectedMailTextResolver(event), pullRequest, getSubscribersWithoutCurrentUser(pullRequest));
}
Also used : PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Example 12 with Subscribe

use of com.github.legman.Subscribe in project scm-review-plugin by scm-manager.

the class EmailNotificationHook method handlePullRequestEvents.

@Subscribe
public void handlePullRequestEvents(PullRequestEvent event) {
    PullRequest pullRequest = event.getPullRequest();
    EMailRecipientHelper eMailRecipientHelper = new EMailRecipientHelper(pullRequest);
    Set<String> subscriberWithoutReviewers = eMailRecipientHelper.getSubscriberWithoutReviewers();
    Set<String> reviewers = eMailRecipientHelper.getSubscribingReviewers();
    handleEvent(event, new PullRequestEventMailTextResolver(event, false), pullRequest, subscriberWithoutReviewers);
    handleEvent(event, new PullRequestEventMailTextResolver(event, true), pullRequest, reviewers);
}
Also used : PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Example 13 with Subscribe

use of com.github.legman.Subscribe in project scm-review-plugin by scm-manager.

the class EmailNotificationHook method handleReplyEvents.

@Subscribe
public void handleReplyEvents(ReplyEvent event) {
    PullRequest pullRequest = event.getPullRequest();
    Set<String> authorsInThread = getAuthorsInThread(event);
    Set<String> subscribers = getSubscribersWithoutCurrentUser(pullRequest);
    subscribers.removeAll(authorsInThread);
    handleEvent(event, new CommentEventMailTextResolver(event), pullRequest, subscribers);
    handleEvent(event, new ReplyEventMailTextResolver(event), pullRequest, authorsInThread);
}
Also used : PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Example 14 with Subscribe

use of com.github.legman.Subscribe in project scm-review-plugin by scm-manager.

the class EmailNotificationHook method handleMergedPullRequest.

@Subscribe
public void handleMergedPullRequest(PullRequestMergedEvent event) {
    PullRequest pullRequest = event.getPullRequest();
    handleEvent(event, new PullRequestMergedMailTextResolver(event), pullRequest, getSubscribersWithoutCurrentUser(pullRequest));
}
Also used : PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Aggregations

Subscribe (com.github.legman.Subscribe)14 PullRequest (com.cloudogu.scm.review.pullrequest.service.PullRequest)12 Repository (sonia.scm.repository.Repository)5 PermissionCheck (com.cloudogu.scm.review.PermissionCheck)2 PullRequestService (com.cloudogu.scm.review.pullrequest.service.PullRequestService)2 Optional (java.util.Optional)2 Inject (javax.inject.Inject)2 ServletContextEvent (javax.servlet.ServletContextEvent)2 ServletContextListener (javax.servlet.ServletContextListener)2 HandlerEventType (sonia.scm.HandlerEventType)2 Extension (sonia.scm.plugin.Extension)2 RepositoryImportEvent (sonia.scm.repository.RepositoryImportEvent)2 RepositoryManager (sonia.scm.repository.RepositoryManager)2 RepositoryPermissions (sonia.scm.repository.RepositoryPermissions)2 HookContext (sonia.scm.repository.api.HookContext)2 Id (sonia.scm.search.Id)2 Index (sonia.scm.search.Index)2 IndexLog (sonia.scm.search.IndexLog)2 IndexLogStore (sonia.scm.search.IndexLogStore)2 IndexTask (sonia.scm.search.IndexTask)2