public class BitbucketServerPullRequestHandler extends Object
Constructor and Description |
---|
BitbucketServerPullRequestHandler(@NotNull com.atlassian.stash.rest.client.api.StashClient stashClient,
@NotNull VcsRepositoryData vcsRepositoryData) |
Modifier and Type | Method and Description |
---|---|
@NotNull com.atlassian.stash.rest.client.api.entity.PullRequestMergeability |
canMergePullRequest(long pullRequestId)
Retrieves given pull request mergeability state.
|
@Nullable String |
getCreatePullRequestUrl(@Nullable String branchName)
Retrieves pull request creation URL.
|
@NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> |
getOpenPullRequests(@Nullable String branchName,
long start,
long limit,
long avatarSize)
Retrieves open pull requests.
|
@NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus |
mergePullRequest(long pullRequestId,
long version)
Merges given pull request.
|
public BitbucketServerPullRequestHandler(@NotNull @NotNull com.atlassian.stash.rest.client.api.StashClient stashClient, @NotNull @NotNull VcsRepositoryData vcsRepositoryData)
@NotNull public @NotNull com.atlassian.stash.rest.client.api.entity.Page<com.atlassian.stash.rest.client.api.entity.PullRequestStatus> getOpenPullRequests(@Nullable @Nullable String branchName, long start, long limit, long avatarSize)
Note (as of BBS 4.10-4.12 at least) this method will return only cached values of pull request merge outcome,
if no cached value is found the PullRequestStatus.getMergeOutcome()
will be empty. Consider using
canMergePullRequest(long)
to trigger actual checks when necessary.
trigger calculation of pull request mergeability state if no
current mergeability status is cached, what is not the case re
getOpenPullRequests(String, long, long, long)
.
branchName
- if empty, branch is taken from repository definitionstart
- index of the first result to retrieve (for paging)limit
- total number of results to retrieve after start (for Paging)avatarSize
- desired avatar size@Nullable public @Nullable String getCreatePullRequestUrl(@Nullable @Nullable String branchName)
branchName
- if empty, branch is taken from repository definition@NotNull public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestStatus mergePullRequest(long pullRequestId, long version)
pullRequestId
- pull request id, assigned by BBSversion
- version version of pull request data user had seen when deciding to merge it. BBS would
reject merge attempt if data changed in the meantime, forcing user to refresh the view@NotNull public @NotNull com.atlassian.stash.rest.client.api.entity.PullRequestMergeability canMergePullRequest(long pullRequestId)
Note (as of BBS 4.10-4.12 at least) this method will trigger calculation of pull request mergeability state if no
current mergeability status is cached, what is not the case re
getOpenPullRequests(String, long, long, long)
.
pullRequestId
- pull request id, assigned by BBSCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.
View cookie preferences