Skip to content

Commit 5c6ead2

Browse files
authored
[JENKINS-48594] Perform scanning of PRs first before scanning branches (#1060)
Swap the retrieveBranches method call with retrievePullRequests to process pull requests before branches. Most likely, the event-triggered pull request build should start before the branch build and grab free executors early.
1 parent fc43b91 commit 5c6ead2

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

pom.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
</licenses>
2525

2626
<properties>
27-
<revision>936.4.1</revision>
27+
<revision>937.0.0</revision>
2828
<changelist>-SNAPSHOT</changelist>
2929
<gitHubRepo>jenkinsci/bitbucket-branch-source-plugin</gitHubRepo>
30-
<jenkins.baseline>2.479</jenkins.baseline>
31-
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
30+
<jenkins.baseline>2.504</jenkins.baseline>
31+
<jenkins.version>${jenkins.baseline}.2</jenkins.version>
3232
<hpi.compatibleSinceVersion>936.0.0</hpi.compatibleSinceVersion>
33-
<!-- Jenkins.MANAGE is still in Beta -->
34-
<useBeta>true</useBeta>
3533
<tagNameFormat>@{project.version}</tagNameFormat>
3634
</properties>
3735

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ protected void retrieve(@CheckForNull SCMSourceCriteria criteria, @NonNull SCMHe
365365
request.setPullRequests(getBitbucketPullRequestsFromEvent(hasPrEvent, listener));
366366
}
367367
// now server the request
368-
if (request.isFetchBranches() && !request.isComplete()) {
369-
// Search branches
370-
retrieveBranches(request);
371-
}
372368
if (request.isFetchPRs() && !request.isComplete()) {
373369
// Search pull requests
374370
retrievePullRequests(request);
375371
}
372+
if (request.isFetchBranches() && !request.isComplete()) {
373+
// Search branches
374+
retrieveBranches(request);
375+
}
376376
if (request.isFetchTags() && !request.isComplete()) {
377377
// Search tags
378378
retrieveTags(request);

0 commit comments

Comments
 (0)