Исправление уведомления об обновлении 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.setUserAssignee(assigneeChanged.getNewStatus(oldMergeRequest.isUserAssignee()));
|
||||||
mergeRequest.setUserReviewer(reviewerChanged.getNewStatus(oldMergeRequest.isUserReviewer()));
|
mergeRequest.setUserReviewer(reviewerChanged.getNewStatus(oldMergeRequest.isUserReviewer()));
|
||||||
|
|
||||||
final boolean isChangedMr = !oldMergeRequest.getUpdatedDate().equals(mergeRequest.getUpdatedDate())
|
final boolean isChangedMr = !oldMergeRequest.getUpdatedDate().equals(mergeRequest.getUpdatedDate()) || oldMergeRequest.isConflict() != mergeRequest.isConflict();
|
||||||
|| oldMergeRequest.isConflict() != mergeRequest.isConflict();
|
|
||||||
final boolean isChangedLinkedEntity = reviewerChanged.isChanged() || assigneeChanged.isChanged();
|
final boolean isChangedLinkedEntity = reviewerChanged.isChanged() || assigneeChanged.isChanged();
|
||||||
|
|
||||||
if (isChangedMr || isChangedLinkedEntity) {
|
if (isChangedMr || isChangedLinkedEntity) {
|
||||||
final MergeRequest savedMergeRequest = repository.save(mergeRequest);
|
|
||||||
|
|
||||||
if (oldMergeRequest.isNotification()) {
|
if (oldMergeRequest.isNotification()) {
|
||||||
final Project project = projectService.getByIdOrThrow(mergeRequest.getProjectId());
|
final Project project = projectService.getByIdOrThrow(mergeRequest.getProjectId());
|
||||||
|
|
||||||
if (isChangedMr) {
|
if (isChangedMr) {
|
||||||
notifyAboutStatus(oldMergeRequest, savedMergeRequest, project);
|
notifyAboutStatus(oldMergeRequest, mergeRequest, project);
|
||||||
notifyAboutConflict(oldMergeRequest, savedMergeRequest, project);
|
notifyAboutConflict(oldMergeRequest, mergeRequest, project);
|
||||||
notifyAboutUpdate(oldMergeRequest, savedMergeRequest, project);
|
notifyAboutUpdate(oldMergeRequest, mergeRequest, project);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isChangedLinkedEntity) {
|
if (isChangedLinkedEntity) {
|
||||||
notifyReviewer(reviewerChanged, savedMergeRequest, project);
|
notifyReviewer(reviewerChanged, mergeRequest, project);
|
||||||
notifyAssignee(assigneeChanged, savedMergeRequest, project);
|
notifyAssignee(assigneeChanged, mergeRequest, project);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return savedMergeRequest;
|
return repository.save(mergeRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
return oldMergeRequest;
|
return oldMergeRequest;
|
||||||
|
Loading…
Reference in New Issue
Block a user