Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ public class BitbucketSCMSource extends SCMSource {
*/
private String excludes = "";

/**
* Whether to skip discovered pull requests.
*/
private boolean skipPullRequests;

/**
* If true, a webhook will be auto-registered in the repository managed by this source.
*/
Expand Down Expand Up @@ -194,6 +199,15 @@ public void setExcludes(@NonNull String excludes) {
this.excludes = excludes;
}

public boolean isSkipPullRequests() {
return skipPullRequests;
}

@DataBoundSetter
public void setSkipPullRequests(boolean skipPullRequests) {
this.skipPullRequests = skipPullRequests;
}

public String getRepoOwner() {
return repoOwner;
}
Expand Down Expand Up @@ -277,8 +291,10 @@ protected void retrieve(SCMHeadObserver observer, final TaskListener listener) t

// Search branches
retrieveBranches(observer, listener);
// Search pull requests
retrievePullRequests(observer, listener);
if (!isSkipPullRequests()) {
// Search pull requests
retrievePullRequests(observer, listener);
}
}

private void retrievePullRequests(SCMHeadObserver observer, final TaskListener listener) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<f:entry title="${%Exclude branches}" field="excludes">
<f:textbox/>
</f:entry>
<f:entry field="skipPullRequests">
<f:checkbox title="${%Skip pull requests}" />
</f:entry>
<f:entry title="${%Checkout Credentials}" field="checkoutCredentialsId">
<c:select default="${descriptor.SAME}"/>
</f:entry>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<l:ajax>
<div>
Whether or not to create jobs for discovered pull requests.
</div>
</l:ajax>
</j:jelly>