Documentation ¶
Index ¶
- Variables
- func CheckFile() error
- func CheckRepositories() error
- func CheckRepositoriesData(config ConfigRepositoriesChecker) (s string, err error)
- func Configure()
- func IsMergeable(pullRequest *github.PullRequest) bool
- func PassedTests(client *GHClient, pullRequest *github.PullRequest, owner string, repo string) (bool, error)
- type ChangesServicer
- type Config
- type ConfigRepositoriesChecker
- type GHClient
- type PullRequestInfo
- 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 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)
}
ChangesServicer is an interface for listing changes.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is a wrapper around Viper
type ConfigRepositoriesChecker ¶
ConfigRepositoriesChecker is an interface for checking Viper's keys or getting their values
type GHClient ¶
type GHClient struct { Changes ChangesServicer Tickets TicketsServicer // 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) ([]PullRequestInfo, error)
GetPullRequestInfos returns the list of pull requests and the CR success score based on comments
type TicketsServicer ¶
type TicketsServicer interface {
ListComments(string, string, int, *github.IssueListCommentsOptions) ([]github.IssueComment, *github.Response, error)
}
TicketsServicer is an interface for listing changes.