Search in sources :

Example 6 with Subscribe

use of com.github.legman.Subscribe 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);
}
Also used : Repository(sonia.scm.repository.Repository) PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) HookContext(sonia.scm.repository.api.HookContext) Subscribe(com.github.legman.Subscribe)

Example 7 with Subscribe

use of com.github.legman.Subscribe 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);
}
Also used : Repository(sonia.scm.repository.Repository) PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Example 8 with Subscribe

use of com.github.legman.Subscribe 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);
}
Also used : PullRequest(com.cloudogu.scm.review.pullrequest.service.PullRequest) Subscribe(com.github.legman.Subscribe)

Example 9 with Subscribe

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

the class EmailNotificationHook method handleUpdatedPullRequest.

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

Example 10 with Subscribe

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

the class EmailNotificationHook method handlePullRequestApproval.

@Subscribe
public void handlePullRequestApproval(PullRequestApprovalEvent event) {
    PullRequest pullRequest = event.getPullRequest();
    handleEvent(event, new PullRequestApprovalMailTextResolver(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