diff --git a/README.adoc b/README.adoc index d279945..c1861c2 100644 --- a/README.adoc +++ b/README.adoc @@ -98,13 +98,10 @@ See below for details about each section. [[participants-triage]] === Triage -If the `triage` section is present, you will get notified when new issues are created -and need to be routed to the right person/team. +If the `triage` section is present, you will get notified about issues that haven't been assigned an area yet. -Addressing these notifications generally involves removing the `triage/needs-triage` label, -adding the correct `+area/*+` labels, and optionally pinging the relevant maintainers -(though the https://github.com/quarkusio/quarkus-github-bot#triage-issues[Quarkus GitHub Bot should generally take care of that part] -once you add `+area/*+` labels). +Please add an area label, remove the "needs triage" (e.g. `triage/needs-triage`) label, +and ping the relevant maintainers if necessary. Of course, some more discussion might be necessary before that, and that's fine: issues that don't change will reappear in another notification, a few days later. @@ -141,30 +138,17 @@ that may be stalled and require intervention from maintainers or reporters. Issues in "maintenance" notifications will be split in three categories: Feedback Needed:: -These issues have the `triage/needs-reproducer` label, -and it looks like the Quarkus team was the last to comment on the issue, -quite some time ago. +Issues with missing reproducer/information. + -Depending on the actual content of the issue, you might want to: -+ -* send a (gentle!) reminder to the reporter that we need feedback (a reproducer, more information, ...) before we can do anything. -* or, if it's really been too long, close the issue because we cannot work on it. +Please ping the reporter, or close the issue if it's taking too long. Feedback Provided:: -These issues have the `triage/needs-reproducer` label, -and it looks like someone who is not from the Quarkus team was the last to comment on the issue, -quite some time ago. +Issues with newly provided reproducer/information. + -There might be feedback (a reproducer, more information, ...) there, -in which case you might want to remove the `triage/needs-reproducer` label -and have a closer look. +Please have a closer look, possibly remove the "needs feedback" (e.g. `triage/needs-reproducer`) label, and plan further work. Stale:: -These issues have not been updated for a very long time. -+ -Depending on the actual content of the issue, you might want to: +Issues last updated a long time ago. + -* prioritize the issue and work on it soon; -* or send a reminder to someone you've been waiting on; -* or close the issue because it's no longer relevant. +Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... Of course, in every situation, simply continuing the conversation, pinging someone, or even doing nothing at all are perfectly acceptable responses: @@ -228,12 +212,9 @@ core contributors who spend significant time working on GitHub issues. If you don't already know what this section is about, you probably don't want to use it. -If the `stewardship` section is present, you will get notified about issues that just became stale, -across the whole project, without any consideration for the labels assigned to those issues. +If the `stewardship` section is present, you will get notified about Issues across all areas last updated a long time ago. -Depending on the actual content of the issue, you might want to simply continue the conversation, -ping someone, close the issue, or even do nothing at all: -it's all up to you, and issues that don't change will reappear in another notification, a few days later. +Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... NOTE: Notifications to stewards are sent independently of notifications to maintainers, so that the work of maintainers won't be affected by the work of stewards. diff --git a/src/main/java/io/quarkus/github/lottery/LotteryService.java b/src/main/java/io/quarkus/github/lottery/LotteryService.java index 8ad8b00..5a158ee 100644 --- a/src/main/java/io/quarkus/github/lottery/LotteryService.java +++ b/src/main/java/io/quarkus/github/lottery/LotteryService.java @@ -7,6 +7,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; import java.util.Optional; @@ -16,13 +17,13 @@ import io.quarkus.github.lottery.config.LotteryConfig; import io.quarkus.github.lottery.draw.DrawRef; import io.quarkus.github.lottery.draw.Lottery; -import io.quarkus.github.lottery.draw.Participant; -import io.quarkus.github.lottery.history.LotteryHistory; import io.quarkus.github.lottery.draw.LotteryReport; +import io.quarkus.github.lottery.draw.Participant; import io.quarkus.github.lottery.github.GitHubRepository; import io.quarkus.github.lottery.github.GitHubRepositoryRef; import io.quarkus.github.lottery.github.GitHubService; import io.quarkus.github.lottery.history.HistoryService; +import io.quarkus.github.lottery.history.LotteryHistory; import io.quarkus.github.lottery.notification.NotificationService; import io.quarkus.github.lottery.notification.Notifier; import io.quarkus.logging.Log; @@ -89,7 +90,7 @@ private void doDrawForRepository(GitHubRepository repo, LotteryConfig lotteryCon lottery.draw(repo, history); - var sent = notifyParticipants(notifier, participants); + var sent = notifyParticipants(lotteryConfig, notifier, participants); if (!sent.isEmpty()) { try { historyService.append(drawRef, lotteryConfig, sent); @@ -130,10 +131,12 @@ private List registerParticipants(DrawRef drawRef, Lottery lottery, return participants; } - private List notifyParticipants(Notifier notifier, List participants) { + private List notifyParticipants(LotteryConfig lotteryConfig, + Notifier notifier, List participants) { List sent = new ArrayList<>(); for (var participant : participants) { - var report = participant.report(); + var report = participant.report(lotteryConfig.buckets().triage().label(), + new LinkedHashSet<>(lotteryConfig.buckets().maintenance().feedback().labels())); try { Log.debugf("Sending report: %s", report); notifier.send(report); diff --git a/src/main/java/io/quarkus/github/lottery/draw/LotteryReport.java b/src/main/java/io/quarkus/github/lottery/draw/LotteryReport.java index ef640cf..cd63b6f 100644 --- a/src/main/java/io/quarkus/github/lottery/draw/LotteryReport.java +++ b/src/main/java/io/quarkus/github/lottery/draw/LotteryReport.java @@ -4,6 +4,7 @@ import java.time.ZoneId; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -17,6 +18,7 @@ public record LotteryReport( DrawRef drawRef, String username, Optional timezone, + Config config, Optional triage, Optional feedbackNeeded, Optional feedbackProvided, @@ -33,6 +35,12 @@ public boolean hasContent() { return buckets().anyMatch(Bucket::hasContent); } + public record Config( + String triageLabel, + Set feedbackLabels, + Set maintenanceLabels) { + } + public record Bucket( List issues) { diff --git a/src/main/java/io/quarkus/github/lottery/draw/Participant.java b/src/main/java/io/quarkus/github/lottery/draw/Participant.java index 1f8fb4a..eef5344 100644 --- a/src/main/java/io/quarkus/github/lottery/draw/Participant.java +++ b/src/main/java/io/quarkus/github/lottery/draw/Participant.java @@ -77,8 +77,12 @@ public void participate(Lottery lottery) { stewardship.ifPresent(lottery.stewardship()::participate); } - public LotteryReport report() { + public LotteryReport report(String triageLabel, Set feedbackLabels) { return new LotteryReport(drawRef, username, timezone, + new LotteryReport.Config( + triageLabel, + feedbackLabels, + maintenance.map(m -> m.labels).orElseGet(Set::of)), triage.map(Participation::issues).map(LotteryReport.Bucket::new), maintenance.flatMap(m -> m.feedbackNeeded).map(Participation::issues).map(LotteryReport.Bucket::new), maintenance.flatMap(m -> m.feedbackProvided).map(Participation::issues).map(LotteryReport.Bucket::new), diff --git a/src/main/java/io/quarkus/github/lottery/message/MessageFormatter.java b/src/main/java/io/quarkus/github/lottery/message/MessageFormatter.java index 0def485..ca9eda6 100644 --- a/src/main/java/io/quarkus/github/lottery/message/MessageFormatter.java +++ b/src/main/java/io/quarkus/github/lottery/message/MessageFormatter.java @@ -1,7 +1,9 @@ package io.quarkus.github.lottery.message; import java.time.temporal.Temporal; +import java.util.Collection; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import jakarta.enterprise.context.ApplicationScoped; @@ -28,6 +30,9 @@ public class MessageFormatter { private static final String PAYLOAD_BEGIN = ""; + public record Config(String triageLabel, Set feedbackLabels) { + } + @Inject ObjectMapper jsonObjectMapper; @@ -103,6 +108,14 @@ static String repositoryName(DrawRef drawRef) { return drawRef.repositoryRef().repositoryName(); } + static String asMarkdownLabel(String label) { + return "`" + label + "`"; + } + + static String asMarkdownLabel(Collection labels) { + return labels.stream().map(TemplateExtensions::asMarkdownLabel).collect(Collectors.joining("/")); + } + } @TemplateExtension(namespace = "github") diff --git a/src/main/resources/templates/MessageFormatter/notificationBody.md b/src/main/resources/templates/MessageFormatter/notificationBody.md index 6e6846f..242a908 100644 --- a/src/main/resources/templates/MessageFormatter/notificationBody.md +++ b/src/main/resources/templates/MessageFormatter/notificationBody.md @@ -1,25 +1,53 @@ Hey @{report.username}, here's your report for {report.repositoryName} on {report.localDate}. +{#if !report.config.maintenanceLabels.isEmpty} + +Maintenance areas: {report.config.maintenanceLabels.asMarkdownLabel}. +{/if} {#if report.triage.present} # Triage -{#include MessageFormatter/notificationBodyBucketContent bucket=report.triage.get() /} +{#include MessageFormatter/notificationBodyBucketContent bucket=report.triage.get()} + +Issues that haven't been assigned an area yet. Please add an area label, remove the {report.config.triageLabel.asMarkdownLabel} label, optionally ping maintainers. + +{/include} + {/if} {#if report.feedbackNeeded.present} -# Feedback needed (reproducer, information, ...) -{#include MessageFormatter/notificationBodyBucketContent bucket=report.feedbackNeeded.get() /} +# Feedback needed +{#include MessageFormatter/notificationBodyBucketContent bucket=report.feedbackNeeded.get()} + +Issues with missing reproducer/information. Please ping the reporter, or close the issue if it's taking too long. + +{/include} + {/if} {#if report.feedbackProvided.present} -# Feedback provided (reproducer, information, ...) -{#include MessageFormatter/notificationBodyBucketContent bucket=report.feedbackProvided.get() /} +# Feedback provided +{#include MessageFormatter/notificationBodyBucketContent bucket=report.feedbackProvided.get()} + +Issues with newly provided reproducer/information. Please have a closer look, possibly remove the {report.config.feedbackLabels.asMarkdownLabel} label, and plan further work. + +{/include} + {/if} {#if report.stale.present} # Stale -{#include MessageFormatter/notificationBodyBucketContent bucket=report.stale.get() /} +{#include MessageFormatter/notificationBodyBucketContent bucket=report.stale.get()} + +Issues last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... + +{/include} + {/if} {#if report.stewardship.present} # Stewardship -{#include MessageFormatter/notificationBodyBucketContent bucket=report.stewardship.get() /} -{/if} +{#include MessageFormatter/notificationBodyBucketContent bucket=report.stewardship.get()} + +Issues across all areas last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... +{/include} + +{/if} --- If you no longer want to receive these notifications, just close [any issue assigned to you in the notification repository](https://github.com/{notificationRepositoryName}/issues/assigned/@me). Reopening the issue will resume the notifications. diff --git a/src/main/resources/templates/MessageFormatter/notificationBodyBucketContent.md b/src/main/resources/templates/MessageFormatter/notificationBodyBucketContent.md index 4a4810f..4ae7d8f 100644 --- a/src/main/resources/templates/MessageFormatter/notificationBodyBucketContent.md +++ b/src/main/resources/templates/MessageFormatter/notificationBodyBucketContent.md @@ -1,7 +1,9 @@ {@io.quarkus.github.lottery.draw.LotteryReport$Bucket bucket} {#if bucket.issues.isEmpty} + No issues in this category this time. {#else} +{#insert /} {#for issue in bucket.issues} - [#{issue.number}]({issue.url}) {issue.title} {/for} diff --git a/src/test/java/io/quarkus/github/lottery/HistoryServiceTest.java b/src/test/java/io/quarkus/github/lottery/HistoryServiceTest.java index 657f3c6..812cfe8 100644 --- a/src/test/java/io/quarkus/github/lottery/HistoryServiceTest.java +++ b/src/test/java/io/quarkus/github/lottery/HistoryServiceTest.java @@ -2,8 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; diff --git a/src/test/java/io/quarkus/github/lottery/LotterySingleRepositoryTest.java b/src/test/java/io/quarkus/github/lottery/LotterySingleRepositoryTest.java index 9afa19c..521665f 100644 --- a/src/test/java/io/quarkus/github/lottery/LotterySingleRepositoryTest.java +++ b/src/test/java/io/quarkus/github/lottery/LotterySingleRepositoryTest.java @@ -1,6 +1,7 @@ package io.quarkus.github.lottery; import static io.quarkus.github.lottery.util.MockHelper.stubIssueList; +import static io.quarkus.github.lottery.util.MockHelper.stubReportConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -31,8 +32,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import io.quarkus.github.lottery.github.GitHubInstallationRef; -import io.quarkus.github.lottery.github.IssueActionSide; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; @@ -40,9 +39,11 @@ import io.quarkus.github.lottery.config.LotteryConfig; import io.quarkus.github.lottery.draw.DrawRef; import io.quarkus.github.lottery.draw.LotteryReport; +import io.quarkus.github.lottery.github.GitHubInstallationRef; import io.quarkus.github.lottery.github.GitHubRepository; import io.quarkus.github.lottery.github.GitHubRepositoryRef; import io.quarkus.github.lottery.github.GitHubService; +import io.quarkus.github.lottery.github.IssueActionSide; import io.quarkus.github.lottery.history.HistoryService; import io.quarkus.github.lottery.history.LotteryHistory; import io.quarkus.github.lottery.notification.NotificationService; @@ -60,7 +61,7 @@ private static LotteryConfig defaultConfig(List parti new LotteryConfig.Notifications.CreateIssuesConfig("quarkusio/quarkus-lottery-reports")), new LotteryConfig.Buckets( new LotteryConfig.Buckets.Triage( - "needs-triage", + "triage/needs-triage", Duration.ZERO, Duration.ofDays(3)), new LotteryConfig.Buckets.Maintenance( new LotteryConfig.Buckets.Maintenance.Feedback( @@ -284,7 +285,7 @@ void triage() throws IOException { Optional.empty()))); when(repoMock.fetchLotteryConfig()).thenReturn(Optional.of(config)); - when(repoMock.issuesWithLabelLastUpdatedBefore("needs-triage", Set.of(), now)) + when(repoMock.issuesWithLabelLastUpdatedBefore("triage/needs-triage", Set.of(), now)) .thenAnswer(ignored -> stubIssueList(1, 3, 2, 4).stream()); mockNotifiable("yrodiere", ZoneOffset.UTC); @@ -296,6 +297,7 @@ void triage() throws IOException { lotteryService.draw(); verify(notifierMock).send(new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3, 2))), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty())); @@ -325,7 +327,7 @@ void triage_issueAlreadyHasNonTimedOutNotification() throws IOException { Optional.empty()))); when(repoMock.fetchLotteryConfig()).thenReturn(Optional.of(config)); - when(repoMock.issuesWithLabelLastUpdatedBefore("needs-triage", Set.of(), now)) + when(repoMock.issuesWithLabelLastUpdatedBefore("triage/needs-triage", Set.of(), now)) .thenAnswer(ignored -> stubIssueList(1, 3, 2, 4).stream()); mockNotifiable("yrodiere", ZoneOffset.UTC); @@ -340,6 +342,7 @@ void triage_issueAlreadyHasNonTimedOutNotification() throws IOException { // Since the last notification for issue with number 3 didn't time out yet, // it will be skipped and we'll notify about another issue. verify(notifierMock).send(new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 2, 4))), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty())); @@ -410,6 +413,7 @@ void maintenance() throws IOException { lotteryService.draw(); verify(notifierMock).send(new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(101, 401, 102, 402))), Optional.of(new LotteryReport.Bucket(stubIssueList(201, 501))), @@ -489,6 +493,7 @@ void maintenance_issueAlreadyHasTimedOutNotification() throws IOException { // Since the last notification for issues with number 401, 201, 302 didn't time out yet, // they will be skipped and we'll notify about the next issues instead. verify(notifierMock).send(new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(101, 402, 102, 403))), Optional.of(new LotteryReport.Bucket(stubIssueList(202, 501))), @@ -534,6 +539,7 @@ void stewardship() throws IOException { lotteryService.draw(); verify(notifierMock).send(new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3, 2))))); @@ -578,6 +584,7 @@ void stewardship_issueAlreadyHasNonTimedOutNotification() throws IOException { // Since the last notification for issue with number 3 didn't time out yet, // it will be skipped and we'll notify about another issue. verify(notifierMock).send(new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 2, 4))))); @@ -651,6 +658,7 @@ void stewardship_doesNotAffectMaintenance() throws IOException { lotteryService.draw(); verify(notifierMock).send(new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(401, 402, 403, 404))), Optional.of(new LotteryReport.Bucket(stubIssueList(501, 502))), @@ -659,6 +667,7 @@ void stewardship_doesNotAffectMaintenance() throws IOException { Optional.empty())); verify(notifierMock).send(new LotteryReport(drawRef, "gsmet", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), @@ -706,7 +715,7 @@ void multiParticipants_evenSpread() throws IOException { Optional.empty()))); when(repoMock.fetchLotteryConfig()).thenReturn(Optional.of(config)); - when(repoMock.issuesWithLabelLastUpdatedBefore("needs-triage", Set.of(), now)) + when(repoMock.issuesWithLabelLastUpdatedBefore("triage/needs-triage", Set.of(), now)) .thenAnswer(ignored -> stubIssueList(1, 3, 2, 4).stream()); mockNotifiable("yrodiere", ZoneOffset.UTC); diff --git a/src/test/java/io/quarkus/github/lottery/MessageFormatterTest.java b/src/test/java/io/quarkus/github/lottery/MessageFormatterTest.java index b7af66a..766b9cc 100644 --- a/src/test/java/io/quarkus/github/lottery/MessageFormatterTest.java +++ b/src/test/java/io/quarkus/github/lottery/MessageFormatterTest.java @@ -1,6 +1,7 @@ package io.quarkus.github.lottery; import static io.quarkus.github.lottery.util.MockHelper.stubIssueList; +import static io.quarkus.github.lottery.util.MockHelper.stubReportConfig; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; @@ -16,11 +17,11 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import io.quarkus.github.lottery.github.GitHubInstallationRef; import org.mockito.junit.jupiter.MockitoExtension; import io.quarkus.github.lottery.draw.DrawRef; import io.quarkus.github.lottery.draw.LotteryReport; +import io.quarkus.github.lottery.github.GitHubInstallationRef; import io.quarkus.github.lottery.github.GitHubRepositoryRef; import io.quarkus.github.lottery.message.MessageFormatter; import io.quarkus.test.junit.QuarkusTest; @@ -71,6 +72,7 @@ void formatNotificationTopicText() { @Test void formatNotificationTopicSuffixText() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); assertThat(messageFormatter.formatNotificationTopicSuffixText(lotteryReport)) @@ -80,6 +82,7 @@ void formatNotificationTopicSuffixText() { @Test void formatNotificationTopicSuffixText_exoticTimezone() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.of(ZoneId.of("America/Los_Angeles")), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); assertThat(messageFormatter.formatNotificationTopicSuffixText(lotteryReport)) @@ -89,6 +92,7 @@ void formatNotificationTopicSuffixText_exoticTimezone() { @Test void formatNotificationBodyMarkdown_triage_empty() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(List.of())), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); @@ -98,6 +102,7 @@ void formatNotificationBodyMarkdown_triage_empty() { Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. # Triage + No issues in this category this time. --- @@ -110,6 +115,7 @@ void formatNotificationBodyMarkdown_triage_empty() { @Test void formatNotificationBodyMarkdown_triage_simple() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3))), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); @@ -119,6 +125,9 @@ void formatNotificationBodyMarkdown_triage_simple() { Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. # Triage + + Issues that haven't been assigned an area yet. Please add an area label, remove the `triage/needs-triage` label, optionally ping maintainers. + - [#1](http://github.com/quarkusio/quarkus/issues/1) Title for issue 1 - [#3](http://github.com/quarkusio/quarkus/issues/3) Title for issue 3 @@ -132,6 +141,7 @@ void formatNotificationBodyMarkdown_triage_simple() { @Test void formatNotificationBodyMarkdown_maintenance_empty() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(List.of())), Optional.of(new LotteryReport.Bucket(List.of())), @@ -142,11 +152,18 @@ void formatNotificationBodyMarkdown_maintenance_empty() { """ Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. - # Feedback needed (reproducer, information, ...) + Maintenance areas: `area/hibernate-orm`/`area/hibernate-search`. + + # Feedback needed + No issues in this category this time. - # Feedback provided (reproducer, information, ...) + + # Feedback provided + No issues in this category this time. + # Stale + No issues in this category this time. --- @@ -159,6 +176,7 @@ void formatNotificationBodyMarkdown_maintenance_empty() { @Test void formatNotificationBodyMarkdown_maintenance_someEmpty() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3))), Optional.of(new LotteryReport.Bucket(List.of())), @@ -169,12 +187,21 @@ void formatNotificationBodyMarkdown_maintenance_someEmpty() { """ Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. - # Feedback needed (reproducer, information, ...) + Maintenance areas: `area/hibernate-orm`/`area/hibernate-search`. + + # Feedback needed + + Issues with missing reproducer/information. Please ping the reporter, or close the issue if it's taking too long. + - [#1](http://github.com/quarkusio/quarkus/issues/1) Title for issue 1 - [#3](http://github.com/quarkusio/quarkus/issues/3) Title for issue 3 - # Feedback provided (reproducer, information, ...) + + # Feedback provided + No issues in this category this time. + # Stale + No issues in this category this time. --- @@ -187,6 +214,7 @@ void formatNotificationBodyMarkdown_maintenance_someEmpty() { @Test void formatNotificationBodyMarkdown_maintenance_simple() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3))), Optional.of(new LotteryReport.Bucket(stubIssueList(4, 5))), @@ -197,13 +225,26 @@ void formatNotificationBodyMarkdown_maintenance_simple() { """ Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. - # Feedback needed (reproducer, information, ...) + Maintenance areas: `area/hibernate-orm`/`area/hibernate-search`. + + # Feedback needed + + Issues with missing reproducer/information. Please ping the reporter, or close the issue if it's taking too long. + - [#1](http://github.com/quarkusio/quarkus/issues/1) Title for issue 1 - [#3](http://github.com/quarkusio/quarkus/issues/3) Title for issue 3 - # Feedback provided (reproducer, information, ...) + + # Feedback provided + + Issues with newly provided reproducer/information. Please have a closer look, possibly remove the `triage/needs-reproducer`/`triage/needs-feedback` label, and plan further work. + - [#4](http://github.com/quarkusio/quarkus/issues/4) Title for issue 4 - [#5](http://github.com/quarkusio/quarkus/issues/5) Title for issue 5 + # Stale + + Issues last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... + - [#2](http://github.com/quarkusio/quarkus/issues/2) Title for issue 2 - [#7](http://github.com/quarkusio/quarkus/issues/7) Title for issue 7 @@ -217,6 +258,7 @@ void formatNotificationBodyMarkdown_maintenance_simple() { @Test void formatNotificationBodyMarkdown_stewardship_empty() { var lotteryReport = new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(new LotteryReport.Bucket(List.of()))); @@ -226,6 +268,7 @@ void formatNotificationBodyMarkdown_stewardship_empty() { Hey @geoand, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. # Stewardship + No issues in this category this time. --- @@ -238,6 +281,7 @@ void formatNotificationBodyMarkdown_stewardship_empty() { @Test void formatNotificationBodyMarkdown_stewardship_simple() { var lotteryReport = new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3)))); @@ -247,6 +291,9 @@ void formatNotificationBodyMarkdown_stewardship_simple() { Hey @geoand, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. # Stewardship + + Issues across all areas last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... + - [#1](http://github.com/quarkusio/quarkus/issues/1) Title for issue 1 - [#3](http://github.com/quarkusio/quarkus/issues/3) Title for issue 3 @@ -260,6 +307,7 @@ void formatNotificationBodyMarkdown_stewardship_simple() { @Test void formatNotificationBodyMarkdown_all() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3))), Optional.of(new LotteryReport.Bucket(stubIssueList(4, 5))), Optional.of(new LotteryReport.Bucket(stubIssueList(2, 7))), @@ -271,18 +319,37 @@ void formatNotificationBodyMarkdown_all() { Hey @yrodiere, here's your report for quarkusio/quarkus on 2017-11-06T06:00:00Z. # Triage + + Issues that haven't been assigned an area yet. Please add an area label, remove the `triage/needs-triage` label, optionally ping maintainers. + - [#1](http://github.com/quarkusio/quarkus/issues/1) Title for issue 1 - [#3](http://github.com/quarkusio/quarkus/issues/3) Title for issue 3 - # Feedback needed (reproducer, information, ...) + + # Feedback needed + + Issues with missing reproducer/information. Please ping the reporter, or close the issue if it's taking too long. + - [#4](http://github.com/quarkusio/quarkus/issues/4) Title for issue 4 - [#5](http://github.com/quarkusio/quarkus/issues/5) Title for issue 5 - # Feedback provided (reproducer, information, ...) + + # Feedback provided + + Issues with newly provided reproducer/information. Please have a closer look, possibly remove the `triage/needs-reproducer`/`triage/needs-feedback` label, and plan further work. + - [#2](http://github.com/quarkusio/quarkus/issues/2) Title for issue 2 - [#7](http://github.com/quarkusio/quarkus/issues/7) Title for issue 7 + # Stale + + Issues last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... + - [#8](http://github.com/quarkusio/quarkus/issues/8) Title for issue 8 - [#9](http://github.com/quarkusio/quarkus/issues/9) Title for issue 9 + # Stewardship + + Issues across all areas last updated a long time ago. Please have a closer look, re-prioritize, ping someone, label as "on ice", close the issue, ... + - [#10](http://github.com/quarkusio/quarkus/issues/10) Title for issue 10 - [#11](http://github.com/quarkusio/quarkus/issues/11) Title for issue 11 @@ -296,6 +363,7 @@ void formatNotificationBodyMarkdown_all() { @Test void formatNotificationBodyMarkdown_exoticTimezone() { var lotteryReport = new LotteryReport(drawRef, "yrodiere", Optional.of(ZoneId.of("America/Los_Angeles")), + stubReportConfig(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); diff --git a/src/test/java/io/quarkus/github/lottery/NotificationServiceTest.java b/src/test/java/io/quarkus/github/lottery/NotificationServiceTest.java index f0c3f01..7f3dcea 100644 --- a/src/test/java/io/quarkus/github/lottery/NotificationServiceTest.java +++ b/src/test/java/io/quarkus/github/lottery/NotificationServiceTest.java @@ -1,6 +1,7 @@ package io.quarkus.github.lottery; import static io.quarkus.github.lottery.util.MockHelper.stubIssueList; +import static io.quarkus.github.lottery.util.MockHelper.stubReportConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -117,6 +118,7 @@ void send() throws IOException { verifyNoMoreInteractions(gitHubServiceMock, notificationRepoMock, messageFormatterMock); var lotteryReport1 = new LotteryReport(drawRef, "yrodiere", Optional.empty(), + stubReportConfig("area/hibernate-orm", "area/hibernate-search"), Optional.of(new LotteryReport.Bucket(stubIssueList(1, 3))), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); @@ -133,6 +135,7 @@ void send() throws IOException { verifyNoMoreInteractions(gitHubServiceMock, notificationRepoMock, messageFormatterMock); var lotteryReport2 = new LotteryReport(drawRef, "gsmet", Optional.empty(), + stubReportConfig("area/hibernate-validator"), Optional.empty(), Optional.of(new LotteryReport.Bucket(stubIssueList(4, 5))), Optional.of(new LotteryReport.Bucket(stubIssueList(7, 8))), @@ -151,6 +154,7 @@ void send() throws IOException { verifyNoMoreInteractions(gitHubServiceMock, notificationRepoMock, messageFormatterMock); var lotteryReport3 = new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList(11, 12))), Optional.empty(), Optional.empty(), @@ -169,6 +173,7 @@ void send() throws IOException { verifyNoMoreInteractions(gitHubServiceMock, notificationRepoMock, messageFormatterMock); var lotteryReport4 = new LotteryReport(drawRef, "jsmith", Optional.empty(), + stubReportConfig(), Optional.of(new LotteryReport.Bucket(stubIssueList())), Optional.empty(), Optional.empty(), diff --git a/src/test/java/io/quarkus/github/lottery/draw/LotteryReportTest.java b/src/test/java/io/quarkus/github/lottery/draw/LotteryReportTest.java index 845021e..3371e33 100644 --- a/src/test/java/io/quarkus/github/lottery/draw/LotteryReportTest.java +++ b/src/test/java/io/quarkus/github/lottery/draw/LotteryReportTest.java @@ -1,6 +1,7 @@ package io.quarkus.github.lottery.draw; import static io.quarkus.github.lottery.util.MockHelper.stubIssueList; +import static io.quarkus.github.lottery.util.MockHelper.stubReportConfig; import static org.assertj.core.api.Assertions.assertThat; import java.time.LocalDateTime; @@ -36,6 +37,7 @@ void setup() { void buckets() { List buckets = new ArrayList<>(); var report = new LotteryReport(drawRef, "geoand", Optional.empty(), + stubReportConfig(), newBucket(buckets), newBucket(buckets), newBucket(buckets), diff --git a/src/test/java/io/quarkus/github/lottery/util/MockHelper.java b/src/test/java/io/quarkus/github/lottery/util/MockHelper.java index 9a56fc4..92ea906 100644 --- a/src/test/java/io/quarkus/github/lottery/util/MockHelper.java +++ b/src/test/java/io/quarkus/github/lottery/util/MockHelper.java @@ -9,9 +9,11 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; import java.util.stream.IntStream; +import io.quarkus.github.lottery.draw.LotteryReport; import org.kohsuke.github.GHIssue; import org.kohsuke.github.GHIssueComment; import org.kohsuke.github.GHIssueEvent; @@ -63,6 +65,12 @@ private static Issue stubIssue(int number) { return new Issue(number, "Title for issue " + number, url(number)); } + public static LotteryReport.Config stubReportConfig(String... maintenanceLabels) { + return new LotteryReport.Config("triage/needs-triage", + new LinkedHashSet<>(List.of("triage/needs-reproducer", "triage/needs-feedback")), + new LinkedHashSet<>(List.of(maintenanceLabels))); + } + public static GHIssue mockIssueForLottery(GitHubMockContext context, int number) throws IOException { GHIssue mock = context.issue(10000L + number);