pulls

package
v0.0.0-...-7a0fe3b Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

package pulls deals with munging of github pull requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabelsWithPrefix

func GetLabelsWithPrefix(labels []github.Label, prefix string) []string

func HasLabel

func HasLabel(labels []github.Label, name string) bool

func MungePullRequests

func MungePullRequests(client *github.Client, pullMungers string, opts opts.MungeOptions) error

func RegisterMunger

func RegisterMunger(munger Munger) error

func RegisterMungerOrDie

func RegisterMungerOrDie(munger Munger)

Types

type BlunderbussConfig

type BlunderbussConfig struct {
	PrefixMap map[string][]string `json:"prefixMap,omitempty" yaml:"prefixMap,omitempty"`
}

A BlunderbussConfig maps a set of file prefixes to a set of owner names (github users)

func (*BlunderbussConfig) FindOwners

func (b *BlunderbussConfig) FindOwners(filename string) []string

type BlunderbussMunger

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

func (*BlunderbussMunger) MungePullRequest

func (b *BlunderbussMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (*BlunderbussMunger) Name

func (b *BlunderbussMunger) Name() string

type LGTMAfterCommitMunger

type LGTMAfterCommitMunger struct{}

func (LGTMAfterCommitMunger) MungePullRequest

func (LGTMAfterCommitMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (LGTMAfterCommitMunger) Name

type Munger

type Munger interface {
	// Take action on a specific pull request includes:
	//   * The org/user pair for the PR
	//   * The PR object
	//   * The issue object for the PR, github stores some things (e.g. labels) in an "issue" object with the same number as the PR
	//   * The commits for the PR
	//   * The events on the PR
	//   * dryrun, if true, the munger should take no action, and only report what it would have done.
	MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)
	Name() string
}

type NeedsRebaseMunger

type NeedsRebaseMunger struct{}

func (NeedsRebaseMunger) MungePullRequest

func (NeedsRebaseMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (NeedsRebaseMunger) Name

func (NeedsRebaseMunger) Name() string

type OkToTestMunger

type OkToTestMunger struct{}

OkToTestMunger looks for situations where a reviewer has LGTM'd a PR, but it isn't ok to test by the k8s-bot, and adds an 'ok to test' comment to the PR.

func (OkToTestMunger) MungePullRequest

func (OkToTestMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (OkToTestMunger) Name

func (OkToTestMunger) Name() string

type PRSizeMunger

type PRSizeMunger struct{}

func (PRSizeMunger) MungePullRequest

func (PRSizeMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (PRSizeMunger) Name

func (PRSizeMunger) Name() string

type PingCIMunger

type PingCIMunger struct{}

PingCIMunger looks for situations CI (Travis | Shippable) has flaked for some reason and we want to re-run them. Achieves this by closing and re-opening the pr

func (PingCIMunger) MungePullRequest

func (PingCIMunger) MungePullRequest(client *github.Client, pr *github.PullRequest, issue *github.Issue, commits []github.RepositoryCommit, events []github.IssueEvent, opts opts.MungeOptions)

func (PingCIMunger) Name

func (PingCIMunger) Name() string

Jump to

Keyboard shortcuts

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