reviewer

package
v0.0.0-...-ec18ef4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFileUsed = viper.ConfigFileUsed

ConfigFileUsed contains the function used to get Configuration file used

View Source
var GetString = viper.GetString

GetString contains the function used to lookup environment variables.

View Source
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

func NewConfig

func NewConfig(viper *viper.Viper) *Config

NewConfig is the constructor for Config.

func (*Config) AllKeys

func (c *Config) AllKeys() []string

AllKeys returns all keys regardless where they are set

func (*Config) GetString

func (c *Config) GetString(key string) string

GetString returns the value associated with the key as a string

type ConfigRepositoriesChecker

type ConfigRepositoriesChecker interface {
	AllKeys() []string
	GetString(key string) string
}

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 GetClient

func GetClient() (*GHClient, error)

GetClient returns a github.Client authenticated.

func NewGHClient

func NewGHClient(httpClient *http.Client) *GHClient

NewGHClient is the constructor for GHClient.

type PullRequestInfo

type PullRequestInfo struct {
	Number int // id of the pull request
	Title  string
	Score  int
}

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.

Jump to

Keyboard shortcuts

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