From 7cb457b47b15f2f6d278108119d049efa3c73641 Mon Sep 17 00:00:00 2001 From: Marek Skacelik Date: Thu, 26 Mar 2026 12:28:16 +0100 Subject: [PATCH] Replace old JIRA link URI --- README.md | 2 +- .../wildfly/bot/model/RuntimeConstants.java | 2 +- .../wildfly/bot/PRAppendingMessageTest.java | 38 +++++++++---------- .../java/org/wildfly/bot/PRChecksTest.java | 6 +-- .../org/wildfly/bot/PRDependabotTest.java | 4 +- .../wildfly/bot/PRDescriptionCheckTest.java | 24 ++++++------ .../bot/PRRuleDescriptionCheckTest.java | 6 +-- .../org/wildfly/bot/PRRuleNotifyTest.java | 2 +- .../wildfly/bot/PRRuleTitleBodyCheckTest.java | 4 +- .../events/raw_pr_review_template.json | 2 +- .../resources/events/raw_pr_template.json | 2 +- .../webhooks/valid-pr-review-template.json | 2 +- .../resources/webhooks/valid-pr-template.json | 2 +- wildfly-bot-config-example.yml | 2 +- 14 files changed, 49 insertions(+), 49 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..1fdc435e 100644 --- a/src/main/java/org/wildfly/bot/model/RuntimeConstants.java +++ b/src/main/java/org/wildfly/bot/model/RuntimeConstants.java @@ -22,7 +22,7 @@ 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"; + 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/test/java/org/wildfly/bot/PRAppendingMessageTest.java b/src/test/java/org/wildfly/bot/PRAppendingMessageTest.java index 39fe0b30..7b46453d 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 @@ -405,7 +405,7 @@ void testSequencedCommitsWithoutUserManualyEditingDescription() throws Throwable 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 + 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")); diff --git a/src/test/java/org/wildfly/bot/PRChecksTest.java b/src/test/java/org/wildfly/bot/PRChecksTest.java index ed1b73f1..c252ca06 100644 --- a/src/test/java/org/wildfly/bot/PRChecksTest.java +++ b/src/test/java/org/wildfly/bot/PRChecksTest.java @@ -65,12 +65,12 @@ 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+" + - 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(); @@ -99,7 +99,7 @@ void testAllChecksFail() throws Throwable { format: description: 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" """; pullRequestJson = TestModel.setPullRequestJsonBuilder( diff --git a/src/test/java/org/wildfly/bot/PRDependabotTest.java b/src/test/java/org/wildfly/bot/PRDependabotTest.java index 878c2bdd..5b49aabb 100644 --- a/src/test/java/org/wildfly/bot/PRDependabotTest.java +++ b/src/test/java/org/wildfly/bot/PRDependabotTest.java @@ -51,7 +51,7 @@ void testDependabotOnPREdited() throws Throwable { format: description: 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" """; @@ -81,7 +81,7 @@ void testDependabotFormatCheckSkipOnPROpened() 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/PRDescriptionCheckTest.java b/src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java index e297a0fa..8901b21f 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,13 @@ 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 +218,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 +244,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 +268,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 +292,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..62f1dbf1 100644 --- a/src/test/resources/events/raw_pr_review_template.json +++ b/src/test/resources/events/raw_pr_review_template.json @@ -87,7 +87,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": "2024-04-09T12:27:12Z", "updated_at": "2024-04-22T09:17:41Z", "closed_at": null, diff --git a/src/test/resources/events/raw_pr_template.json b/src/test/resources/events/raw_pr_template.json index 1bdf1536..56de6b07 100644 --- a/src/test/resources/events/raw_pr_template.json +++ b/src/test/resources/events/raw_pr_template.json @@ -49,7 +49,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": "2024-04-25T07:00:40Z", "updated_at": "2024-04-25T07:00:40Z", "closed_at": null, 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