Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

102: Setting summary does not update the preview message #157

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -41,7 +41,7 @@
private final String censusRef;
private final Map<String, String> blockingLabels;

private final Pattern metadataComments = Pattern.compile("<!-- (add|remove) contributor");
private final Pattern metadataComments = Pattern.compile("<!-- (?:(add|remove) contributor)|(?:summary: ')");
private final Logger log = Logger.getLogger("org.openjdk.skara.bots.pr");

CheckWorkItem(PullRequest pr, HostedRepository censusRepo, String censusRef, Map<String, String> blockingLabels, Consumer<RuntimeException> errorHandler) {
@@ -86,19 +86,20 @@ void simple(TestInfo testInfo) throws IOException {
// The bot should reply with a success message
assertLastCommentContains(pr,"Setting summary to");

// Approve it as another user
var approvalPr = integrator.getPullRequest(pr.getId());
approvalPr.addReview(Review.Verdict.APPROVED, "Approved");
TestBotRunner.runPeriodicItems(prBot);
TestBotRunner.runPeriodicItems(prBot);

// Now update it
pr.addComment("/summary Third time is surely the charm");
TestBotRunner.runPeriodicItems(prBot);
TestBotRunner.runPeriodicItems(prBot);

// The bot should reply with a success message
assertLastCommentContains(pr,"Updating existing summary");

// Approve it as another user
var approvalPr = integrator.getPullRequest(pr.getId());
approvalPr.addReview(Review.Verdict.APPROVED, "Approved");
TestBotRunner.runPeriodicItems(prBot);
TestBotRunner.runPeriodicItems(prBot);

// The commit message preview should contain the final summary
var summaryLine = pr.getComments().stream()
.flatMap(comment -> comment.body().lines())
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.