From 81b510877c7c432ed5179c7cbdb682e6ac512868 Mon Sep 17 00:00:00 2001 From: Marek Skacelik Date: Fri, 20 Mar 2026 12:40:11 +0100 Subject: [PATCH] Fix compability with the new JIRA URI domain --- README.md | 2 +- .../wildfly/bot/model/RuntimeConstants.java | 8 +- .../util/PullRequestDescriptionHandler.java | 4 +- .../wildfly/bot/PRAppendingMessageTest.java | 97 +++++++++++++++---- .../java/org/wildfly/bot/PRChecksTest.java | 14 +-- .../org/wildfly/bot/PRDependabotTest.java | 18 ++-- .../wildfly/bot/PRDescriptionCheckTest.java | 25 ++--- .../bot/PRRuleDescriptionCheckTest.java | 6 +- .../org/wildfly/bot/PRRuleNotifyTest.java | 2 +- .../wildfly/bot/PRRuleTitleBodyCheckTest.java | 4 +- .../events/raw_pr_review_template.json | 26 ++--- .../resources/events/raw_pr_template.json | 26 ++--- .../webhooks/valid-pr-review-template.json | 2 +- .../resources/webhooks/valid-pr-template.json | 2 +- wildfly-bot-config-example.yml | 2 +- 15 files changed, 140 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index f3199440..6e61a267 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ wildfly: message: Wrong content of the PR title description: # 3 regexes: - - pattern: JIRA:\s+https://issues.redhat.com/browse/WFLY-\d+|https://issues.redhat.com/browse/WFLY-\d+ + - pattern: JIRA:\s+https://redhat.atlassian.net/browse/WFLY-\d+|https://redhat.atlassian.net/browse/WFLY-\d+ message: The PR description must contain a link to the JIRA issue # 4 emails: # 5 - foo@bar.baz diff --git a/src/main/java/org/wildfly/bot/model/RuntimeConstants.java b/src/main/java/org/wildfly/bot/model/RuntimeConstants.java index 43839b63..7c79d6c8 100644 --- a/src/main/java/org/wildfly/bot/model/RuntimeConstants.java +++ b/src/main/java/org/wildfly/bot/model/RuntimeConstants.java @@ -22,7 +22,13 @@ public class RuntimeConstants { public static final String BOT_JIRA_LINKS_HEADER = "Additional WildFly Issue Links Found:\n"; - public static final String BOT_JIRA_LINK_TEMPLATE = "https://issues.redhat.com/browse/%1$s"; + // Kept for backward compatibility, should be removed when the link stops + // working, for more info see + // https://github.com/wildfly/wildfly-github-bot/issues/238 + @Deprecated + public static final String BOT_JIRA_OLD_LINK_TEMPLATE = "https://issues.redhat.com/browse/%1$s"; + + public static final String BOT_JIRA_LINK_TEMPLATE = "https://redhat.atlassian.net/browse/%1$s"; public static final String BOT_JIRA_LINK_COMMENT_TEMPLATE = String.format("* [%%1$s](%s)\n", BOT_JIRA_LINK_TEMPLATE); diff --git a/src/main/java/org/wildfly/bot/util/PullRequestDescriptionHandler.java b/src/main/java/org/wildfly/bot/util/PullRequestDescriptionHandler.java index c57807ef..3cb9c1b8 100644 --- a/src/main/java/org/wildfly/bot/util/PullRequestDescriptionHandler.java +++ b/src/main/java/org/wildfly/bot/util/PullRequestDescriptionHandler.java @@ -4,6 +4,7 @@ import static org.wildfly.bot.model.RuntimeConstants.BOT_JIRA_LINKS_HEADER; import static org.wildfly.bot.model.RuntimeConstants.BOT_JIRA_LINK_COMMENT_TEMPLATE; import static org.wildfly.bot.model.RuntimeConstants.BOT_JIRA_LINK_TEMPLATE; +import static org.wildfly.bot.model.RuntimeConstants.BOT_JIRA_OLD_LINK_TEMPLATE; import static org.wildfly.bot.model.RuntimeConstants.BOT_MESSAGE_DELIMITER; import static org.wildfly.bot.model.RuntimeConstants.BOT_MESSAGE_WARNING; import static org.wildfly.bot.model.RuntimeConstants.BOT_REPO_REF_FOOTER; @@ -65,7 +66,8 @@ public PullRequestDescriptionHandler(GHPullRequest pullRequest, Pattern issueKey this.missingIssueLinksWithinUserBody = textSources.stream() .flatMap(text -> issueKeyPattern.matcher(text).results().map(MatchResult::group)) .distinct() - .filter(issueKey -> !userBody.contains(BOT_JIRA_LINK_TEMPLATE.formatted(issueKey))) + .filter(issueKey -> !userBody.contains(BOT_JIRA_LINK_TEMPLATE.formatted(issueKey)) + && !userBody.contains(BOT_JIRA_OLD_LINK_TEMPLATE.formatted(issueKey))) .collect(Collectors.toCollection(LinkedHashSet::new)); } diff --git a/src/test/java/org/wildfly/bot/PRAppendingMessageTest.java b/src/test/java/org/wildfly/bot/PRAppendingMessageTest.java index 39fe0b30..a78e86b9 100644 --- a/src/test/java/org/wildfly/bot/PRAppendingMessageTest.java +++ b/src/test/java/org/wildfly/bot/PRAppendingMessageTest.java @@ -129,8 +129,8 @@ void testBodyContainingSomeJirasAppendMessageMultipleDifferentLinks() throws Thr should not be cleared. - Here is one jira for you https://issues.redhat.com/browse/WFLY-00002 - and here is another one https://issues.redhat.com/browse/WFLY-00003 + Here is one jira for you https://redhat.atlassian.net/browse/WFLY-00002 + and here is another one https://redhat.atlassian.net/browse/WFLY-00003 """; final String expectedDescriptionToBeChangedByBot = constructFullDescription(userBodySection, @@ -164,9 +164,9 @@ void testBodyContainingAllJirasAppendMessageMultipleDifferentLinks() throws Thro cleared. Listing all jiras: - https://issues.redhat.com/browse/WFLY-00001 - https://issues.redhat.com/browse/WFLY-00002 - https://issues.redhat.com/browse/WFLY-00003 + https://redhat.atlassian.net/browse/WFLY-00001 + https://redhat.atlassian.net/browse/WFLY-00002 + https://redhat.atlassian.net/browse/WFLY-00003 """; pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder @@ -189,7 +189,7 @@ void testBodyContainingAllJirasAppendMessageMultipleDifferentLinks() throws Thro void testBotChangingBotSectionUponUserCorrectedSomeIssueLinks() throws Throwable { final String userBodySection = """ This user body section has been corrected and here is the issue link: - https://issues.redhat.com/browse/WFLY-00002 + https://redhat.atlassian.net/browse/WFLY-00002 """; final String descriptionToBeChangedByBot = constructFullDescription(userBodySection, List.of("WFLY-00000", "WFLY-00001", "WFLY-00002", @@ -220,14 +220,14 @@ void testBotChangingBotSectionUponUserCorrectedSomeIssueLinks() throws Throwable void testBotDeletingBotSectionUponUserCorrectedIssueLinks() throws Throwable { final String userBodySection = """ This user body section has been corrected and here are the issue links: - https://issues.redhat.com/browse/WFLY-00000 - https://issues.redhat.com/browse/WFLY-00001 + https://redhat.atlassian.net/browse/WFLY-00000 + https://redhat.atlassian.net/browse/WFLY-00001 ____ - https://issues.redhat.com/browse/WFLY-00002 - https://issues.redhat.com/browse/WFLY-00003 - https://issues.redhat.com/browse/WFLY-00004 + https://redhat.atlassian.net/browse/WFLY-00002 + https://redhat.atlassian.net/browse/WFLY-00003 + https://redhat.atlassian.net/browse/WFLY-00004 """; final String descriptionToBeChangedByBot = constructFullDescription(userBodySection, List.of("WFLY-00000", "WFLY-00001", "WFLY-00002", @@ -258,8 +258,8 @@ void testBotDeletingBotSectionUponUserCorrectedIssueLinks() throws Throwable { void testEditingTitleToContainMissingIssueLink() throws Throwable { final String userBodySection = """ This is my user section body with WFLY-00000 and WFLY-00001 issue links. - https://issues.redhat.com/browse/WFLY-00001 - https://issues.redhat.com/browse/WFLY-00002 + https://redhat.atlassian.net/browse/WFLY-00001 + https://redhat.atlassian.net/browse/WFLY-00002 """; final String originalBodyBeforeTheEdit = constructFullDescription(userBodySection, List.of("WFLY-00003")); @@ -333,7 +333,7 @@ void testDescriptionIsModifiedByBotIfBotSectionIsIncorrect() throws Throwable { @Test void testNonBreakingChangesWithThePreviousAppendMessageFormat() throws Throwable { final String oldBody = """ - https://issues.redhat.com/browse/WFLY-20743 + https://redhat.atlassian.net/browse/WFLY-20743 ____ @@ -341,13 +341,13 @@ void testNonBreakingChangesWithThePreviousAppendMessageFormat() throws Throwable > WildFly issue links: - > * [WFLY-20730] (https://issues.redhat.com/browse/WFLY-20730) + > * [WFLY-20730] (https://redhat.atlassian.net/browse/WFLY-20730) <--- END OF WILDFLY GITHUB BOT REPORT ---> More information about the [wildfly-bot](https://github.com/wildfly/wildfly-bot)"""; - final String expectedNewBody = constructFullDescription("https://issues.redhat.com/browse/WFLY-20743", + final String expectedNewBody = constructFullDescription("https://redhat.atlassian.net/browse/WFLY-20743", List.of("WFLY-20730")); pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder @@ -404,8 +404,8 @@ void testSequencedCommitsWithoutUserManualyEditingDescription() throws Throwable @Test void testBotChangingBotSectionUponUserFixupsCommitWithMissingIssueLink() throws Throwable { final String userBodySection = """ - This is my user section body with one WFLY issue link: - https://issues.redhat.com/browse/WFLY-00001 + This is my user section body with one WFLY issue link: + https://redhat.atlassian.net/browse/WFLY-00001 """; final String fullDescriptionBeforeTheFixup = constructFullDescription(userBodySection, List.of("WFLY-00002")); @@ -444,8 +444,8 @@ void testBotChangingBotSectionUponUserFixupsCommitWithMissingIssueLink() throws void testBotChangingBotSectionUponUserRewordingCommit() throws Throwable { final String userBodySection = """ This is my user section body with two WFLY issue links: - https://issues.redhat.com/browse/WFLY-00001 - https://issues.redhat.com/browse/WFLY-00003 + https://redhat.atlassian.net/browse/WFLY-00001 + https://redhat.atlassian.net/browse/WFLY-00003 """; final String fullDescriptionBeforeTheReword = constructFullDescription(userBodySection, List.of("WFLY-00002")); @@ -479,6 +479,59 @@ void testBotChangingBotSectionUponUserRewordingCommit() throws Throwable { .setBody(userBodySection)); // bot section should be removed } + @Test + void testBackwardCompatibilityOldLinkInUserSectionNoBot() throws Throwable { + final String userBodySection = """ + This PR fixes the following issue: + https://issues.redhat.com/browse/WFLY-00000 + + Additional fixes: + https://issues.redhat.com/browse/WFLY-00001 + """; + + pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder + .action(Action.EDITED) + .title("[WFLY-00000, WFLY-00001] title") + .description(userBodySection)); + + mockedContext = MockedGHPullRequest.builder(pullRequestJson.id()) + .commit("WFLY-00000 commit") + .commit("WFLY-00001 commit"); + + TestModel.given( + mocks -> WildflyGitHubBotTesting.mockRepo(mocks, WILDFLY_CONFIG_FILE, pullRequestJson, + mockedContext)) + .pullRequestEvent(pullRequestJson) + // Old links should be recognized as valid, so no bot section should be added + .then(mocks -> verify(mocks.pullRequest(pullRequestJson.id()), never()).setBody(any())); + } + + @Test + void testBackwardCompatibilityBotSectionHasOldLinksGetsUpdated() throws Throwable { + final String userBodySection = "This is my user section body without any WFLY issue links."; + final String expectedNewDescription = constructFullDescription(userBodySection, + List.of("WFLY-00000")); + final String oldDescription = userBodySection + convertNewLinksToOldLinks( + expectedNewDescription.substring(userBodySection.length())); + + pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder + .action(Action.EDITED) + .title("[WFLY-00000] title") + .description(oldDescription)); + + mockedContext = MockedGHPullRequest.builder(pullRequestJson.id()) + .commit("WFLY-00000 commit"); + + TestModel.given( + mocks -> WildflyGitHubBotTesting.mockRepo(mocks, WILDFLY_CONFIG_FILE, pullRequestJson, + mockedContext)) + .pullRequestEvent(pullRequestJson) + // Bot should regenerate bot section with both old and new issues using new link + // format + .then(mocks -> verify(mocks.pullRequest(pullRequestJson.id())) + .setBody(expectedNewDescription)); + } + private String constructFullDescription(String userBodySection, SequencedCollection botAddedIssueKeys) { userBodySection = userBodySection == null ? "" : userBodySection; String issueLinks = botAddedIssueKeys.stream() @@ -487,4 +540,8 @@ private String constructFullDescription(String userBodySection, SequencedCollect return userBodySection + incompleteBotSectionDescription.formatted(issueLinks, BOT_REPO_REF_FOOTER.formatted(botContextProvider.getBotName())); } + + private String convertNewLinksToOldLinks(String description) { + return description.replace("https://redhat.atlassian.net/browse/", "https://issues.redhat.com/browse/"); + } } diff --git a/src/test/java/org/wildfly/bot/PRChecksTest.java b/src/test/java/org/wildfly/bot/PRChecksTest.java index ed1b73f1..6c5e4387 100644 --- a/src/test/java/org/wildfly/bot/PRChecksTest.java +++ b/src/test/java/org/wildfly/bot/PRChecksTest.java @@ -65,13 +65,13 @@ void testAllChecksPass() throws Throwable { title: "Title" notify: [Tadpole] - id: "Description" - body: "issues.redhat.com" + body: "redhat.atlassian.net" notify: [Butterfly] format: description: - regexes: - - pattern: "JIRA:\\\\s+https://issues.redhat.com/browse/WFLY-\\\\d+|https://issues.redhat.com/browse/WFLY-\\\\d+" - message: "The PR description must contain a link to the JIRA issue" + regexes: + - pattern: "JIRA:\\\\s+https://redhat.atlassian.net/browse/WFLY-\\\\d+|https://redhat.atlassian.net/browse/WFLY-\\\\d+" + message: "The PR description must contain a link to the JIRA issue" """; pullRequestJson = TestModel.getPullRequestJson(); @@ -98,9 +98,9 @@ void testAllChecksFail() throws Throwable { notify: [Butterfly] format: description: - regexes: - - pattern: "JIRA:\\\\s+https://issues.redhat.com/browse/WFLY-\\\\d+|https://issues.redhat.com/browse/WFLY-\\\\d+" - message: "The PR description must contain a link to the JIRA issue" + regexes: + - pattern: "JIRA:\\\\s+https://redhat.atlassian.net/browse/WFLY-\\\\d+|https://redhat.atlassian.net/browse/WFLY-\\\\d+" + message: "The PR description must contain a link to the JIRA issue" """; pullRequestJson = TestModel.setPullRequestJsonBuilder( pullRequestJsonBuilder -> pullRequestJsonBuilder.title(TestConstants.INVALID_TITLE) diff --git a/src/test/java/org/wildfly/bot/PRDependabotTest.java b/src/test/java/org/wildfly/bot/PRDependabotTest.java index 878c2bdd..12edb3f9 100644 --- a/src/test/java/org/wildfly/bot/PRDependabotTest.java +++ b/src/test/java/org/wildfly/bot/PRDependabotTest.java @@ -48,11 +48,11 @@ static void setPullRequestJson() throws Exception { void testDependabotOnPREdited() throws Throwable { wildflyConfigFile = """ wildfly: - format: - description: - regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" - message: "The PR description must contain a link to the JIRA issue" + format: + description: + regexes: + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" + message: "The PR description must contain a link to the JIRA issue" """; pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder @@ -78,10 +78,10 @@ void testDependabotOnPREdited() throws Throwable { void testDependabotFormatCheckSkipOnPROpened() throws Throwable { wildflyConfigFile = """ wildfly: - format: - description: - regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + format: + description: + regexes: + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" """; pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder diff --git a/src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java b/src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java index e297a0fa..553155a8 100644 --- a/src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java +++ b/src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java @@ -51,7 +51,7 @@ void testDescriptionCheckFail() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" """; @@ -75,7 +75,7 @@ void testNoMessageInConfigFile() throws Throwable { format: description: regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" """; pullRequestJson = TestModel.setPullRequestJsonBuilder( @@ -99,7 +99,7 @@ void testDescriptionCheckSuccess() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" """; @@ -139,14 +139,14 @@ void testMultipleLineDescription() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" """; pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder .description(""" First line of description - Additional line of description - JIRA: https://issues.redhat.com/browse/WFLY-666 + Additional line of description - JIRA: https://redhat.atlassian.net/browse/WFLY-666 Another line with no JIRA link """)); @@ -166,7 +166,7 @@ void testMultipleRegexesFirstPatternHit() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" - pattern: "JIRA" """; @@ -192,13 +192,14 @@ void testMultipleRegexesSecondPatternHit() throws Throwable { description: message: Lorem ipsum dolor sit amet regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" - pattern: "JIRA" """; pullRequestJson = TestModel.setPullRequestJsonBuilder( - pullRequestJsonBuilder -> pullRequestJsonBuilder.description("https://issues.redhat.com/browse/WFLY-123")); + pullRequestJsonBuilder -> pullRequestJsonBuilder + .description("https://redhat.atlassian.net/browse/WFLY-123")); TestModel.given(mocks -> WildflyGitHubBotTesting.mockRepo(mocks, wildflyConfigFile, pullRequestJson)) .pullRequestEvent(pullRequestJson) @@ -218,7 +219,7 @@ void testMultipleRegexesAllPatternsHit() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" - pattern: "JIRA" """; @@ -244,7 +245,7 @@ void testMultipleRegexesNoPatternsHit() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" - pattern: "JIRA" """; @@ -268,7 +269,7 @@ public void testDisableGlobalFormatCheck() throws Throwable { description: message: Default fail message regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" message: "The PR description must contain a link to the JIRA issue" - pattern: "JIRA" """; @@ -292,7 +293,7 @@ void testPREmptyBody() throws Throwable { format: description: regexes: - - pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+" + - pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+" """; pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder diff --git a/src/test/java/org/wildfly/bot/PRRuleDescriptionCheckTest.java b/src/test/java/org/wildfly/bot/PRRuleDescriptionCheckTest.java index a71f4426..28a7e43c 100644 --- a/src/test/java/org/wildfly/bot/PRRuleDescriptionCheckTest.java +++ b/src/test/java/org/wildfly/bot/PRRuleDescriptionCheckTest.java @@ -34,7 +34,7 @@ void testSuccessfulBodyCheck() throws Throwable { wildfly: rules: - id: "Description" - body: "issues.redhat.com" + body: "redhat.atlassian.net" notify: [Tadpole] """; @@ -56,7 +56,7 @@ void testFailedBodyCheck() throws Throwable { wildfly: rules: - id: "Description" - body: "issues.redhat.com" + body: "redhat.atlassian.net" notify: [Tadpole] """; @@ -77,7 +77,7 @@ void testTitleBodyCheckForBodyCaseInsensitive() throws Throwable { wildfly: rules: - id: "Description" - body: "ISSUES.REDHAT.COM" + body: "REDHAT.ATLASSIAN.NET" notify: [Tadpole] """; diff --git a/src/test/java/org/wildfly/bot/PRRuleNotifyTest.java b/src/test/java/org/wildfly/bot/PRRuleNotifyTest.java index 73ae2416..757a994f 100644 --- a/src/test/java/org/wildfly/bot/PRRuleNotifyTest.java +++ b/src/test/java/org/wildfly/bot/PRRuleNotifyTest.java @@ -82,7 +82,7 @@ void testMentionsCCCommentForDuplicateMentions() throws Throwable { title: "Title" notify: [Tadpole,Duke] - id: "Description" - body: "issues.redhat.com" + body: "redhat.atlassian.net" notify: [Tadpole,Doggo] """; diff --git a/src/test/java/org/wildfly/bot/PRRuleTitleBodyCheckTest.java b/src/test/java/org/wildfly/bot/PRRuleTitleBodyCheckTest.java index dc909fdc..f8c960a3 100644 --- a/src/test/java/org/wildfly/bot/PRRuleTitleBodyCheckTest.java +++ b/src/test/java/org/wildfly/bot/PRRuleTitleBodyCheckTest.java @@ -60,7 +60,7 @@ void testTitleBodyCheckForBody() throws Throwable { - id: "TitleBody" title: "NonTitle" body: "NonBody" - titleBody: "issues.redhat.com" + titleBody: "redhat.atlassian.net" notify: [Tadpole] """; @@ -83,7 +83,7 @@ void testTitleBodyCheckForTitleBodyCaseInsensitive() throws Throwable { - id: "TitleBody" title: "NonTitle" body: "NonBody" - titleBody: "ISSUES.REDHAT.COM" + titleBody: "REDHAT.ATLASSIAN.NET" notify: [Tadpole] """; diff --git a/src/test/resources/events/raw_pr_review_template.json b/src/test/resources/events/raw_pr_review_template.json index 1d3ab257..ee04dfa4 100644 --- a/src/test/resources/events/raw_pr_review_template.json +++ b/src/test/resources/events/raw_pr_review_template.json @@ -87,25 +87,17 @@ "type": "User", "site_admin": false }, - "body": "JIRA: https://issues.redhat.com/browse/WFLY-123", + "body": "JIRA: https://redhat.atlassian.net/browse/WFLY-123", "created_at": "2024-04-09T12:27:12Z", "updated_at": "2024-04-22T09:17:41Z", "closed_at": null, "merged_at": null, "merge_commit_sha": "85e261199e81099917fe533da226ffdfa1ab4499", "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], "milestone": null, "draft": false, "commits_url": "https://api.github.com/repos/Tadpole/wildfly-github-bot/pulls/55/commits", @@ -236,9 +228,7 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - - ], + "topics": [], "visibility": "public", "forks": 0, "open_issues": 17, @@ -369,9 +359,7 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - - ], + "topics": [], "visibility": "public", "forks": 0, "open_issues": 17, diff --git a/src/test/resources/events/raw_pr_template.json b/src/test/resources/events/raw_pr_template.json index 1bdf1536..5d35e20d 100644 --- a/src/test/resources/events/raw_pr_template.json +++ b/src/test/resources/events/raw_pr_template.json @@ -49,25 +49,17 @@ "type": "User", "site_admin": false }, - "body": "JIRA: https://issues.redhat.com/browse/WFLY-123", + "body": "JIRA: https://redhat.atlassian.net/browse/WFLY-123", "created_at": "2024-04-25T07:00:40Z", "updated_at": "2024-04-25T07:00:40Z", "closed_at": null, "merged_at": null, "merge_commit_sha": null, "assignee": null, - "assignees": [ - - ], - "requested_reviewers": [ - - ], - "requested_teams": [ - - ], - "labels": [ - - ], + "assignees": [], + "requested_reviewers": [], + "requested_teams": [], + "labels": [], "milestone": null, "draft": false, "commits_url": "https://api.github.com/repos/Tadpole/wildfly-github-bot/pulls/56/commits", @@ -198,9 +190,7 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - - ], + "topics": [], "visibility": "public", "forks": 0, "open_issues": 18, @@ -331,9 +321,7 @@ "allow_forking": true, "is_template": false, "web_commit_signoff_required": false, - "topics": [ - - ], + "topics": [], "visibility": "public", "forks": 0, "open_issues": 18, diff --git a/src/test/resources/webhooks/valid-pr-review-template.json b/src/test/resources/webhooks/valid-pr-review-template.json index ef7bdf3b..cb28ec35 100644 --- a/src/test/resources/webhooks/valid-pr-review-template.json +++ b/src/test/resources/webhooks/valid-pr-review-template.json @@ -71,7 +71,7 @@ "type": "User", "site_admin": false }, - "body": "JIRA: https://issues.redhat.com/browse/WFLY-123", + "body": "JIRA: https://redhat.atlassian.net/browse/WFLY-123", "created_at": "2023-08-14T07:46:48Z", "updated_at": "2023-09-05T11:59:00Z", "closed_at": null, diff --git a/src/test/resources/webhooks/valid-pr-template.json b/src/test/resources/webhooks/valid-pr-template.json index dfbc98a6..6183a350 100644 --- a/src/test/resources/webhooks/valid-pr-template.json +++ b/src/test/resources/webhooks/valid-pr-template.json @@ -33,7 +33,7 @@ "type": "User", "site_admin": false }, - "body": "JIRA: https://issues.redhat.com/browse/WFLY-123", + "body": "JIRA: https://redhat.atlassian.net/browse/WFLY-123", "created_at": "2023-05-31T07:51:01Z", "updated_at": "2023-05-31T07:51:01Z", "closed_at": null, diff --git a/wildfly-bot-config-example.yml b/wildfly-bot-config-example.yml index 6c40a731..e1b027f3 100644 --- a/wildfly-bot-config-example.yml +++ b/wildfly-bot-config-example.yml @@ -23,7 +23,7 @@ wildfly: description: regexes: # List of objects, where the object is as follows: - - pattern: "JIRA:\\s+https://issues.redhat.com/browse/WFLY-\\d+|https://issues.redhat.com/browse/WFLY-\\d+" # Regex pattern must be matched by the title + - pattern: "JIRA:\\s+https://redhat.atlassian.net/browse/WFLY-\\d+|https://redhat.atlassian.net/browse/WFLY-\\d+" # Regex pattern must be matched by the title message: "The PR description must contain a link to the JIRA issue" # Message to display if check does not succeed message: "The PR description is not correct" # Default message to display if a object is missing message field