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

pr: improve message for unexpected merge commits #693

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -702,12 +702,13 @@ private void addMergeCommitWarningComment(List<Comment> comments) {
return;
}

var message = "@" + pr.author().userName() + " This pull request looks like it contains a merge commit that " +
"brings in commits from outside of this repository. If you want these commits to be preserved " +
"when you integrate, you will need to make a 'merge-style' pull request. To do this, change the " +
"title of this pull request to `Merge <project>:<branch>`, where `<project>` is the name of another " +
"project in the OpenJDK organization. For example: `Merge jdk:master`." +
"\n" + mergeCommitWarningMarker;
var message = "⚠️ @" + pr.author().userName() +
" This pull request contains merges that bring in commits not present in the target repository." +
" Since this is not a \"merge style\" pull request, these changes will be squashed when this pull request in integrated." +
" If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change" +
" the title of this pull request to `Merge <project>:<branch>` where `<project>` is the name of another project in the" +
" [OpenJDK organization](https://github.com/openjdk) (for example `Merge jdk:master`).\n" +
mergeCommitWarningMarker;
pr.addComment(message);
}

@@ -1064,7 +1064,7 @@ void foreignCommitWarning(TestInfo testInfo) throws IOException {
TestBotRunner.runPeriodicItems(mergeBot);

// There should be a warning
assertLastCommentContains(pr, "This pull request looks like it contains a merge commit");
assertLastCommentContains(pr, "This pull request contains merges that brings in commits not present");
Copy link
Member

@rwestberg rwestberg Jul 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assertLastCommentContains(pr, "This pull request contains merges that brings in commits not present");
assertLastCommentContains(pr, "This pull request contains merges that bring in commits not present");

}
}
}