Уведомление об изменении ревьюверов
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
625c59f163
commit
0e1e7c6cad
@ -68,11 +68,7 @@ public class MergeRequestHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (checkNotEmpty(mergeRequest.getReviewers())) {
|
||||
sendGroupNotifyForReviewers(mergeRequest, projectName);
|
||||
} else {
|
||||
sendGroupNotifyAboutNoReviewers(mergeRequest, projectName);
|
||||
}
|
||||
sendGroupNotifyForReviewers(mergeRequest, projectName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,6 +112,9 @@ public class MergeRequestHandler {
|
||||
if (newConflict) {
|
||||
sendGroupNotifyAboutConflict(newMergeRequest, project.getName());
|
||||
}
|
||||
if (reviewerChanged.isChanged()) {
|
||||
sendGroupNotifyForReviewers(newMergeRequest, project.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -156,22 +155,26 @@ public class MergeRequestHandler {
|
||||
}
|
||||
|
||||
private void sendGroupNotifyForReviewers(MergeRequest mergeRequest, String projectName) {
|
||||
final Map<Long, String> reviewerTelegramUsernames = personService.getTelegramUsernamesByPersonIds(mergeRequest.getReviewers().stream().map(Person::getId).collect(Collectors.toSet()));
|
||||
if (!reviewerTelegramUsernames.isEmpty()) {
|
||||
notifyService.send(
|
||||
NewMergeRequestGroupNotify.builder()
|
||||
.mrId(mergeRequest.getId())
|
||||
.title(mergeRequest.getTitle())
|
||||
.url(mergeRequest.getWebUrl())
|
||||
.author(mergeRequest.getAuthor().getName())
|
||||
.reviewerTelegramUsernames(reviewerTelegramUsernames)
|
||||
.milestone(mergeRequest.getMilestone())
|
||||
.projectName(projectName)
|
||||
.targetBranch(mergeRequest.getTargetBranch())
|
||||
.sourceBranch(mergeRequest.getSourceBranch())
|
||||
.description(mergeRequest.getDescription())
|
||||
.build()
|
||||
);
|
||||
if (checkNotEmpty(mergeRequest.getReviewers())) {
|
||||
final Map<Long, String> reviewerTelegramUsernames = personService.getTelegramUsernamesByPersonIds(mergeRequest.getReviewers().stream().map(Person::getId).collect(Collectors.toSet()));
|
||||
if (!reviewerTelegramUsernames.isEmpty()) {
|
||||
notifyService.send(
|
||||
NewMergeRequestGroupNotify.builder()
|
||||
.mrId(mergeRequest.getId())
|
||||
.title(mergeRequest.getTitle())
|
||||
.url(mergeRequest.getWebUrl())
|
||||
.author(mergeRequest.getAuthor().getName())
|
||||
.reviewerTelegramUsernames(reviewerTelegramUsernames)
|
||||
.milestone(mergeRequest.getMilestone())
|
||||
.projectName(projectName)
|
||||
.targetBranch(mergeRequest.getTargetBranch())
|
||||
.sourceBranch(mergeRequest.getSourceBranch())
|
||||
.description(mergeRequest.getDescription())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
sendGroupNotifyAboutNoReviewers(mergeRequest, projectName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user