From 5dd15063b56f36a6b6df6718e0a01eae0050659d Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 19 Sep 2018 16:15:43 +0300 Subject: Use simple description of aborted build --- .../plugins/bbprb/BitbucketBuildTrigger.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/main/java/org/jenkinsci') diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildTrigger.java b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildTrigger.java index 5481aee..2946d7a 100644 --- a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildTrigger.java +++ b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildTrigger.java @@ -215,8 +215,13 @@ public class BitbucketBuildTrigger extends Trigger> { Run build = (Run)o; if (build.isBuilding() && hasCauseFromTheSamePullRequest(build.getCauses(), bitbucketCause)) { - logger.fine("Aborting build: " + build + " since PR is outdated"); - setBuildDescription(build); + logger.fine("Aborting '" + build + "' since the PR is outdated"); + try { + build.setDescription("Aborted build since the PR is outdated"); + } catch (IOException e) { + logger.warning("Could not set build description: " + + e.getMessage()); + } final Executor executor = build.getExecutor(); if (executor == null) { throw new IllegalStateException("Executor can't be NULL"); @@ -227,16 +232,6 @@ public class BitbucketBuildTrigger extends Trigger> { } } - private void setBuildDescription(final Run build) { - try { - build.setDescription( - "Aborting build by `Bitbucket Pullrequest Builder Plugin`: " + build + - " since PR is outdated"); - } catch (IOException e) { - logger.warning("Could not set build description: " + e.getMessage()); - } - } - private boolean hasCauseFromTheSamePullRequest(@Nullable List causes, @Nullable BitbucketCause pullRequestCause) { -- cgit v1.2.3