aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorS.Nishio <nishio@densan-labs.net>2016-06-03 00:37:11 +0900
committerS.Nishio <nishio@densan-labs.net>2016-06-03 00:37:11 +0900
commitf80e2e06849aaebce3667d4fa40c62e63d77aceb (patch)
tree8c386cf46a99099c1dfacf5b17ce0b96a59a0edc /src/main/java
parentdc31b18970069ce2943ea8ce293cdcfb6c4045d6 (diff)
parent1b5c53304a368bb4b164b9a6fabc74f969beabf0 (diff)
downloadbbprb-f80e2e06849aaebce3667d4fa40c62e63d77aceb.tar.gz
Merge pull request #87 from frodeaa/ttp_multiple_jobs
Fix TTP only working for one of multiple jobs
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
index 4417d74..660ec21 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
@@ -182,12 +182,6 @@ public class BitbucketRepository {
logger.log(Level.INFO, "Post comment: {0} with original content {1}", new Object[]{ content, this.client.postPullRequestComment(pullRequestId, content).getId() });
}
- private boolean processTTPCommentBuildTags(String content, String buildKey) {
- if (!this.isTTPCommentBuildTags(content)) return true;
- logger.log(Level.INFO, "Processing ttp with build comment: {0}", content);
- return !this.hasMyBuildTagInTTPComment(content, buildKey);
- }
-
private boolean isTTPComment(String content) {
return content.toLowerCase().contains(BUILD_REQUEST_MARKER.toLowerCase());
}
@@ -241,6 +235,7 @@ public class BitbucketRepository {
boolean rebuildCommentAvailable = false;
if (comments != null) {
Collection<Pullrequest.Comment> filteredComments = this.filterPullRequestComments(comments);
+ boolean hasMyBuildTag = false;
for (Pullrequest.Comment comment : filteredComments) {
String content = comment.getContent();
if (this.isTTPComment(content)) {
@@ -249,10 +244,11 @@ public class BitbucketRepository {
"Rebuild comment available for commit {0} and comment #{1}",
new Object[]{ sourceCommit, comment.getId() }
);
- }
- rebuildCommentAvailable &= this.processTTPCommentBuildTags(content, buildKeyPart);
- if (!rebuildCommentAvailable) break;
+ }
+ if (isTTPCommentBuildTags(content))
+ hasMyBuildTag |= this.hasMyBuildTagInTTPComment(content, buildKeyPart);
}
+ rebuildCommentAvailable &= !hasMyBuildTag;
}
if (rebuildCommentAvailable) this.postBuildTagInTTPComment(id, "TTP build flag", buildKeyPart);