Skip to content

chore(pom): Use recommended core version 2.462.3, and Java 11. #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 12 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.53</version>
<version>4.88</version>
<relativePath></relativePath>
</parent>

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

<developers>
<developer>
<id>nemccarthy</id>
<name>Nathan McCarthy</name>
<email>[email protected]</email>
</developer>
<developer>
<id>jimklimov</id>
<name>Jim Klimov</name>
<email>[email protected]</email>
</developer>
<developer>
<id>jbochenski</id>
<name>Jakub Bocheński</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<connection>scm:git:ssh://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
<connection>scm:git:https://github.com/jenkinsci/stash-pullrequest-builder-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/stash-pullrequest-builder-plugin.git</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/jenkinsci/stash-pullrequest-builder-plugin</url>
Expand All @@ -56,19 +39,22 @@
<properties>
<revision>1.18</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
<jenkins.version>2.60.3</jenkins.version>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.462</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
<slf4jVersion>1.7.25</slf4jVersion>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>4228.v0a_71308d905b_</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand All @@ -77,22 +63,18 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
<version>2.9.9.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.1.5</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>apache-httpcomponents-client-4-api</artifactId>
<version>4.5.5-3.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -109,7 +91,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>2.9</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public class StashRepository {
private static final String BUILD_START_MESSAGE = "BuildStarted";
private static final String BUILD_FINISH_MESSAGE = "BuildFinished";
private static final String BUILD_CANCEL_MESSAGE = "BuildCanceled";
private static final String[] BUILD_STATUSES = {BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE};
private static final String[] BUILD_STATUSES = {
BUILD_START_MESSAGE, BUILD_FINISH_MESSAGE, BUILD_CANCEL_MESSAGE
};
private static final String BUILD_MARKER = "[*%s* **%s**] %s into %s";

private static final String BUILD_STATUS_REGEX =
Expand Down Expand Up @@ -259,8 +261,10 @@ private List<StashPullRequestBuildTarget> getBuildTargetsWithoutOnlyBuildOnComme

// These will match any start or finish message -- need to check commits
String escapedBuildName = Pattern.quote(job.getDisplayName());
String project_build_start = String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
String project_build_finished = String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
String project_build_start =
String.format(BUILD_STATUS_REGEX, BUILD_START_MESSAGE, escapedBuildName);
String project_build_finished =
String.format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, escapedBuildName);
Matcher startMatcher =
Pattern.compile(project_build_start, Pattern.CASE_INSENSITIVE).matcher(content);
Matcher finishMatcher =
Expand Down Expand Up @@ -331,7 +335,8 @@ private String postBuildStatusComment(
throws StashApiException {
String sourceCommit = pullRequest.getFromRef().getLatestCommit();
String destinationCommit = pullRequest.getToRef().getLatestCommit();
String comment = format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
String comment =
format(BUILD_MARKER, buildMessage, job.getDisplayName(), sourceCommit, destinationCommit);
StashPullRequestComment commentResponse;
commentResponse =
this.client.postPullRequestComment(pullRequest.getId(), comment, buildCommandCommentId);
Expand Down Expand Up @@ -579,17 +584,12 @@ public void postFinishedComment(
String message = getMessageForBuildResult(buildResult);
String comment =
format(
BUILD_MARKER,
BUILD_FINISH_MESSAGE,
job.getDisplayName(),
sourceCommit,
destinationCommit)
+ format(
BUILD_FINISH_SENTENCE,
message,
buildUrl,
buildNumber,
duration);
BUILD_MARKER,
BUILD_FINISH_MESSAGE,
job.getDisplayName(),
sourceCommit,
destinationCommit)
+ format(BUILD_FINISH_SENTENCE, message, buildUrl, buildNumber, duration);

comment = comment.concat(additionalComment);

Expand Down Expand Up @@ -684,7 +684,8 @@ private void deletePreviousBuildFinishedComments(StashPullRequestResponseValue p
continue;
}

String project_build_finished = format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
String project_build_finished =
format(BUILD_STATUS_REGEX, BUILD_FINISH_MESSAGE, job.getDisplayName());
Matcher finishMatcher =
Pattern.compile(project_build_finished, Pattern.CASE_INSENSITIVE).matcher(content);

Expand Down