shepherd

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShepardBot

type ShepardBot struct {
	// contains filtered or unexported fields
}

ShepardBot is the main bot object that gets created

func NewBot

func NewBot(baseURL string, token string, maintainerTeamName string, orgName string) (*ShepardBot, error)

NewBot creates a new ShepardBot based off the baseURL(provide empty string if you want to default to basic github)

func (*ShepardBot) CheckCodeOwners

func (s *ShepardBot) CheckCodeOwners(repo *github.Repository, branch *github.Branch) (bool, *github.PullRequest, error)

CheckCodeOwners verifies if the CODEOWNERS file exist in the repo, in the specfied branch

func (*ShepardBot) CheckProtectionBranch

func (s *ShepardBot) CheckProtectionBranch(repo *github.Repository, branch *github.Branch) (bool, error)

CheckProtectionBranch verifies if the the branch is a protected branch and verifies if it has to be verified by CODEOWNERS

func (*ShepardBot) CheckTeamRepoManagement

func (s *ShepardBot) CheckTeamRepoManagement(repo *github.Repository) (bool, error)

CheckTeamRepoManagement verifies if the team is an admin of the project

func (*ShepardBot) DoCreateCodeowners

func (s *ShepardBot) DoCreateCodeowners(repo *github.Repository, branch *github.Branch) (*github.PullRequest, error)

DoCreateCodeowners function will create a CODEOWNERS file in a branch, create a PR against the repo and set the reviewer (of the CODEOWNERS PR) as the maintainer team configured

func (*ShepardBot) DoProtectBranch

func (s *ShepardBot) DoProtectBranch(repo *github.Repository, branch *github.Branch) error

DoProtectBranch sets the specfied branch to be protected.

func (*ShepardBot) DoTeamRepoManagement

func (s *ShepardBot) DoTeamRepoManagement(repo *github.Repository) error

DoTeamRepoManagement sets the team as an admin of the repo

func (*ShepardBot) GetBranch

func (s *ShepardBot) GetBranch(repo *github.Repository, branchName string) (*github.Branch, error)

GetBranch function return a branch obj depending on the name provided

func (*ShepardBot) RetreiveRepos

func (s *ShepardBot) RetreiveRepos() ([]*github.Repository, error)

RetreiveRepos returns a list of repos within the organization

type ShepardError

type ShepardError struct {
	// contains filtered or unexported fields
}

ShepardError is a generic error container for reporting errors/http status code errors from the Github API

func (*ShepardError) Error

func (e *ShepardError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL