|
15 | 15 | import java.io.UnsupportedEncodingException;
|
16 | 16 | import java.util.Map;
|
17 | 17 | import java.util.Set;
|
| 18 | +import java.util.List; |
18 | 19 | import java.util.logging.Logger;
|
19 | 20 | import java.util.regex.Matcher;
|
20 | 21 |
|
@@ -440,6 +441,54 @@ public String resolve(PullRequest pullRequest, PrnfbPullRequestAction pullReques
|
440 | 441 | Map<PrnfbVariable, Supplier<String>> variables, ClientKeyStore clientKeyStore, boolean shouldAcceptAnyCertificate) {
|
441 | 442 | return pullRequest.getTitle();
|
442 | 443 | }
|
| 444 | + }), PULL_REQUEST_REVIEWERS(new Resolver() { |
| 445 | + @Override |
| 446 | + public String resolve(PullRequest pullRequest, PrnfbPullRequestAction pullRequestAction, |
| 447 | + ApplicationUser applicationUser, RepositoryService repositoryService, |
| 448 | + ApplicationPropertiesService propertiesService, PrnfbNotification prnfbNotification, |
| 449 | + Map<PrnfbVariable, Supplier<String>> variables, ClientKeyStore clientKeyStore, boolean shouldAcceptAnyCertificate) { |
| 450 | + List<PullRequestParticipant> slist = newArrayList(pullRequest.getReviewers()); |
| 451 | + StringBuilder rString = new StringBuilder(); |
| 452 | + |
| 453 | + String sep = ","; |
| 454 | + for (PullRequestParticipant each : slist) { |
| 455 | + rString.append(sep).append(each.getUser().getDisplayName()); |
| 456 | + } |
| 457 | + |
| 458 | + return rString.substring(1); |
| 459 | + } |
| 460 | + }), PULL_REQUEST_REVIEWERS_ID(new Resolver() { |
| 461 | + @Override |
| 462 | + public String resolve(PullRequest pullRequest, PrnfbPullRequestAction pullRequestAction, |
| 463 | + ApplicationUser applicationUser, RepositoryService repositoryService, |
| 464 | + ApplicationPropertiesService propertiesService, PrnfbNotification prnfbNotification, |
| 465 | + Map<PrnfbVariable, Supplier<String>> variables, ClientKeyStore clientKeyStore, boolean shouldAcceptAnyCertificate) { |
| 466 | + List<PullRequestParticipant> slist = newArrayList(pullRequest.getReviewers()); |
| 467 | + StringBuilder rString = new StringBuilder(); |
| 468 | + |
| 469 | + String sep = ","; |
| 470 | + for (PullRequestParticipant each : slist) { |
| 471 | + rString.append(sep).append(Integer.toString(each.getUser().getId())); |
| 472 | + } |
| 473 | + |
| 474 | + return rString.substring(1); |
| 475 | + } |
| 476 | + }), PULL_REQUEST_REVIEWERS_SLUG(new Resolver() { |
| 477 | + @Override |
| 478 | + public String resolve(PullRequest pullRequest, PrnfbPullRequestAction pullRequestAction, |
| 479 | + ApplicationUser applicationUser, RepositoryService repositoryService, |
| 480 | + ApplicationPropertiesService propertiesService, PrnfbNotification prnfbNotification, |
| 481 | + Map<PrnfbVariable, Supplier<String>> variables, ClientKeyStore clientKeyStore, boolean shouldAcceptAnyCertificate) { |
| 482 | + List<PullRequestParticipant> slist = newArrayList(pullRequest.getReviewers()); |
| 483 | + StringBuilder rString = new StringBuilder(); |
| 484 | + |
| 485 | + String sep = ","; |
| 486 | + for (PullRequestParticipant each : slist) { |
| 487 | + rString.append(sep).append(each.getUser().getSlug()); |
| 488 | + } |
| 489 | + |
| 490 | + return rString.substring(1); |
| 491 | + } |
443 | 492 | }), PULL_REQUEST_REVIEWERS_APPROVED_COUNT(new Resolver() {
|
444 | 493 | @Override
|
445 | 494 | public String resolve(PullRequest pullRequest, PrnfbPullRequestAction pullRequestAction,
|
|
0 commit comments