Skip to content

Commit

Permalink
Merge pull request #440 from gsmet/backport-prs
Browse files Browse the repository at this point in the history
Handle prefixing backport PRs correctly
  • Loading branch information
gsmet authored Apr 16, 2024
2 parents 0e64c18 + c015858 commit a8e5866
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/quarkus/bot/util/GHPullRequests.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public final class GHPullRequests {

private static final Pattern CLEAN_VERSION_PATTERN = Pattern.compile("^\\[?\\(?[0-9]+\\.[0-9]+\\]?\\)?[ -]*");
private static final Pattern CLEAN_VERSION_PATTERN = Pattern.compile("^\\[?\\(?[0-9]+\\.[0-9]+\\]?\\)?(?!\\.)[ -]*");

public static boolean hasLabel(GHPullRequest pullRequest, String labelName) {
for (GHLabel label : pullRequest.getLabels()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void testNormalizeTitle() {
assertThat(GHPullRequests.normalizeTitle("My PR", "3.10")).isEqualTo(("[3.10] My PR"));
assertThat(GHPullRequests.normalizeTitle("My PR", "main")).isEqualTo(("My PR"));
assertThat(GHPullRequests.normalizeTitle("(3.8) My PR", "main")).isEqualTo(("(3.8) My PR"));
assertThat(GHPullRequests.normalizeTitle("3.8.4 backports 1", "3.8")).isEqualTo(("[3.8] 3.8.4 backports 1"));
assertThat(GHPullRequests.normalizeTitle("(3.10) My PR", "3.10")).isEqualTo(("[3.10] My PR"));
assertThat(GHPullRequests.normalizeTitle("[3.8] My PR", "main")).isEqualTo(("[3.8] My PR"));
assertThat(GHPullRequests.normalizeTitle("[3.8] My PR", "3.8")).isEqualTo(("[3.8] My PR"));
Expand Down

0 comments on commit a8e5866

Please sign in to comment.