Skip to content

Commit dc10bbf

Browse files
authored
Merge pull request #239 from mskacelik/issue-238
Fix compability with the new JIRA URI domain
2 parents cf1fd45 + 7cb457b commit dc10bbf

14 files changed

+49
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ wildfly:
119119
message: Wrong content of the PR title
120120
description: # 3
121121
regexes:
122-
- pattern: JIRA:\s+https://issues.redhat.com/browse/WFLY-\d+|https://issues.redhat.com/browse/WFLY-\d+
122+
- pattern: JIRA:\s+https://redhat.atlassian.net/browse/WFLY-\d+|https://redhat.atlassian.net/browse/WFLY-\d+
123123
message: The PR description must contain a link to the JIRA issue # 4
124124
emails: # 5
125125
- foo@bar.baz

src/main/java/org/wildfly/bot/model/RuntimeConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class RuntimeConstants {
2222

2323
public static final String BOT_JIRA_LINKS_HEADER = "Additional WildFly Issue Links Found:\n";
2424

25-
public static final String BOT_JIRA_LINK_TEMPLATE = "https://issues.redhat.com/browse/%1$s";
25+
public static final String BOT_JIRA_LINK_TEMPLATE = "https://redhat.atlassian.net/browse/%1$s";
2626

2727
public static final String BOT_JIRA_LINK_COMMENT_TEMPLATE = String.format("* [%%1$s](%s)\n", BOT_JIRA_LINK_TEMPLATE);
2828

src/test/java/org/wildfly/bot/PRAppendingMessageTest.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ void testBodyContainingSomeJirasAppendMessageMultipleDifferentLinks() throws Thr
129129
should not be
130130
131131
cleared.
132-
Here is one jira for you https://issues.redhat.com/browse/WFLY-00002
133-
and here is another one https://issues.redhat.com/browse/WFLY-00003
132+
Here is one jira for you https://redhat.atlassian.net/browse/WFLY-00002
133+
and here is another one https://redhat.atlassian.net/browse/WFLY-00003
134134
""";
135135

136136
final String expectedDescriptionToBeChangedByBot = constructFullDescription(userBodySection,
@@ -164,9 +164,9 @@ void testBodyContainingAllJirasAppendMessageMultipleDifferentLinks() throws Thro
164164
cleared.
165165
166166
Listing all jiras:
167-
https://issues.redhat.com/browse/WFLY-00001
168-
https://issues.redhat.com/browse/WFLY-00002
169-
https://issues.redhat.com/browse/WFLY-00003
167+
https://redhat.atlassian.net/browse/WFLY-00001
168+
https://redhat.atlassian.net/browse/WFLY-00002
169+
https://redhat.atlassian.net/browse/WFLY-00003
170170
""";
171171

172172
pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder
@@ -189,7 +189,7 @@ void testBodyContainingAllJirasAppendMessageMultipleDifferentLinks() throws Thro
189189
void testBotChangingBotSectionUponUserCorrectedSomeIssueLinks() throws Throwable {
190190
final String userBodySection = """
191191
This user body section has been corrected and here is the issue link:
192-
https://issues.redhat.com/browse/WFLY-00002
192+
https://redhat.atlassian.net/browse/WFLY-00002
193193
""";
194194
final String descriptionToBeChangedByBot = constructFullDescription(userBodySection,
195195
List.of("WFLY-00000", "WFLY-00001", "WFLY-00002",
@@ -220,14 +220,14 @@ void testBotChangingBotSectionUponUserCorrectedSomeIssueLinks() throws Throwable
220220
void testBotDeletingBotSectionUponUserCorrectedIssueLinks() throws Throwable {
221221
final String userBodySection = """
222222
This user body section has been corrected and here are the issue links:
223-
https://issues.redhat.com/browse/WFLY-00000
224-
https://issues.redhat.com/browse/WFLY-00001
223+
https://redhat.atlassian.net/browse/WFLY-00000
224+
https://redhat.atlassian.net/browse/WFLY-00001
225225
226226
____
227227
228-
https://issues.redhat.com/browse/WFLY-00002
229-
https://issues.redhat.com/browse/WFLY-00003
230-
https://issues.redhat.com/browse/WFLY-00004
228+
https://redhat.atlassian.net/browse/WFLY-00002
229+
https://redhat.atlassian.net/browse/WFLY-00003
230+
https://redhat.atlassian.net/browse/WFLY-00004
231231
""";
232232
final String descriptionToBeChangedByBot = constructFullDescription(userBodySection,
233233
List.of("WFLY-00000", "WFLY-00001", "WFLY-00002",
@@ -258,8 +258,8 @@ void testBotDeletingBotSectionUponUserCorrectedIssueLinks() throws Throwable {
258258
void testEditingTitleToContainMissingIssueLink() throws Throwable {
259259
final String userBodySection = """
260260
This is my user section body with WFLY-00000 and WFLY-00001 issue links.
261-
https://issues.redhat.com/browse/WFLY-00001
262-
https://issues.redhat.com/browse/WFLY-00002
261+
https://redhat.atlassian.net/browse/WFLY-00001
262+
https://redhat.atlassian.net/browse/WFLY-00002
263263
""";
264264

265265
final String originalBodyBeforeTheEdit = constructFullDescription(userBodySection, List.of("WFLY-00003"));
@@ -333,21 +333,21 @@ void testDescriptionIsModifiedByBotIfBotSectionIsIncorrect() throws Throwable {
333333
@Test
334334
void testNonBreakingChangesWithThePreviousAppendMessageFormat() throws Throwable {
335335
final String oldBody = """
336-
https://issues.redhat.com/browse/WFLY-20743
336+
https://redhat.atlassian.net/browse/WFLY-20743
337337
338338
____
339339
340340
<--- THIS SECTION IS AUTOMATICALLY GENERATED BY WILDFLY GITHUB BOT. ANY MANUAL CHANGES WILL BE LOST. --->
341341
342342
> WildFly issue links:
343343
344-
> * [WFLY-20730] (https://issues.redhat.com/browse/WFLY-20730)
344+
> * [WFLY-20730] (https://redhat.atlassian.net/browse/WFLY-20730)
345345
346346
<--- END OF WILDFLY GITHUB BOT REPORT --->
347347
348348
More information about the [wildfly-bot](https://github.com/wildfly/wildfly-bot)""";
349349

350-
final String expectedNewBody = constructFullDescription("https://issues.redhat.com/browse/WFLY-20743",
350+
final String expectedNewBody = constructFullDescription("https://redhat.atlassian.net/browse/WFLY-20743",
351351
List.of("WFLY-20730"));
352352

353353
pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder
@@ -405,7 +405,7 @@ void testSequencedCommitsWithoutUserManualyEditingDescription() throws Throwable
405405
void testBotChangingBotSectionUponUserFixupsCommitWithMissingIssueLink() throws Throwable {
406406
final String userBodySection = """
407407
This is my user section body with one WFLY issue link:
408-
https://issues.redhat.com/browse/WFLY-00001
408+
https://redhat.atlassian.net/browse/WFLY-00001
409409
""";
410410

411411
final String fullDescriptionBeforeTheFixup = constructFullDescription(userBodySection, List.of("WFLY-00002"));
@@ -444,8 +444,8 @@ void testBotChangingBotSectionUponUserFixupsCommitWithMissingIssueLink() throws
444444
void testBotChangingBotSectionUponUserRewordingCommit() throws Throwable {
445445
final String userBodySection = """
446446
This is my user section body with two WFLY issue links:
447-
https://issues.redhat.com/browse/WFLY-00001
448-
https://issues.redhat.com/browse/WFLY-00003
447+
https://redhat.atlassian.net/browse/WFLY-00001
448+
https://redhat.atlassian.net/browse/WFLY-00003
449449
""";
450450
final String fullDescriptionBeforeTheReword = constructFullDescription(userBodySection, List.of("WFLY-00002"));
451451

src/test/java/org/wildfly/bot/PRChecksTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ void testAllChecksPass() throws Throwable {
6565
title: "Title"
6666
notify: [Tadpole]
6767
- id: "Description"
68-
body: "issues.redhat.com"
68+
body: "redhat.atlassian.net"
6969
notify: [Butterfly]
7070
format:
7171
description:
7272
regexes:
73-
- pattern: "JIRA:\\\\s+https://issues.redhat.com/browse/WFLY-\\\\d+|https://issues.redhat.com/browse/WFLY-\\\\d+"
73+
- pattern: "JIRA:\\\\s+https://redhat.atlassian.net/browse/WFLY-\\\\d+|https://redhat.atlassian.net/browse/WFLY-\\\\d+"
7474
message: "The PR description must contain a link to the JIRA issue"
7575
""";
7676
pullRequestJson = TestModel.getPullRequestJson();
@@ -99,7 +99,7 @@ void testAllChecksFail() throws Throwable {
9999
format:
100100
description:
101101
regexes:
102-
- pattern: "JIRA:\\\\s+https://issues.redhat.com/browse/WFLY-\\\\d+|https://issues.redhat.com/browse/WFLY-\\\\d+"
102+
- pattern: "JIRA:\\\\s+https://redhat.atlassian.net/browse/WFLY-\\\\d+|https://redhat.atlassian.net/browse/WFLY-\\\\d+"
103103
message: "The PR description must contain a link to the JIRA issue"
104104
""";
105105
pullRequestJson = TestModel.setPullRequestJsonBuilder(

src/test/java/org/wildfly/bot/PRDependabotTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void testDependabotOnPREdited() throws Throwable {
5151
format:
5252
description:
5353
regexes:
54-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
54+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
5555
message: "The PR description must contain a link to the JIRA issue"
5656
""";
5757

@@ -81,7 +81,7 @@ void testDependabotFormatCheckSkipOnPROpened() throws Throwable {
8181
format:
8282
description:
8383
regexes:
84-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
84+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
8585
""";
8686

8787
pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder

src/test/java/org/wildfly/bot/PRDescriptionCheckTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void testDescriptionCheckFail() throws Throwable {
5151
description:
5252
message: Default fail message
5353
regexes:
54-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
54+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
5555
message: "The PR description must contain a link to the JIRA issue"
5656
""";
5757

@@ -75,7 +75,7 @@ void testNoMessageInConfigFile() throws Throwable {
7575
format:
7676
description:
7777
regexes:
78-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
78+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
7979
""";
8080

8181
pullRequestJson = TestModel.setPullRequestJsonBuilder(
@@ -99,7 +99,7 @@ void testDescriptionCheckSuccess() throws Throwable {
9999
description:
100100
message: Default fail message
101101
regexes:
102-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
102+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
103103
message: "The PR description must contain a link to the JIRA issue"
104104
""";
105105

@@ -139,14 +139,14 @@ void testMultipleLineDescription() throws Throwable {
139139
description:
140140
message: Default fail message
141141
regexes:
142-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
142+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
143143
message: "The PR description must contain a link to the JIRA issue"
144144
""";
145145

146146
pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder
147147
.description("""
148148
First line of description
149-
Additional line of description - JIRA: https://issues.redhat.com/browse/WFLY-666
149+
Additional line of description - JIRA: https://redhat.atlassian.net/browse/WFLY-666
150150
Another line with no JIRA link
151151
"""));
152152

@@ -166,7 +166,7 @@ void testMultipleRegexesFirstPatternHit() throws Throwable {
166166
description:
167167
message: Default fail message
168168
regexes:
169-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
169+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
170170
message: "The PR description must contain a link to the JIRA issue"
171171
- pattern: "JIRA"
172172
""";
@@ -192,13 +192,13 @@ void testMultipleRegexesSecondPatternHit() throws Throwable {
192192
description:
193193
message: Lorem ipsum dolor sit amet
194194
regexes:
195-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
195+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
196196
message: "The PR description must contain a link to the JIRA issue"
197197
- pattern: "JIRA"
198198
""";
199199

200200
pullRequestJson = TestModel.setPullRequestJsonBuilder(
201-
pullRequestJsonBuilder -> pullRequestJsonBuilder.description("https://issues.redhat.com/browse/WFLY-123"));
201+
pullRequestJsonBuilder -> pullRequestJsonBuilder.description("https://redhat.atlassian.net/browse/WFLY-123"));
202202

203203
TestModel.given(mocks -> WildflyGitHubBotTesting.mockRepo(mocks, wildflyConfigFile, pullRequestJson))
204204
.pullRequestEvent(pullRequestJson)
@@ -218,7 +218,7 @@ void testMultipleRegexesAllPatternsHit() throws Throwable {
218218
description:
219219
message: Default fail message
220220
regexes:
221-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
221+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
222222
message: "The PR description must contain a link to the JIRA issue"
223223
- pattern: "JIRA"
224224
""";
@@ -244,7 +244,7 @@ void testMultipleRegexesNoPatternsHit() throws Throwable {
244244
description:
245245
message: Default fail message
246246
regexes:
247-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
247+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
248248
message: "The PR description must contain a link to the JIRA issue"
249249
- pattern: "JIRA"
250250
""";
@@ -268,7 +268,7 @@ public void testDisableGlobalFormatCheck() throws Throwable {
268268
description:
269269
message: Default fail message
270270
regexes:
271-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
271+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
272272
message: "The PR description must contain a link to the JIRA issue"
273273
- pattern: "JIRA"
274274
""";
@@ -292,7 +292,7 @@ void testPREmptyBody() throws Throwable {
292292
format:
293293
description:
294294
regexes:
295-
- pattern: "https://issues.redhat.com/browse/WFLY-\\\\d+"
295+
- pattern: "https://redhat.atlassian.net/browse/WFLY-\\\\d+"
296296
""";
297297

298298
pullRequestJson = TestModel.setPullRequestJsonBuilder(pullRequestJsonBuilder -> pullRequestJsonBuilder

src/test/java/org/wildfly/bot/PRRuleDescriptionCheckTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void testSuccessfulBodyCheck() throws Throwable {
3434
wildfly:
3535
rules:
3636
- id: "Description"
37-
body: "issues.redhat.com"
37+
body: "redhat.atlassian.net"
3838
notify: [Tadpole]
3939
""";
4040

@@ -56,7 +56,7 @@ void testFailedBodyCheck() throws Throwable {
5656
wildfly:
5757
rules:
5858
- id: "Description"
59-
body: "issues.redhat.com"
59+
body: "redhat.atlassian.net"
6060
notify: [Tadpole]
6161
""";
6262

@@ -77,7 +77,7 @@ void testTitleBodyCheckForBodyCaseInsensitive() throws Throwable {
7777
wildfly:
7878
rules:
7979
- id: "Description"
80-
body: "ISSUES.REDHAT.COM"
80+
body: "REDHAT.ATLASSIAN.NET"
8181
notify: [Tadpole]
8282
""";
8383

src/test/java/org/wildfly/bot/PRRuleNotifyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void testMentionsCCCommentForDuplicateMentions() throws Throwable {
8282
title: "Title"
8383
notify: [Tadpole,Duke]
8484
- id: "Description"
85-
body: "issues.redhat.com"
85+
body: "redhat.atlassian.net"
8686
notify: [Tadpole,Doggo]
8787
""";
8888

src/test/java/org/wildfly/bot/PRRuleTitleBodyCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void testTitleBodyCheckForBody() throws Throwable {
6060
- id: "TitleBody"
6161
title: "NonTitle"
6262
body: "NonBody"
63-
titleBody: "issues.redhat.com"
63+
titleBody: "redhat.atlassian.net"
6464
notify: [Tadpole]
6565
""";
6666

@@ -83,7 +83,7 @@ void testTitleBodyCheckForTitleBodyCaseInsensitive() throws Throwable {
8383
- id: "TitleBody"
8484
title: "NonTitle"
8585
body: "NonBody"
86-
titleBody: "ISSUES.REDHAT.COM"
86+
titleBody: "REDHAT.ATLASSIAN.NET"
8787
notify: [Tadpole]
8888
""";
8989

src/test/resources/events/raw_pr_review_template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"type": "User",
8888
"site_admin": false
8989
},
90-
"body": "JIRA: https://issues.redhat.com/browse/WFLY-123",
90+
"body": "JIRA: https://redhat.atlassian.net/browse/WFLY-123",
9191
"created_at": "2024-04-09T12:27:12Z",
9292
"updated_at": "2024-04-22T09:17:41Z",
9393
"closed_at": null,

0 commit comments

Comments
 (0)