AddTestPullRequestTask adds new test tasks by given head/base repository and head/base branch, and generate new patch for testing as needed.
AddToTaskQueue adds itself to pull request test task queue.
ChangeTargetBranch changes the target branch of this pull request, as the given user.
CheckFileProtection check file Protection
CheckPRReadyToMerge checks whether the PR is ready to be merged (reviews and status checks)
CheckPrsForBaseBranch check all pulls with bseBrannch
CloseBranchPulls close all the pull requests who's head branch is the branch
CloseRepoBranchesPulls close all pull requests which head branches are in the given repository
CreateCodeComment creates a comment on the code line
DownloadDiffOrPatch will write the patch for the pr to the writer
GetDiverging determines how many commits a PR is ahead or behind the PR base branch
GetLastCommitStatus returns list of commit statuses for latest commit on this pull request.
GetPullRequestCommitStatusState returns pull request merged commit status state
GetSquashMergeCommitMessages returns the commit messages between head and merge base (if there is one)
Init runs the task queue to test all the checking status pull requests
InitializePullRequests checks and tests untested patches of pull requests.
func IsCommitStatusContextSuccess(commitStatuses *models.CommitStatus, requiredContexts string) bool
IsCommitStatusContextSuccess returns true if all required status check contexts succeed.
IsHeadEqualWithBranch returns if the commits of branchName are available in pull request head
IsPullCommitStatusPass returns if all required status checks PASS
IsSignedIfRequired check if merge will be signed if required
func IsUserAllowedToMerge(pr *models.PullRequest, p models.Permission, user *models.User) (bool, error)
IsUserAllowedToMerge check if user is allowed to merge PR with given permissions and branch protections
IsUserAllowedToUpdate check if user is allowed to update PR with given permissions and branch protections
LFSPush pushes lfs objects referred to in new commits in the head repository from the base repository
func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repository, mergeStyle models.MergeStyle, message string) (err error)
Merge merges pull request to base repository. Caller should check PR is ready to be merged (review and status checks) FIXME: add repoWorkingPull make sure two merges does not happen at same time.
func MergeRequiredContextsCommitStatus(commitStatuses *models.CommitStatus, requiredContexts string) structs.CommitStatusState
MergeRequiredContextsCommitStatus returns a commit status state for given required contexts
func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs int64, uuids string, pr *models.PullRequest, assigneeIDs int64) error
NewPullRequest creates new pull request with labels for repository.
PushToBaseRepo pushes commits from branches of head repository to corresponding branches of base repository. FIXME: Only push branches that are actually updates?
SubmitReview creates a review out of the existing pending review or creates a new one if no pending review exist
TestPatch will test whether a simple patch will apply
Update updates pull request with base branch.