Documentation
¶
Overview ¶
Package pullrequests opens the pull request of a publish, on the host's API, with the same credential that pushed it, and writes its body: who asked for the work and what gitd checked, so a reviewer reads in a minute what they would otherwise dig for.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
Body is a pull request's body: the platform's text first, when given, then the order it is merged in with the pull requests of its submodules, and gitd's account of the publish.
A superproject points at its submodules' new commits, so theirs are merged first, each with a merge commit: a squash or a rebase makes other commits, and leaves the superproject pointing at one its submodule's base does not have.
Types ¶
type Account ¶
type Account struct {
RequestedBy string
Provenance *gitdv1.Provenance
Subjects []string
Files int
Added int
Removed int
Rules publishing.Effective
Submodules []string
// MergeFirst are the pull requests of the submodules the publish points at, to be
// merged before this one; PartOf is the pull request a submodule's belongs to.
MergeFirst []string
PartOf string
}
Account is what a body tells of a publish.
type Opener ¶
type Opener struct {
// contains filtered or unexported fields
}
Opener opens pull requests on GitHub with the credential that reaches each repository.
func New ¶
func New(keys *credentials.Keys, github connections.GitHub) *Opener
New returns an opener reaching repositories with keys, and GitHub as github says.
func (*Opener) Open ¶
Open opens a pull request and then asks for its reviewers and labels; a review or a label that cannot be asked for is logged, and the pull request stays opened. Asked to update, it writes the title and body over those of the pull request already open from the branch, when one is, and leaves its base, draft, reviewers and labels as they are. A host gitd does not know as GitHub's is refused as unsupported.
type Request ¶
type Request struct {
Repository repo.Repo
Branch string
Given []credentials.Credential
Title string
Body string
Base string
Draft bool
Labels []string
Reviewers []string
Update bool
}
Request is a pull request to open from a published branch, with the credentials the publish was given. Update says to update the one already open from the branch, if one is, rather than open another.