internal

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgreementReached

func AgreementReached(members []string, votes map[string]bool, opts *AgreementOptions) (bool, string)

AgreementReached determines whether members have reached an agreement If the number of members who answered true is greater than the threshold the function returns true.

func GenerateReviewMap

func GenerateReviewMap(reviews []*github.PullRequestReview) map[string]bool

func GenerateTestWebhookRouter added in v0.5.0

func GenerateTestWebhookRouter(secret []byte, apiToken, keyfile string) *mux.Router

func NewWebhookHandler

func NewWebhookHandler(secret []byte, integrationID int, keyfile string) *mux.Router

func RemoveStaleReviews

func RemoveStaleReviews(currentSha string, reviews []*github.PullRequestReview) []*github.PullRequestReview

TODO: Write a test

Types

type AgreementOptions

type AgreementOptions struct {
	Threshold      int
	NeedsConsensus bool
}

type GithubWebhookHandler

type GithubWebhookHandler struct {
	Secret []byte
	// contains filtered or unexported fields
}

type UnirConfig

type UnirConfig struct {
	Whitelist          []string `yaml:"whitelist"`
	ApprovalsNeeded    int      `yaml:"approvals_needed"`
	ConsensusNeeded    bool     `yaml:"consensus_needed"`
	MergeMethod        string   `yaml:"merge_method"`
	MergeBlockKeywords []string `yaml:"merge_block_keywords"`
}

func GrabConfig

func GrabConfig(ctx context.Context, client *github.Client, repo, owner string, baseRef string) (UnirConfig, error)

func ReadConfig

func ReadConfig(input []byte) (UnirConfig, error)

Jump to

Keyboard shortcuts

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