Documentation
¶
Index ¶
- Variables
- func CheckFile() error
- func CheckRepositories() error
- func CheckRepositoriesData(config ConfigRepositoriesChecker) (s string, err error)
- func Configure()
- func Execute(DryRun bool) bool
- func IsMergeable(pullRequest *github.PullRequest) bool
- func Merge(client *GHClient, owner string, repo string, number int) (*github.PullRequestMergeResult, error)
- func PassedTests(client *GHClient, pullRequest *github.PullRequest, owner string, repo string) (bool, error)
- type ChangesServicer
- type Config
- type ConfigRepositoriesChecker
- type GHClient
- type PullRequestInfo
- type RepositoriesServicer
- type TicketsServicer
Constants ¶
This section is empty.
Variables ¶
var ConfigFileUsed = viper.ConfigFileUsed
ConfigFileUsed contains the function used to get Configuration file used
var GetString = viper.GetString
GetString contains the function used to lookup environment variables.
var IsSet = viper.IsSet
IsSet contains the function used to check if key is set
Functions ¶
func CheckFile ¶
func CheckFile() error
CheckFile checks if the configuration file exists and is not empty
func CheckRepositories ¶
func CheckRepositories() error
CheckRepositories checks if the configuration file has repositories
func CheckRepositoriesData ¶
func CheckRepositoriesData(config ConfigRepositoriesChecker) (s string, err error)
CheckRepositoriesData checks if all the repositories have all the parameters set
func Configure ¶
func Configure()
Configure runs all the checks needed for the config file to be set up correctly and prints the repositories available
func IsMergeable ¶
func IsMergeable(pullRequest *github.PullRequest) bool
IsMergeable returns true if the PullRequest is mergeable.
func Merge ¶
func Merge(client *GHClient, owner string, repo string, number int) (*github.PullRequestMergeResult, error)
Merge does the merge.
func PassedTests ¶
func PassedTests(client *GHClient, pullRequest *github.PullRequest, owner string, repo string) (bool, error)
PassedTests checks if the PR statuses are ok.
Types ¶
type ChangesServicer ¶
type ChangesServicer interface { List(string, string, *github.PullRequestListOptions) ([]github.PullRequest, *github.Response, error) Get(string, string, int) (*github.PullRequest, *github.Response, error) Merge(string, string, int, string) (*github.PullRequestMergeResult, *github.Response, error) }
ChangesServicer is an interface for listing changes.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a wrapper around Viper
func (*Config) GetStringSlice ¶
GetStringSlice returns the value associated with the key as an slice of strings
type ConfigRepositoriesChecker ¶
ConfigRepositoriesChecker is an interface for checking Viper's keys or getting their values
type GHClient ¶
type GHClient struct { Changes ChangesServicer Tickets TicketsServicer Repositories RepositoriesServicer // contains filtered or unexported fields }
GHClient is the wrapper around github.Client.
func NewGHClient ¶
NewGHClient is the constructor for GHClient.
type PullRequestInfo ¶
PullRequestInfo contains the id, title, and CR score of a pull request.
func GetPullRequestInfos ¶
func GetPullRequestInfos(client *GHClient, owner string, repo string, allowedUserLogins []string) ([]PullRequestInfo, error)
GetPullRequestInfos returns the list of pull requests and the CR success score based on comments
type RepositoriesServicer ¶
type RepositoriesServicer interface {
GetCombinedStatus(string, string, string, *github.ListOptions) (*github.CombinedStatus, *github.Response, error)
}
RepositoriesServicer is an interface for listing repositories.
type TicketsServicer ¶
type TicketsServicer interface {
ListComments(string, string, int, *github.IssueListCommentsOptions) ([]github.IssueComment, *github.Response, error)
}
TicketsServicer is an interface for listing changes.