Documentation ¶
Index ¶
- type Command
- type FakeGitHub
- func NewAlwaysFailsFakeGitHub() *FakeGitHub
- func NewAlwaysFailsOnGetDefaultBranchFakeGitHub() *FakeGitHub
- func NewAlwaysReturnsFalseFakeGitHub() *FakeGitHub
- func NewAlwaysSucceedsFakeGitHub() *FakeGitHub
- func NewAlwaysThrowNoPRFound() *FakeGitHub
- func NewFakeGitHub(h func(command Command, args []string) (bool, error), ...) *FakeGitHub
- func (f *FakeGitHub) AssertCalledWith(t *testing.T, expected [][]string)
- func (f *FakeGitHub) Clone(_ io.Writer, workingDir string, fullRepoName string) error
- func (f *FakeGitHub) ClosePullRequest(_ io.Writer, workingDir string, branchName string) error
- func (f *FakeGitHub) CreatePullRequest(_ io.Writer, workingDir string, metadata PullRequest) (didCreate bool, err error)
- func (f *FakeGitHub) ForkAndClone(_ io.Writer, workingDir string, fullRepoName string) error
- func (f *FakeGitHub) GetDefaultBranchName(_ io.Writer, workingDir string, fullRepoName string) (string, error)
- func (f *FakeGitHub) GetPR(_ io.Writer, workingDir string, _ string) (*PrStatus, error)
- func (f *FakeGitHub) UpdatePRDescription(_ io.Writer, workingDir string, title string, body string) error
- type GitHub
- type NoPRFoundError
- type PrStatus
- type PrStatusResponse
- type PullRequest
- type ReactionGroup
- type ReactionGroupUsers
- type RealGitHub
- func (r *RealGitHub) Clone(output io.Writer, workingDir string, fullRepoName string) error
- func (r *RealGitHub) ClosePullRequest(output io.Writer, workingDir string, branchName string) error
- func (r *RealGitHub) CreatePullRequest(output io.Writer, workingDir string, pr PullRequest) (didCreate bool, err error)
- func (r *RealGitHub) ForkAndClone(output io.Writer, workingDir string, fullRepoName string) error
- func (r *RealGitHub) GetDefaultBranchName(output io.Writer, workingDir string, fullRepoName string) (string, error)
- func (r *RealGitHub) GetPR(output io.Writer, workingDir string, branchName string) (*PrStatus, error)
- func (r *RealGitHub) UpdatePRDescription(output io.Writer, workingDir string, title string, body string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeGitHub ¶
type FakeGitHub struct {
// contains filtered or unexported fields
}
func NewAlwaysFailsFakeGitHub ¶
func NewAlwaysFailsFakeGitHub() *FakeGitHub
func NewAlwaysFailsOnGetDefaultBranchFakeGitHub ¶
func NewAlwaysFailsOnGetDefaultBranchFakeGitHub() *FakeGitHub
func NewAlwaysReturnsFalseFakeGitHub ¶
func NewAlwaysReturnsFalseFakeGitHub() *FakeGitHub
func NewAlwaysSucceedsFakeGitHub ¶
func NewAlwaysSucceedsFakeGitHub() *FakeGitHub
func NewAlwaysThrowNoPRFound ¶
func NewAlwaysThrowNoPRFound() *FakeGitHub
func NewFakeGitHub ¶
func (*FakeGitHub) AssertCalledWith ¶
func (f *FakeGitHub) AssertCalledWith(t *testing.T, expected [][]string)
func (*FakeGitHub) ClosePullRequest ¶
func (*FakeGitHub) CreatePullRequest ¶
func (f *FakeGitHub) CreatePullRequest(_ io.Writer, workingDir string, metadata PullRequest) (didCreate bool, err error)
func (*FakeGitHub) ForkAndClone ¶
func (*FakeGitHub) GetDefaultBranchName ¶
func (*FakeGitHub) UpdatePRDescription ¶
type GitHub ¶
type GitHub interface { ForkAndClone(output io.Writer, workingDir string, fullRepoName string) error Clone(output io.Writer, workingDir string, fullRepoName string) error CreatePullRequest(output io.Writer, workingDir string, metadata PullRequest) (didCreate bool, err error) ClosePullRequest(output io.Writer, workingDir string, branchName string) error UpdatePRDescription(output io.Writer, workingDir string, title string, body string) error GetPR(output io.Writer, workingDir string, branchName string) (*PrStatus, error) GetDefaultBranchName(output io.Writer, workingDir string, fullRepoName string) (string, error) }
type NoPRFoundError ¶
GetPR is a helper function to retrieve the PR associated with the branch Name
func (*NoPRFoundError) Error ¶
func (e *NoPRFoundError) Error() string
type PrStatus ¶
type PrStatus struct { Closed bool `json:"closed"` HeadRefName string `json:"headRefName"` Mergeable string `json:"mergeable"` Number int `json:"number"` ReactionGroups []ReactionGroup `json:"reactionGroups"` ReviewDecision string `json:"reviewDecision"` State string `json:"state"` Title string `json:"title"` Url string `json:"url"` }
type PrStatusResponse ¶
type PullRequest ¶
type ReactionGroup ¶
type ReactionGroup struct { Content string Users ReactionGroupUsers }
type ReactionGroupUsers ¶
type ReactionGroupUsers struct {
TotalCount int
}
type RealGitHub ¶
type RealGitHub struct{}
func NewRealGitHub ¶
func NewRealGitHub() *RealGitHub
func (*RealGitHub) ClosePullRequest ¶
func (*RealGitHub) CreatePullRequest ¶
func (r *RealGitHub) CreatePullRequest(output io.Writer, workingDir string, pr PullRequest) (didCreate bool, err error)
func (*RealGitHub) ForkAndClone ¶
func (*RealGitHub) GetDefaultBranchName ¶
func (*RealGitHub) UpdatePRDescription ¶
Click to show internal directories.
Click to hide internal directories.