Skip to content

Commit cfcfdf1

Browse files
committed
[JENKINS-61290] hard to see why a branch was not inspected - log them
BranchDiscoveryTrait.java : report into scan log if a branch is ignored (because it is or is-not a source of PR, based on user choice of settings) similarly as proposed and refined for github-branch-source-plugin in jenkinsci/github-branch-source-plugin#284
1 parent d65621f commit cfcfdf1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BranchDiscoveryTrait.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead he
245245
BitbucketRepository source = pullRequest.getSource().getRepository();
246246
if (fullName.equalsIgnoreCase(source.getFullName())
247247
&& pullRequest.getSource().getBranch().getName().equals(head.getName())) {
248+
// End the format with newline to avoid logging this
249+
// result blocked together with a later indexed branch
250+
request.listener().getLogger().format(
251+
"Ignoring %s because current strategy excludes branches "
252+
+ "that ARE also filed as a pull request%n"
253+
, head.toString());
248254
return true;
249255
}
250256
}
@@ -272,6 +278,10 @@ public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead he
272278
return false;
273279
}
274280
}
281+
request.listener().getLogger().format(
282+
"Ignoring %s because current strategy excludes branches "
283+
+ "that ARE NOT also filed as a pull request%n"
284+
, head.toString());
275285
return true;
276286
}
277287
return false;

0 commit comments

Comments
 (0)