Skip to content

Commit ae63dc9

Browse files
committed
Require 2.346.3
1 parent 9fecfd6 commit ae63dc9

File tree

2 files changed

+29
-47
lines changed

2 files changed

+29
-47
lines changed

pom.xml

+12-31
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>3.53</version>
7+
<version>4.51</version>
8+
<relativePath></relativePath>
89
</parent>
910

1011
<artifactId>stash-pullrequest-builder</artifactId>
@@ -15,26 +16,8 @@
1516
<description>This plugin builds Stash pull requests and posts the build results on Stash</description>
1617
<url>https://github.com/jenkinsci/stash-pullrequest-builder-plugin</url>
1718

18-
<developers>
19-
<developer>
20-
<id>nemccarthy</id>
21-
<name>Nathan McCarthy</name>
22-
<email>[email protected]</email>
23-
</developer>
24-
<developer>
25-
<id>jimklimov</id>
26-
<name>Jim Klimov</name>
27-
<email>[email protected]</email>
28-
</developer>
29-
<developer>
30-
<id>jbochenski</id>
31-
<name>Jakub Bocheński</name>
32-
<email>[email protected]</email>
33-
</developer>
34-
</developers>
35-
3619
<scm>
37-
<connection>scm:git:ssh://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
20+
<connection>scm:git:https://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
3821
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/stash-pullrequest-builder-plugin.git</developerConnection>
3922
<tag>${scmTag}</tag>
4023
<url>https://github.com/jenkinsci/stash-pullrequest-builder-plugin</url>
@@ -56,19 +39,22 @@
5639
<properties>
5740
<revision>1.18</revision>
5841
<changelist>-SNAPSHOT</changelist>
59-
<java.level>8</java.level>
60-
<jenkins.version>2.60.3</jenkins.version>
42+
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
43+
<jenkins.baseline>2.346</jenkins.baseline>
44+
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
45+
<slf4jVersion>1.7.25</slf4jVersion>
6146
<spotbugs.effort>Max</spotbugs.effort>
6247
<spotbugs.threshold>Low</spotbugs.threshold>
6348
</properties>
6449

6550
<dependencyManagement>
6651
<dependencies>
6752
<dependency>
68-
<groupId>junit</groupId>
69-
<artifactId>junit</artifactId>
70-
<version>4.13</version>
71-
<scope>test</scope>
53+
<groupId>io.jenkins.tools.bom</groupId>
54+
<artifactId>bom-${jenkins.baseline}.x</artifactId>
55+
<version>1763.v092b_8980a_f5e</version>
56+
<type>pom</type>
57+
<scope>import</scope>
7258
</dependency>
7359
</dependencies>
7460
</dependencyManagement>
@@ -77,22 +63,18 @@
7763
<dependency>
7864
<groupId>org.jenkins-ci.plugins</groupId>
7965
<artifactId>jackson2-api</artifactId>
80-
<version>2.9.9.1</version>
8166
</dependency>
8267
<dependency>
8368
<groupId>org.jenkins-ci.plugins</groupId>
8469
<artifactId>credentials</artifactId>
85-
<version>2.1.5</version>
8670
</dependency>
8771
<dependency>
8872
<groupId>org.jenkins-ci.plugins</groupId>
8973
<artifactId>apache-httpcomponents-client-4-api</artifactId>
90-
<version>4.5.5-3.0</version>
9174
</dependency>
9275
<dependency>
9376
<groupId>org.slf4j</groupId>
9477
<artifactId>slf4j-api</artifactId>
95-
<version>${slf4jVersion}</version>
9678
<scope>provided</scope>
9779
</dependency>
9880
<dependency>
@@ -109,7 +91,6 @@
10991
<dependency>
11092
<groupId>org.jenkins-ci.plugins.workflow</groupId>
11193
<artifactId>workflow-job</artifactId>
112-
<version>2.9</version>
11394
<scope>test</scope>
11495
</dependency>
11596
</dependencies>

src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashRepository.java

+17-16
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public class StashRepository {
5252
private static final String BUILD_START_MESSAGE = "BuildStarted";
5353
private static final String BUILD_FINISH_MESSAGE = "BuildFinished";
5454
private static final String BUILD_CANCEL_MESSAGE = "BuildCanceled";
55-
private static final String[] BUILD_STATUSES = {BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE};
55+
private static final String[] BUILD_STATUSES = {
56+
BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE
57+
};
5658
private static final String BUILD_MARKER = "[*%s* **%s**] %s into %s";
5759

5860
private static final String BUILD_STATUS_REGEX =
@@ -259,8 +261,10 @@ private List<StashPullRequestBuildTarget> getBuildTargetsWithoutOnlyBuildOnComme
259261

260262
// These will match any start or finish message -- need to check commits
261263
String escapedBuildName = Pattern.quote(job.getDisplayName());
262-
String project_build_start = String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
263-
String project_build_finished = String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
264+
String project_build_start =
265+
String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
266+
String project_build_finished =
267+
String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
264268
Matcher startMatcher =
265269
Pattern.compile(project_build_start, Pattern.CASE_INSENSITIVE).matcher(content);
266270
Matcher finishMatcher =
@@ -331,7 +335,8 @@ private String postBuildStatusComment(
331335
throws StashApiException {
332336
String sourceCommit = pullRequest.getFromRef().getLatestCommit();
333337
String destinationCommit = pullRequest.getToRef().getLatestCommit();
334-
String comment = format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
338+
String comment =
339+
format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
335340
StashPullRequestComment commentResponse;
336341
commentResponse =
337342
this.client.postPullRequestComment(pullRequest.getId(), comment, buildCommandCommentId);
@@ -579,17 +584,12 @@ public void postFinishedComment(
579584
String message = getMessageForBuildResult(buildResult);
580585
String comment =
581586
format(
582-
BUILD_MARKER,
583-
BUILD_FINISH_MESSAGE,
584-
job.getDisplayName(),
585-
sourceCommit,
586-
destinationCommit)
587-
+ format(
588-
BUILD_FINISH_SENTENCE,
589-
message,
590-
buildUrl,
591-
buildNumber,
592-
duration);
587+
BUILD_MARKER,
588+
BUILD_FINISH_MESSAGE,
589+
job.getDisplayName(),
590+
sourceCommit,
591+
destinationCommit)
592+
+ format(BUILD_FINISH_SENTENCE, message, buildUrl, buildNumber, duration);
593593

594594
comment = comment.concat(additionalComment);
595595

@@ -684,7 +684,8 @@ private void deletePreviousBuildFinishedComments(StashPullRequestResponseValue p
684684
continue;
685685
}
686686

687-
String project_build_finished = format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
687+
String project_build_finished =
688+
format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
688689
Matcher finishMatcher =
689690
Pattern.compile(project_build_finished, Pattern.CASE_INSENSITIVE).matcher(content);
690691

0 commit comments

Comments
 (0)