Documentation
¶
Overview ¶
Package pr names a GitHub pull request.
Index ¶
Constants ¶
const ( ReviewApproved = "APPROVED" ReviewChangesRequested = "CHANGES_REQUESTED" ReviewCommented = "COMMENTED" ReviewDismissed = "DISMISSED" )
The states of a review.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct{}
Codec is the unit codec of provider "github".
func (Codec) Equal ¶ added in v0.2.0
Equal folds case, as GitHub compares owners, repositories and logins.
func (Codec) Provider ¶
func (Codec) Provider() unit.ProviderID
type Facts ¶
type Facts struct {
Ref
State string
IsDraft bool
Title string
HeadRefName string
BaseRefName string
HeadRefOid string
IsCrossRepository bool
// Visibility is the repository's visibility, lower-case: public,
// private or internal; empty when not read.
Visibility string
Author string
AuthorAssociation string
ReviewDecision string
// Mergeable is MERGEABLE, CONFLICTING or UNKNOWN (GitHub computes it
// lazily); empty when not read.
Mergeable string
// ChecksState is the status check rollup of the head commit; empty when
// the repository has no checks.
ChecksState string
// NewestChangesRequestOid is the commit the newest CHANGES_REQUESTED
// review was left on.
NewestChangesRequestOid string
Reviews []Review
LatestReviews []Review
Comments []Comment
ReviewRequests []string
// ViewerRequested says the viewer's review is requested by name.
ViewerRequested bool
Commits []Commit
// OpenThreads are the unresolved review threads; ThreadsTotal counts
// every thread, read or not.
OpenThreads []Thread
ThreadsTotal int
Checks []Check
Labels []string
}
Facts are a pull request as the decide rules read it.
type Ref ¶
type Ref struct {
Owner string `json:"owner"`
Repo string `json:"repo"`
Number int `json:"number"`
}
func RefOf ¶ added in v0.2.0
RefOf is the pull request u names; false for a unit of another provider or a key that names none.
type Review ¶
type Review struct {
ID string
State string
Author string
SubmittedAt time.Time
CommitOid string
// HasContent is set by the author queries only. GitHub requires a body or
// comments on the states other than APPROVED; an approval counts only
// with inline comments, as reading every body would weigh the query.
HasContent bool
// ByViewer is set by the queries that ask GitHub whether the viewer wrote the review.
ByViewer bool
}