stable

Clone or download

Read-only

A line in the log at the debug level when a notification should be sent

This contribution puts in place the cornerstone of the architecture to process notification coming from pull request events. For now, the notifications are processed synchronously. In order to deal with the fact that Tuleap will have to deal with PR notifications for vastly different type of events (i.e. there is not much data in common when sending a notification because a new reviewer as been added vs when a PR is merged) an event bus [0] has been implemented on top of PSR-14 [1]. For each type of events it is possible to define what the content of the notification should be. The usage of PSR-14 besides being a good fit for this could allow us to map it to the global async event management. Part of story #14190: get email notifications on pull requests - first stage [0] https://en.wikipedia.org/wiki/Event-driven_architecture [1] https://www.php-fig.org/psr/psr-14/ Change-Id: Ie240e0283ed00e2df28bbf6d7d76acd6ce98f5b2

Modified Files

Name
M plugins/git/include/GitActions.class.php +2 −2 Go to diff View file
M plugins/git/include/GitPHP/Commit/CommitUserPresenter.php +2 −2 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/EventSubjectToNotification.php +27 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/EventSubjectToNotificationListenerProvider.php +54 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/EventSubjectToNotificationSynchronousDispatcher.php +70 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/NotificationToProcess.php +37 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/NotificationToProcessBuilder.php +35 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Notification/PullRequestNotificationExecutor.php +47 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/REST/v1/PullRequestsResource.php +43 −3 Go to diff View file
M plugins/pullrequest/include/PullRequest/Reviewer/Change/ReviewerChangeDAO.php +19 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Reviewer/Change/ReviewerChangeEvent.php +51 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Reviewer/Change/ReviewerChangePullRequestAssociation.php +59 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/Reviewer/Change/ReviewerChangeRetriever.php +35 −4 Go to diff View file
A plugins/pullrequest/include/PullRequest/Reviewer/Notification/ReviewerAddedNotification.php +90 −0 Go to diff View file
A plugins/pullrequest/include/PullRequest/Reviewer/Notification/ReviewerChangeNotificationToProcessBuilder.php +76 −0 Go to diff View file
M plugins/pullrequest/include/PullRequest/Reviewer/ReviewerDAO.php +7 −5 Go to diff View file
M plugins/pullrequest/include/PullRequest/Reviewer/ReviewerUpdater.php +20 −3 Go to diff View file
M plugins/pullrequest/include/PullRequestPluginDescriptor.class.php +2 −2 Go to diff View file
A plugins/pullrequest/phpunit/Notification/EventSubjectToNotificationListenerProviderTest.php +63 −0 Go to diff View file
A plugins/pullrequest/phpunit/Notification/EventSubjectToNotificationSynchronousDispatcherTest.php +101 −0 Go to diff View file
A plugins/pullrequest/phpunit/Notification/PullRequestNotificationExecutorTest.php +69 −0 Go to diff View file
M plugins/pullrequest/phpunit/Reviewer/Change/ReviewerChangeRetrieverTest.php +102 −3 Go to diff View file
A plugins/pullrequest/phpunit/Reviewer/Notification/ReviewerAddedNotificationTest.php +57 −0 Go to diff View file
A plugins/pullrequest/phpunit/Reviewer/Notification/ReviewerChangeNotificationToProcessBuilderTest.php +101 −0 Go to diff View file
M plugins/pullrequest/phpunit/Reviewer/ReviewerUpdaterTest.php +42 −4 Go to diff View file
M plugins/pullrequest/site-content/en_US/pullrequest.tab +0 −1 Go to diff View file
M plugins/pullrequest/site-content/fr_FR/LC_MESSAGES/tuleap-pullrequest.po +7 −0 Go to diff View file
M plugins/pullrequest/site-content/fr_FR/pullrequest.tab +0 −1 Go to diff View file
M plugins/pullrequest/tests/integration/Reviewer/Change/ReviewerChangeDAOTest.php +23 −6 Go to diff View file
M src/common/User/UserHelper.class.php +2 −2 Go to diff View file