Documentation ¶
Index ¶
- Constants
- func DisplayCommentAdded(cmt gh.Comment)
- func DisplayComments(comments []gh.Comment)
- func DisplayContributors(c *cli.Context, contributors []*gh.Contributor)
- func DisplayIssue(issue *gh.Issue, comments []gh.Comment)
- func DisplayIssues(c *cli.Context, v interface{}, notrunc bool)
- func DisplayPatch(r io.Reader) error
- func DisplayPullRequest(pr *gh.PullRequest, comments []gh.Comment)
- func DisplayPullRequests(c *cli.Context, pulls []*gh.PullRequest, notrunc bool)
- func DisplayReviewers(c *cli.Context, reviewers map[string][]*Maintainer)
- func GetMaintainerManagerEmail() (string, error)
- func GetOriginUrl() (string, string, error)
- func Git(args ...string) error
- func HumanDuration(d time.Duration) string
- func ReviewPatch(src io.Reader, maintainersDirMap *map[string][]*Maintainer) (reviewers map[string][]*Maintainer, err error)
- func SaveConfig(config Config) error
- func WriteError(format string, err error)
- type ByAdditions
- type ByCommits
- type ByDeletions
- type Config
- type ContributorStats
- type Maintainer
- type MaintainerFile
- type MaintainerManager
- func (m *MaintainerManager) AddComment(number, comment string) (gh.Comment, error)
- func (m *MaintainerManager) Checkout(pr *gh.PullRequest) error
- func (m *MaintainerManager) GetComments(number string) ([]gh.Comment, error)
- func (m *MaintainerManager) GetContributors() ([]*gh.Contributor, error)
- func (m *MaintainerManager) GetFirstIssue(state, sortBy string) (*gh.Issue, error)
- func (m *MaintainerManager) GetFirstPullRequest(state, sortBy string) (*gh.PullRequest, error)
- func (m *MaintainerManager) GetGithubUser() (*gh.User, error)
- func (m *MaintainerManager) GetIssue(number string, comments bool) (*gh.Issue, []gh.Comment, error)
- func (m *MaintainerManager) GetIssues(state, assignee string) ([]*gh.Issue, error)
- func (m *MaintainerManager) GetIssuesFound(query string) ([]*gh.SearchItem, error)
- func (m *MaintainerManager) GetMaintainersDirMap() *map[string][]*Maintainer
- func (m *MaintainerManager) GetPullRequest(number string, comments bool) (*gh.PullRequest, []gh.Comment, error)
- func (m *MaintainerManager) GetPullRequestFiles(number string) ([]*gh.PullRequestFile, error)
- func (m *MaintainerManager) GetPullRequests(state, sort string) ([]*gh.PullRequest, error)
- func (m *MaintainerManager) GetPullRequestsThatICareAbout(showAll bool, state, sortQuery string) ([]*gh.PullRequest, error)
- func (m *MaintainerManager) IsMaintainer(userName string) bool
- func (m *MaintainerManager) MergePullRequest(number, comment string, force bool) (gh.Merge, error)
- func (m *MaintainerManager) PatchIssue(number string, issue *gh.Issue) (*gh.Issue, error)
- func (m *MaintainerManager) Repository() (*gh.Repository, error)
- type MaintainerManagerDirectoriesMap
Constants ¶
const ( MaintainerManagersFileName = "MAINTAINERS" NumWorkers = 10 )
Variables ¶
This section is empty.
Functions ¶
func DisplayCommentAdded ¶
func DisplayComments ¶
func DisplayContributors ¶
func DisplayContributors(c *cli.Context, contributors []*gh.Contributor)
func DisplayIssues ¶
Display Issues prints `issues` to standard output in a human-friendly tabulated format.
func DisplayPatch ¶
func DisplayPullRequest ¶
func DisplayPullRequest(pr *gh.PullRequest, comments []gh.Comment)
func DisplayPullRequests ¶
func DisplayPullRequests(c *cli.Context, pulls []*gh.PullRequest, notrunc bool)
func DisplayReviewers ¶
func DisplayReviewers(c *cli.Context, reviewers map[string][]*Maintainer)
func GetOriginUrl ¶
func HumanDuration ¶
HumanDuration returns a human-readable approximation of a duration This function is taken from the Docker project, and slightly modified to cap units at days. (eg. "About a minute", "4 hours ago", etc.) (c) 2013 Docker, inc. and the Docker authors (http://docker.io)
func ReviewPatch ¶
func ReviewPatch(src io.Reader, maintainersDirMap *map[string][]*Maintainer) (reviewers map[string][]*Maintainer, err error)
ReviewPatch reads a git-formatted patch from `src`, and for each file affected by the patch it assign its Maintainers based on the current repository tree directories The list of Maintainers are generated when the MaintainerManager object is instantiated.
The result is a map where the keys are the paths of files affected by the patch, and the values are the maintainers assigned to review that partiular file.
There is no duplicate checks: the same maintainer may be present in multiple entries of the map, or even multiple times in the same entry if the MAINTAINERS file has duplicate lines.
func SaveConfig ¶
func WriteError ¶
Types ¶
type ByAdditions ¶
type ByAdditions []ContributorStats
func (ByAdditions) Len ¶
func (a ByAdditions) Len() int
func (ByAdditions) Less ¶
func (a ByAdditions) Less(i, j int) bool
func (ByAdditions) Swap ¶
func (a ByAdditions) Swap(i, j int)
type ByCommits ¶
type ByCommits []ContributorStats
type ByDeletions ¶
type ByDeletions []ContributorStats
func (ByDeletions) Len ¶
func (a ByDeletions) Len() int
func (ByDeletions) Less ¶
func (a ByDeletions) Less(i, j int) bool
func (ByDeletions) Swap ¶
func (a ByDeletions) Swap(i, j int)
type Config ¶
func LoadConfig ¶
type ContributorStats ¶
type Maintainer ¶
type MaintainerFile ¶
type MaintainerFile map[string][]*Maintainer
func LoadMaintainerFile ¶
func LoadMaintainerFile(dir string) (MaintainerFile, error)
Currently not being used
func TopMostMaintainerFile ¶
func TopMostMaintainerFile(dir string) (MaintainerFile, error)
Currently not being used
TopMostMaintainerFile moves up the directory tree looking for a MAINTAINERS file, parses the top-most file it finds, and returns its contents. This is used to find the top-level maintainer of a project for certain privileged reviews, such as authorizing changes to a MAINTAINERS file.
type MaintainerManager ¶
type MaintainerManager struct {
// contains filtered or unexported fields
}
Top level type that manages a repository
func NewMaintainerManager ¶
func NewMaintainerManager(client *gh.Client, org, repo string) (*MaintainerManager, error)
func (*MaintainerManager) AddComment ¶
func (m *MaintainerManager) AddComment(number, comment string) (gh.Comment, error)
Add a comment to an existing pull request
func (*MaintainerManager) Checkout ¶
func (m *MaintainerManager) Checkout(pr *gh.PullRequest) error
Checkout the pull request into the working tree of the users repository. This will mimic the operations on the manual merge view
func (*MaintainerManager) GetComments ¶
func (m *MaintainerManager) GetComments(number string) ([]gh.Comment, error)
Return all comments for an issue or pull request
func (*MaintainerManager) GetContributors ¶
func (m *MaintainerManager) GetContributors() ([]*gh.Contributor, error)
Return contributors list
func (*MaintainerManager) GetFirstIssue ¶
func (m *MaintainerManager) GetFirstIssue(state, sortBy string) (*gh.Issue, error)
func (*MaintainerManager) GetFirstPullRequest ¶
func (m *MaintainerManager) GetFirstPullRequest(state, sortBy string) (*gh.PullRequest, error)
func (*MaintainerManager) GetGithubUser ¶
func (m *MaintainerManager) GetGithubUser() (*gh.User, error)
Get the user information from the authenticated user
func (*MaintainerManager) GetIssues ¶
func (m *MaintainerManager) GetIssues(state, assignee string) ([]*gh.Issue, error)
GetIssues queries the GithubAPI for all issues matching the state `state` and the assignee `assignee`. See http://developer.github.com/v3/issues/#list-issues-for-a-repository
func (*MaintainerManager) GetIssuesFound ¶
func (m *MaintainerManager) GetIssuesFound(query string) ([]*gh.SearchItem, error)
Return all issue found
func (*MaintainerManager) GetMaintainersDirMap ¶
func (m *MaintainerManager) GetMaintainersDirMap() *map[string][]*Maintainer
func (*MaintainerManager) GetPullRequest ¶
func (m *MaintainerManager) GetPullRequest(number string, comments bool) (*gh.PullRequest, []gh.Comment, error)
Return a single pull request Return pr's comments if requested
func (*MaintainerManager) GetPullRequestFiles ¶
func (m *MaintainerManager) GetPullRequestFiles(number string) ([]*gh.PullRequestFile, error)
Return all pull request Files
func (*MaintainerManager) GetPullRequests ¶
func (m *MaintainerManager) GetPullRequests(state, sort string) ([]*gh.PullRequest, error)
Return all pull requests
func (*MaintainerManager) GetPullRequestsThatICareAbout ¶
func (m *MaintainerManager) GetPullRequestsThatICareAbout(showAll bool, state, sortQuery string) ([]*gh.PullRequest, error)
Return all the pull requests that I care about
func (*MaintainerManager) IsMaintainer ¶
func (m *MaintainerManager) IsMaintainer(userName string) bool
func (*MaintainerManager) MergePullRequest ¶
Merge a pull request If no LGTMs are in the comments require force to be true
func (*MaintainerManager) PatchIssue ¶
Patch an issue
func (*MaintainerManager) Repository ¶
func (m *MaintainerManager) Repository() (*gh.Repository, error)
type MaintainerManagerDirectoriesMap ¶
type MaintainerManagerDirectoriesMap struct {
// contains filtered or unexported fields
}