@@ -1053,6 +1053,19 @@ public GHPermissionType fetch(String username) throws IOException, InterruptedEx
1053
1053
}
1054
1054
});
1055
1055
1056
+ if (request .isFetchPRs ()) {
1057
+ // JENKINS-56996 / JENKINS-73791
1058
+ // PRs are one the most error prone areas for scans
1059
+ // Branches and tags are contained only the current repo, PRs go across forks
1060
+ // FileNotFoundException can occur in a number of situations
1061
+ // When this happens, it is not ideal behavior but it is better to let the PR be
1062
+ // orphaned
1063
+ // and the orphan strategy control the result than for this error to stop scanning
1064
+ // (For Org scanning this is particularly important.)
1065
+ // If some more general IO exception is thrown, we will still fail.
1066
+ validatePullRequests (request );
1067
+ }
1068
+
1056
1069
if (request .isFetchBranches ()
1057
1070
&& !request .isComplete ()
1058
1071
&& this .shouldRetrieve (observer , event , BranchSCMHead .class )) {
@@ -1067,6 +1080,7 @@ public GHPermissionType fetch(String username) throws IOException, InterruptedEx
1067
1080
HyperlinkNote .encodeTo (
1068
1081
resolvedRepositoryUrl + "/tree/" + branchName , branchName ));
1069
1082
BranchSCMHead head = new BranchSCMHead (branchName );
1083
+
1070
1084
if (request .process (
1071
1085
head ,
1072
1086
new SCMRevisionImpl (head , branch .getSHA1 ()),
@@ -1081,8 +1095,6 @@ public SCMSourceCriteria.Probe create(
1081
1095
}
1082
1096
},
1083
1097
new CriteriaWitness (listener ))) {
1084
- listener .getLogger ()
1085
- .format ("%n %d branches were processed (query completed)%n" , count );
1086
1098
break ;
1087
1099
}
1088
1100
}
@@ -1095,18 +1107,6 @@ public SCMSourceCriteria.Probe create(
1095
1107
int count = 0 ;
1096
1108
int errorCount = 0 ;
1097
1109
Map <Boolean , Set <ChangeRequestCheckoutStrategy >> strategies = request .getPRStrategies ();
1098
-
1099
- // JENKINS-56996
1100
- // PRs are one the most error prone areas for scans
1101
- // Branches and tags are contained only the current repo, PRs go across forks
1102
- // FileNotFoundException can occur in a number of situations
1103
- // When this happens, it is not ideal behavior but it is better to let the PR be
1104
- // orphaned
1105
- // and the orphan strategy control the result than for this error to stop scanning
1106
- // (For Org scanning this is particularly important.)
1107
- // If some more general IO exception is thrown, we will still fail.
1108
-
1109
- validatePullRequests (request );
1110
1110
for (final GHPullRequest pr : request .getPullRequests ()) {
1111
1111
int number = pr .getNumber ();
1112
1112
try {
0 commit comments