Исправление уведомления об обновлении MR
This commit is contained in:
parent
03b8675c78
commit
f2bd5247ae
@ -156,28 +156,26 @@ public class MergeRequestsServiceImpl implements MergeRequestsService {
|
||||
mergeRequest.setUserAssignee(assigneeChanged.getNewStatus(oldMergeRequest.isUserAssignee()));
|
||||
mergeRequest.setUserReviewer(reviewerChanged.getNewStatus(oldMergeRequest.isUserReviewer()));
|
||||
|
||||
final boolean isChangedMr = !oldMergeRequest.getUpdatedDate().equals(mergeRequest.getUpdatedDate())
|
||||
|| oldMergeRequest.isConflict() != mergeRequest.isConflict();
|
||||
final boolean isChangedMr = !oldMergeRequest.getUpdatedDate().equals(mergeRequest.getUpdatedDate()) || oldMergeRequest.isConflict() != mergeRequest.isConflict();
|
||||
final boolean isChangedLinkedEntity = reviewerChanged.isChanged() || assigneeChanged.isChanged();
|
||||
|
||||
if (isChangedMr || isChangedLinkedEntity) {
|
||||
final MergeRequest savedMergeRequest = repository.save(mergeRequest);
|
||||
|
||||
if (oldMergeRequest.isNotification()) {
|
||||
final Project project = projectService.getByIdOrThrow(mergeRequest.getProjectId());
|
||||
|
||||
if (isChangedMr) {
|
||||
notifyAboutStatus(oldMergeRequest, savedMergeRequest, project);
|
||||
notifyAboutConflict(oldMergeRequest, savedMergeRequest, project);
|
||||
notifyAboutUpdate(oldMergeRequest, savedMergeRequest, project);
|
||||
notifyAboutStatus(oldMergeRequest, mergeRequest, project);
|
||||
notifyAboutConflict(oldMergeRequest, mergeRequest, project);
|
||||
notifyAboutUpdate(oldMergeRequest, mergeRequest, project);
|
||||
}
|
||||
|
||||
if (isChangedLinkedEntity) {
|
||||
notifyReviewer(reviewerChanged, savedMergeRequest, project);
|
||||
notifyAssignee(assigneeChanged, savedMergeRequest, project);
|
||||
notifyReviewer(reviewerChanged, mergeRequest, project);
|
||||
notifyAssignee(assigneeChanged, mergeRequest, project);
|
||||
}
|
||||
}
|
||||
return savedMergeRequest;
|
||||
return repository.save(mergeRequest);
|
||||
}
|
||||
|
||||
return oldMergeRequest;
|
||||
|
Loading…
Reference in New Issue
Block a user