mungers

package
v0.0.0-...-5952ad4 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Overview

Package mungers deals with munging of github pull requests

Index

Constants

View Source
const (
	NOTIFNAME       = "INACTIVE-PULL-REQUEST"
	CREATIONTIMECAP = 36 * 30 * 24 * time.Hour //period since PR creation time
	COMMENTTIMECAP  = 7 * 24 * time.Hour       //period since last IssueComment and PullRequestComment being posted
	REMINDERNUMCAP  = 5                        //maximum number of times this munger will post reminder IssueComment
	LEAFOWNERSONLY  = false                    //setting for Blunderbuss to fetch only leaf owners or all owners
)

Variables

View Source
var AssociatedIssueRegex = regexp.MustCompile(`(?:kubernetes/[^/]+/issues/|#)(\d+)`)
View Source
var (
	IssueCreatorName = "issue-creator"
)

Functions

func EachLoop

func EachLoop() error

EachLoop will be called before we start a poll loop and will run the EachLoop function for all active mungers

func InitializeMungers

func InitializeMungers(config *github.Config, features *features.Features) error

InitializeMungers will call munger.Initialize() for the requested mungers.

func MungeIssue

func MungeIssue(obj *github.MungeObject) error

MungeIssue will call each activated munger with the given object

func NewPublisherLog

func NewPublisherLog(buf *bytes.Buffer) *plog

func RegisterMunger

func RegisterMunger(munger Munger) error

RegisterMunger should be called in `init()` by each munger to make itself available by name

func RegisterMungerOrDie

func RegisterMungerOrDie(munger Munger)

RegisterMungerOrDie will call RegisterMunger but will be fatal on error

func RegisterMungers

func RegisterMungers(requestedMungers []string) error

RegisterMungers will check if a requested munger exists and add it to the list.

func RegisterStaleIssueComments

func RegisterStaleIssueComments(s StaleIssueComment)

RegisterStaleIssueComments is the method for a munger to register that it creates issue comments which might go stale and need to be cleaned up.

func RequestedFeatures

func RequestedFeatures() []string

RequestedFeatures returns a list of all feature which should be enabled for the running mungers

Types

type ApprovalHandler

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

ApprovalHandler will try to add "approved" label once all files of change has been approved by approvers.

func (*ApprovalHandler) AddFlags

func (*ApprovalHandler) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*ApprovalHandler) EachLoop

func (*ApprovalHandler) EachLoop() error

EachLoop is called at the start of every munge loop

func (*ApprovalHandler) Initialize

func (h *ApprovalHandler) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*ApprovalHandler) Munge

func (h *ApprovalHandler) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR The algorithm goes as: - Initially, we build an approverSet

  • Go through all comments in order of creation.
  • (Issue/PR comments, PR review comments, and PR review bodies are considered as comments)
  • If anyone said "/approve" or "/lgtm", add them to approverSet.

- Then, for each file, we see if any approver of this file is in approverSet and keep track of files without approval

  • An approver of a file is defined as:
  • Someone listed as an "approver" in an OWNERS file in the files directory OR
  • in one of the file's parent directorie
  • Iff all files have been approved, the bot will add the "approved" label.
  • Iff a cancel command is found, that reviewer will be removed from the approverSet and the munger will remove the approved label if it has been applied

func (*ApprovalHandler) Name

func (*ApprovalHandler) Name() string

Name is the name usable in --pr-mungers

func (*ApprovalHandler) RequiredFeatures

func (*ApprovalHandler) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type AssignFixesMunger

type AssignFixesMunger struct {
	AssignfixesReassign bool
	// contains filtered or unexported fields
}

AssignFixesMunger will assign issues to users based on the config file provided by --assignfixes-config.

func (*AssignFixesMunger) AddFlags

func (a *AssignFixesMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*AssignFixesMunger) EachLoop

func (a *AssignFixesMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*AssignFixesMunger) Initialize

func (a *AssignFixesMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*AssignFixesMunger) Munge

func (a *AssignFixesMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*AssignFixesMunger) Name

func (a *AssignFixesMunger) Name() string

Name is the name usable in --pr-mungers

func (*AssignFixesMunger) RequiredFeatures

func (a *AssignFixesMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type Batch

type Batch struct {
	BaseName string
	BaseSha  string
	Pulls    []batchPull
}

Batch represents a specific merge state: a base branch and SHA, and the SHAs of each PR merged into it.

func (*Batch) String

func (b *Batch) String() string

type BlockPath

type BlockPath struct {
	Path string
	// contains filtered or unexported fields
}

BlockPath will add a label to block auto merge if a PR touches certain paths

func (*BlockPath) AddFlags

func (b *BlockPath) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*BlockPath) EachLoop

func (b *BlockPath) EachLoop() error

EachLoop is called at the start of every munge loop

func (*BlockPath) Initialize

func (b *BlockPath) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*BlockPath) Munge

func (b *BlockPath) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*BlockPath) Name

func (b *BlockPath) Name() string

Name is the name usable in --pr-mungers

func (*BlockPath) RequiredFeatures

func (b *BlockPath) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*BlockPath) StaleIssueComments

func (b *BlockPath) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

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)

type BlunderbussMunger

type BlunderbussMunger struct {
	BlunderbussReassign bool
	NumAssignees        int
	// contains filtered or unexported fields
}

BlunderbussMunger will assign issues to users based on the config file provided by --blunderbuss-config.

func (*BlunderbussMunger) AddFlags

func (b *BlunderbussMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*BlunderbussMunger) EachLoop

func (b *BlunderbussMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*BlunderbussMunger) Initialize

func (b *BlunderbussMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*BlunderbussMunger) Munge

func (b *BlunderbussMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*BlunderbussMunger) Name

func (b *BlunderbussMunger) Name() string

Name is the name usable in --pr-mungers

func (*BlunderbussMunger) RequiredFeatures

func (b *BlunderbussMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type BuildIndexer

type BuildIndexer interface {
	// contains filtered or unexported methods
}

BuildIndexer is an interface that describes the buildnum to row index mapping used to retrieve data about individual builds from the JSON file. This is an interface because the JSON format describing failure clusters has 2 ways of recording the mapping info.

type BulkLGTM

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

BulkLGTM knows how to aggregate a large number of small PRs into a single page for easy bulk review.

func (*BulkLGTM) AddFlags

func (b *BulkLGTM) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags implements the Munger interface

func (*BulkLGTM) EachLoop

func (b *BulkLGTM) EachLoop() error

EachLoop implements the Munger interface

func (*BulkLGTM) FindPR

func (b *BulkLGTM) FindPR(number int) *github.MungeObject

FindPR finds a PR in the list given its number

func (*BulkLGTM) Initialize

func (b *BulkLGTM) Initialize(config *github.Config, features *features.Features) error

Initialize implements the Munger interface

func (*BulkLGTM) Munge

func (b *BulkLGTM) Munge(obj *github.MungeObject)

Munge implements the Munger interface

func (*BulkLGTM) Name

func (b *BulkLGTM) Name() string

Name implements the Munger interface

func (*BulkLGTM) RequiredFeatures

func (b *BulkLGTM) RequiredFeatures() []string

RequiredFeatures implements the Munger interface

func (*BulkLGTM) ServeCallback

func (b *BulkLGTM) ServeCallback(res http.ResponseWriter, req *http.Request)

func (*BulkLGTM) ServeLGTM

func (b *BulkLGTM) ServeLGTM(res http.ResponseWriter, req *http.Request)

ServeLGTM serves the LGTM page over HTTP

func (*BulkLGTM) ServeLogin

func (b *BulkLGTM) ServeLogin(res http.ResponseWriter, req *http.Request)

func (*BulkLGTM) ServePRDiff

func (b *BulkLGTM) ServePRDiff(res http.ResponseWriter, req *http.Request)

ServePRDiff serves the difs in the PR over HTTP

func (*BulkLGTM) ServePRs

func (b *BulkLGTM) ServePRs(res http.ResponseWriter, req *http.Request)

ServePRs serves the current PR list over HTTP

func (*BulkLGTM) ServeUser

func (b *BulkLGTM) ServeUser(res http.ResponseWriter, req *http.Request)

type CheckLabelsMunger

type CheckLabelsMunger struct {
	LabelFilePath string
	// contains filtered or unexported fields
}

CheckLabelsMunger will check that the labels specified in the labels yaml file are created.

func (*CheckLabelsMunger) AddFlags

func (c *CheckLabelsMunger) AddFlags(cmd *cobra.Command, config *githubhelper.Config)

AddFlags will add any request flags to the cobra `cmd`.

func (*CheckLabelsMunger) EachLoop

func (c *CheckLabelsMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*CheckLabelsMunger) Initialize

func (c *CheckLabelsMunger) Initialize(config *githubhelper.Config, features *features.Features) error

Initialize will initialize the munger.

func (*CheckLabelsMunger) Munge

Munge is unused by this munger.

func (*CheckLabelsMunger) Name

func (c *CheckLabelsMunger) Name() string

Name is the name usable in --pr-mungers

func (*CheckLabelsMunger) RequiredFeatures

func (c *CheckLabelsMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided.

type CherrypickAutoApprove

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

CherrypickAutoApprove will add 'cherrypick-approved' to PRs which are for 'cherrypick-approved' parents. This only works if the PR (against the 'release-*' branch was done using the script.

func (*CherrypickAutoApprove) AddFlags

func (c *CherrypickAutoApprove) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*CherrypickAutoApprove) EachLoop

func (c *CherrypickAutoApprove) EachLoop() error

EachLoop is called at the start of every munge loop

func (*CherrypickAutoApprove) Initialize

func (c *CherrypickAutoApprove) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*CherrypickAutoApprove) Munge

func (c *CherrypickAutoApprove) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*CherrypickAutoApprove) Name

func (c *CherrypickAutoApprove) Name() string

Name is the name usable in --pr-mungers

func (*CherrypickAutoApprove) RequiredFeatures

func (c *CherrypickAutoApprove) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type CherrypickQueue

type CherrypickQueue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CherrypickQueue will merge PR which meet a set of requirements.

func (*CherrypickQueue) AddFlags

func (c *CherrypickQueue) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*CherrypickQueue) EachLoop

func (c *CherrypickQueue) EachLoop() error

EachLoop is called at the start of every munge loop

func (*CherrypickQueue) Initialize

func (c *CherrypickQueue) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*CherrypickQueue) Munge

func (c *CherrypickQueue) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*CherrypickQueue) Name

func (c *CherrypickQueue) Name() string

Name is the name usable in --pr-mungers

func (*CherrypickQueue) RequiredFeatures

func (c *CherrypickQueue) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type ClearPickAfterMerge

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

ClearPickAfterMerge will remove the the cherrypick-candidate label from any PR that does not have a 'release' milestone set.

func (*ClearPickAfterMerge) AddFlags

func (c *ClearPickAfterMerge) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*ClearPickAfterMerge) EachLoop

func (c *ClearPickAfterMerge) EachLoop() error

EachLoop is called at the start of every munge loop

func (*ClearPickAfterMerge) Initialize

func (c *ClearPickAfterMerge) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*ClearPickAfterMerge) Munge

func (c *ClearPickAfterMerge) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*ClearPickAfterMerge) Name

func (c *ClearPickAfterMerge) Name() string

Name is the name usable in --pr-mungers

func (*ClearPickAfterMerge) RequiredFeatures

func (c *ClearPickAfterMerge) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type CloseStale

type CloseStale struct{}

CloseStale will ask the Bot to close any PR/Issue that didn't have any human interactions in `stalePeriod` duration.

This is done by checking both review and issue comments, and by ignoring comments done with a bot name. We also consider re-open on the PR/Issue.

func (CloseStale) AddFlags

func (CloseStale) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (CloseStale) EachLoop

func (CloseStale) EachLoop() error

EachLoop is called at the start of every munge loop

func (CloseStale) Initialize

func (CloseStale) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (CloseStale) Munge

func (CloseStale) Munge(obj *github.MungeObject)

Munge is the workhorse that will actually close the PRs/Issues

func (CloseStale) Name

func (CloseStale) Name() string

Name is the name usable in --pr-mungers

func (CloseStale) RequiredFeatures

func (CloseStale) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (CloseStale) StaleIssueComments

func (s CloseStale) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type Cluster

type Cluster struct {
	Id    string  `json:"id"`
	Key   string  `json:"key"`
	Text  string  `json:"text"`
	Tests []*Test `json:"tests"`
	// contains filtered or unexported fields
}

func (*Cluster) Body

func (c *Cluster) Body(closedIssues []*githubapi.Issue) string

Body returns the body text of the github issue and *must* contain the output of ID(). closedIssues is a (potentially empty) slice containing all closed issues authored by this bot that contain ID() in their body. If Body returns an empty string no issue is created.

func (*Cluster) ID

func (c *Cluster) ID() string

ID yields the string identifier that uniquely identifies this issue. This ID must appear in the body of the issue. DO NOT CHANGE how this ID is formatted or duplicate issues may be created on github.

func (*Cluster) Labels

func (c *Cluster) Labels() []string

Labels returns the labels to apply to the issue created for this cluster on github.

func (*Cluster) Owners

func (c *Cluster) Owners() []string

Owners returns the list of usernames to assign to this issue on github.

func (*Cluster) Priority

func (c *Cluster) Priority() (string, bool)

Priority calculates and returns the priority of this issue. The returned bool indicates if the returned priority is valid and can be used.

func (*Cluster) Title

func (c *Cluster) Title() string

Title is the string to use as the github issue title.

type CommentDeleter

type CommentDeleter struct{}

CommentDeleter looks for comments which are no longer useful and deletes them

func (CommentDeleter) AddFlags

func (CommentDeleter) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (CommentDeleter) EachLoop

func (CommentDeleter) EachLoop() error

EachLoop is called at the start of every munge loop

func (CommentDeleter) Initialize

func (CommentDeleter) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (CommentDeleter) Munge

func (CommentDeleter) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (CommentDeleter) Name

func (CommentDeleter) Name() string

Name is the name usable in --pr-mungers

func (CommentDeleter) RequiredFeatures

func (CommentDeleter) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type CommentDeleterJenkins

type CommentDeleterJenkins struct{}

CommentDeleterJenkins looks for jenkins comments which are no longer useful and deletes them

func (CommentDeleterJenkins) StaleIssueComments

func (CommentDeleterJenkins) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type ContigIndexer

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

ContigIndexer is a BuildIndexer implementation for when the buildnum to row index mapping describes a contiguous set of rows via 3 ints.

type DictIndexer

type DictIndexer map[string]interface{}

DictIndexer is a BuildIndexer implementation for when the buildnum to row index mapping is simply a dictionary. The value type of this dictionary is interface instead of int so that we don't have to convert the original map.

type DocsNeedNoRetest

type DocsNeedNoRetest struct{}

DocsNeedNoRetest automatically labels documentation only pull-requests as retest-not-required

func (DocsNeedNoRetest) AddFlags

func (DocsNeedNoRetest) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (DocsNeedNoRetest) EachLoop

func (DocsNeedNoRetest) EachLoop() error

EachLoop is called at the start of every munge loop

func (*DocsNeedNoRetest) Initialize

func (s *DocsNeedNoRetest) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (DocsNeedNoRetest) Munge

func (DocsNeedNoRetest) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (DocsNeedNoRetest) Name

func (DocsNeedNoRetest) Name() string

Name is the name usable in --pr-mungers

func (DocsNeedNoRetest) RequiredFeatures

func (DocsNeedNoRetest) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type FlakyJob

type FlakyJob struct {
	// Name is the job's name.
	Name string
	// Consistency is the percentage of builds that passed.
	Consistency *float64 `json:"consistency"`
	// FlakeCount is the number of flakes.
	FlakeCount *int `json:"flakes"`
	// FlakyTests is a map of test names to the number of times that test failed.
	// Any test that failed at least once a day for the past week on this job is included.
	FlakyTests map[string]int `json:"flakiest"`
	// contains filtered or unexported fields
}

FlakyJob is a struct that represents a single job and the flake data associated with it. FlakyJob implements the Issue interface so that it can be synced with github issues via the IssueCreator.

func (*FlakyJob) Body

func (fj *FlakyJob) Body(closedIssues []*githubapi.Issue) string

Body returns the body text of the github issue and *must* contain the output of ID(). closedIssues is a (potentially empty) slice containing all closed issues authored by this bot that contain ID() in their body. If Body returns an empty string no issue is created.

func (*FlakyJob) ID

func (fj *FlakyJob) ID() string

ID yields the string identifier that uniquely identifies this issue. This ID must appear in the body of the issue. DO NOT CHANGE how this ID is formatted or duplicate issues may be created on github.

func (*FlakyJob) Labels

func (fj *FlakyJob) Labels() []string

Labels returns the labels to apply to the issue created for this flaky job on github.

func (*FlakyJob) Owners

func (fj *FlakyJob) Owners() []string

Owners returns the list of usernames to assign to this issue on github.

func (*FlakyJob) Priority

func (fj *FlakyJob) Priority() (string, bool)

Priority calculates and returns the priority of this issue The returned bool indicates if the returned priority is valid and can be used

func (*FlakyJob) TestsSorted

func (fj *FlakyJob) TestsSorted() []string

TestsSorted returns a slice of the testnames from a FlakyJob's FlakyTests map. The slice is sorted by descending number of failures for the tests.

func (*FlakyJob) Title

func (fj *FlakyJob) Title() string

Title yields the initial title text of the github issue.

type FlakyJobReporter

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

FlakyJobReporter is a munger that creates github issues for the flakiest kubernetes jobs. The flakiest jobs are parsed from JSON generated by /test-infra/experiment/bigquery/flakes.sh

func (*FlakyJobReporter) AddFlags

func (fjr *FlakyJobReporter) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags specifies flags to add to the cobra `cmd`.

func (*FlakyJobReporter) EachLoop

func (fjr *FlakyJobReporter) EachLoop() error

EachLoop is called every munge loop. The FlakyJobReporter only does work if it hasn't done so in the past syncFreq duration.

func (*FlakyJobReporter) Initialize

func (fjr *FlakyJobReporter) Initialize(config *github.Config, features *features.Features) error

func (*FlakyJobReporter) Munge

func (fjr *FlakyJobReporter) Munge(obj *github.MungeObject)

Munge is unused by this munger.

func (*FlakyJobReporter) Name

func (fjr *FlakyJobReporter) Name() string

Name is the name of munger.

func (*FlakyJobReporter) ReportFlakyJobs

func (fjr *FlakyJobReporter) ReportFlakyJobs() error

ReportFlakyJobs is the main work method of FlakyJobReporter. It fetches and parses flaky job data, then syncs the top issues to github with the IssueCreator.

func (*FlakyJobReporter) RequiredFeatures

func (fjr *FlakyJobReporter) RequiredFeatures() []string

RequiredFeatures specifies the features required by the FlakyJobReporter (none needed).

type InactiveReviewHandler

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

func (*InactiveReviewHandler) AddFlags

func (i *InactiveReviewHandler) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*InactiveReviewHandler) EachLoop

func (i *InactiveReviewHandler) EachLoop() error

EachLoop is called at the start of every munge loop

func (*InactiveReviewHandler) Initialize

func (i *InactiveReviewHandler) Initialize(config *github.Config, features *features.Features) error

func (*InactiveReviewHandler) Munge

func (i *InactiveReviewHandler) Munge(obj *github.MungeObject)

Munge is the workhorse encouraging PR author to assign a new reviewer after getting no response from current reviewer for "COMMENTTIMECAP" duration The algorithm: (1) find latest comment posting time (2) if the time is "COMMENTTIMECAP" or longer before today's time, create a comment

encouraging the author to assign a new reviewer and unassign the old reviewer

(3) suggest the new reviewer using Blunderbuss algorithm, making sure the old reviewer is not suggested Note: the munger will post at most "REMINDERNUMCAP" number of times

func (*InactiveReviewHandler) Name

func (i *InactiveReviewHandler) Name() string

func (*InactiveReviewHandler) RequiredFeatures

func (i *InactiveReviewHandler) RequiredFeatures() []string

type Issue

type Issue interface {
	// Title yields the initial title text of the github issue.
	Title() string
	// Body yields the body text of the github issue and *must* contain the output of ID().
	// closedIssues is a (potentially empty) slice containing all closed
	// issues authored by this bot that contain ID() in their body.
	// if Body returns an empty string no issue is created.
	Body(closedIssues []*githubapi.Issue) string
	// ID returns a string that uniquely identifies this issue.
	// This ID must appear in the body of the issue.
	// DO NOT CHANGE how this ID is formatted or duplicate issues will be created
	// on github for this issue
	ID() string
	// Labels specifies the set of labels to apply to this issue on github.
	Labels() []string
	// Owners returns the github usernames to assign the issue to or nil/empty for no assignment.
	Owners() []string
	// Priority calculates and returns the priority of this issue
	// The returned bool indicates if the returned priority is valid and can be used
	Priority() (string, bool)
}

Issue is an interface implemented by structs that can be synced with github issues via the IssueCreator.

type IssueCreator

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

IssueCreator handles syncing identified issues with github issues. This includes finding existing github issues, creating new ones, and ensuring that duplicate github issues are not created.

func (*IssueCreator) AddFlags

func (c *IssueCreator) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags adds flags needed by the IssueCreator to the combra `cmd`.

func (*IssueCreator) EachLoop

func (c *IssueCreator) EachLoop() error

EachLoop is called at the start of every munge loop. The IssueCreator does not use this.

func (*IssueCreator) ExplainTestAssignments

func (c *IssueCreator) ExplainTestAssignments(testNames []string) string

func (*IssueCreator) Initialize

func (c *IssueCreator) Initialize(config *github.Config, feats *features.Features) error

Initialize prepares an IssueCreator for use by other mungers. This includes determining the currently authenticated user, fetching all issues created by that user from github, fetching the labels that are valid for the repo, and initializing the test owner and sig data.

func (*IssueCreator) Munge

func (c *IssueCreator) Munge(obj *github.MungeObject)

Munge updates the IssueCreator's cache of issues if the munge object provided is an issue authored by the currently authenticated user.

func (*IssueCreator) Name

func (c *IssueCreator) Name() string

Name specifies the name of this munger to be used with the --pr-mungers flag.

func (*IssueCreator) RequiredFeatures

func (c *IssueCreator) RequiredFeatures() []string

RequiredFeatures specifies the features required by the IssueCreator (none needed).

func (*IssueCreator) Sync

func (c *IssueCreator) Sync(issue Issue)

Sync checks to see if an issue is already on github and tries to create a new issue for it if it is not.

func (*IssueCreator) TestOwner

func (c *IssueCreator) TestOwner(testName string) string

TestOwner uses the IssueCreator's OwnerMapper to look up the user assigned to a test.

func (*IssueCreator) TestSIG

func (c *IssueCreator) TestSIG(testName string) string

TestSIG uses the IssueCreator's OwnerMapper to look up the SIG for a test.

func (*IssueCreator) TestsOwners

func (c *IssueCreator) TestsOwners(testNames []string) map[string][]string

TestOwner uses the IssueCreator's OwnerMapper to look up the users assigned to a list of tests. The number of users returned is limited by maxAssignees. The return value is a map from users to the test names from testNames that each user owns.

func (*IssueCreator) TestsSIGs

func (c *IssueCreator) TestsSIGs(testNames []string) map[string][]string

TestSIG uses the IssueCreator's OwnerMapper to look up the SIGs for a list of tests. The number of SIGs returned is limited by maxSIGCount. The return value is a map from sigs to the tests from testNames that each sig owns.

type Job

type Job struct {
	Name   string `json:"name"`
	Builds []int  `json:"builds"`
}

type LGTMAfterCommitMunger

type LGTMAfterCommitMunger struct{}

LGTMAfterCommitMunger will remove the LGTM flag from an PR which has been updated since the reviewer added LGTM

func (LGTMAfterCommitMunger) AddFlags

func (LGTMAfterCommitMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (LGTMAfterCommitMunger) EachLoop

func (LGTMAfterCommitMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (LGTMAfterCommitMunger) Initialize

func (LGTMAfterCommitMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (LGTMAfterCommitMunger) Munge

Munge is the workhorse the will actually make updates to the PR

func (LGTMAfterCommitMunger) Name

Name is the name usable in --pr-mungers

func (LGTMAfterCommitMunger) RequiredFeatures

func (LGTMAfterCommitMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (LGTMAfterCommitMunger) StaleIssueComments

func (l LGTMAfterCommitMunger) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a list of stale issue comments.

type LabelMunger

type LabelMunger struct {
	TriagerUrl string
}

LabelMunger will update a label on a PR based on how many lines are changed. It will exclude certain files in it's calculations based on the config file provided in --generated-files-config

func (*LabelMunger) AddFlags

func (lm *LabelMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (LabelMunger) EachLoop

func (LabelMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (LabelMunger) Initialize

func (LabelMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*LabelMunger) Munge

func (lm *LabelMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (LabelMunger) Name

func (LabelMunger) Name() string

Name is the name usable in --pr-mungers

func (LabelMunger) RequiredFeatures

func (LabelMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type LabelUnapprovedPicks

type LabelUnapprovedPicks struct{}

LabelUnapprovedPicks will add `do-not-merge` to PRs against a release branch which do not have `cherrypick-approved`.

func (LabelUnapprovedPicks) AddFlags

func (LabelUnapprovedPicks) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (LabelUnapprovedPicks) EachLoop

func (LabelUnapprovedPicks) EachLoop() error

EachLoop is called at the start of every munge loop

func (LabelUnapprovedPicks) Initialize

func (LabelUnapprovedPicks) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (LabelUnapprovedPicks) Munge

Munge is the workhorse the will actually make updates to the PR

func (LabelUnapprovedPicks) Name

Name is the name usable in --pr-mungers

func (LabelUnapprovedPicks) RequiredFeatures

func (LabelUnapprovedPicks) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (LabelUnapprovedPicks) StaleIssueComments

func (l LabelUnapprovedPicks) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a list of stale issue comments.

type Munger

type Munger interface {
	// Take action on a specific github issue:
	Munge(obj *github.MungeObject)
	AddFlags(cmd *cobra.Command, config *github.Config)
	Name() string
	RequiredFeatures() []string
	Initialize(*github.Config, *features.Features) error
	EachLoop() error
}

Munger is the interface which all mungers must implement to register

func GetActiveMungers

func GetActiveMungers() []Munger

GetActiveMungers returns a slice of all mungers which both registered and were requested by the user

func GetAllMungers

func GetAllMungers() []Munger

GetAllMungers returns a slice of all registered mungers. This list is completely independent of the mungers selected at runtime in --pr-mungers. This is all possible mungers.

type NagFlakeIssues

type NagFlakeIssues struct{}

NagFlakeIssues pings assignees on flaky-test issues

func (NagFlakeIssues) AddFlags

func (NagFlakeIssues) AddFlags(cmd *cobra.Command, config *mgh.Config)

AddFlags will add any request flags to the cobra `cmd`

func (NagFlakeIssues) EachLoop

func (NagFlakeIssues) EachLoop() error

EachLoop is called at the start of every munge loop

func (NagFlakeIssues) Initialize

func (NagFlakeIssues) Initialize(config *mgh.Config, features *features.Features) error

Initialize will initialize the munger

func (NagFlakeIssues) Munge

func (NagFlakeIssues) Munge(obj *mgh.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (NagFlakeIssues) Name

func (NagFlakeIssues) Name() string

Name is the name usable in --pr-mungers

func (NagFlakeIssues) RequiredFeatures

func (NagFlakeIssues) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (NagFlakeIssues) StaleIssueComments

func (NagFlakeIssues) StaleIssueComments(obj *mgh.MungeObject, issueComments []*github.IssueComment) []*github.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type NeedsRebaseMunger

type NeedsRebaseMunger struct{}

NeedsRebaseMunger will add the "needs-rebase" label to any issue which is unable to be automatically merged

func (NeedsRebaseMunger) AddFlags

func (NeedsRebaseMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (NeedsRebaseMunger) EachLoop

func (NeedsRebaseMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (NeedsRebaseMunger) Initialize

func (NeedsRebaseMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (NeedsRebaseMunger) Munge

func (NeedsRebaseMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (NeedsRebaseMunger) Name

func (NeedsRebaseMunger) Name() string

Name is the name usable in --pr-mungers

func (NeedsRebaseMunger) RequiredFeatures

func (NeedsRebaseMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (NeedsRebaseMunger) StaleIssueComments

func (n NeedsRebaseMunger) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type OldTestGetter

type OldTestGetter struct {
	// Keep track of which jobs we've done this for.
	NumberOfOldTestsToGet int
	// contains filtered or unexported fields
}

OldTestGetter files issues for flaky tests.

func (*OldTestGetter) AddFlags

func (p *OldTestGetter) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*OldTestGetter) EachLoop

func (p *OldTestGetter) EachLoop() error

EachLoop is called at the start of every munge loop

func (*OldTestGetter) Initialize

func (p *OldTestGetter) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*OldTestGetter) Munge

func (p *OldTestGetter) Munge(obj *github.MungeObject)

Munge is unused by this munger.

func (*OldTestGetter) Name

func (p *OldTestGetter) Name() string

Name is the name usable in --pr-mungers

func (*OldTestGetter) RequiredFeatures

func (p *OldTestGetter) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type OwnerMapper

type OwnerMapper interface {
	// TestOwner returns a GitHub username for a test, or "" if none are found.
	TestOwner(testName string) string

	// TestSIG returns the name of the Special Interest Group (SIG) which owns the test , or "" if none are found.
	TestSIG(testName string) string
}

OwnerMapper finds an owner for a given test name.

type PathLabelMunger

type PathLabelMunger struct {
	PathLabelFile string
	// contains filtered or unexported fields
}

PathLabelMunger will add labels to PRs based on what files it modified. The mapping of files to labels if provided in a file in --path-label-config

func (*PathLabelMunger) AddFlags

func (p *PathLabelMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*PathLabelMunger) EachLoop

func (p *PathLabelMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*PathLabelMunger) Initialize

func (p *PathLabelMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*PathLabelMunger) Munge

func (p *PathLabelMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*PathLabelMunger) Name

func (p *PathLabelMunger) Name() string

Name is the name usable in --pr-mungers

func (*PathLabelMunger) RequiredFeatures

func (p *PathLabelMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type PickMustHaveMilestone

type PickMustHaveMilestone struct{}

PickMustHaveMilestone will remove the the cherrypick-candidate label from any PR that does not have a 'release' milestone set.

func (PickMustHaveMilestone) AddFlags

func (PickMustHaveMilestone) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (PickMustHaveMilestone) EachLoop

func (PickMustHaveMilestone) EachLoop() error

EachLoop is called at the start of every munge loop

func (PickMustHaveMilestone) Initialize

func (PickMustHaveMilestone) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (PickMustHaveMilestone) Munge

Munge is the workhorse the will actually make updates to the PR

func (PickMustHaveMilestone) Name

Name is the name usable in --pr-mungers

func (PickMustHaveMilestone) RequiredFeatures

func (PickMustHaveMilestone) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (PickMustHaveMilestone) StaleIssueComments

func (p PickMustHaveMilestone) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type PublisherMunger

type PublisherMunger struct {
	// Command for the 'publisher' munger to run periodically.
	PublishCommand string
	// contains filtered or unexported fields
}

PublisherMunger publishes content from one repository to another one.

func (*PublisherMunger) AddFlags

func (p *PublisherMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*PublisherMunger) EachLoop

func (p *PublisherMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*PublisherMunger) Initialize

func (p *PublisherMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*PublisherMunger) Munge

func (p *PublisherMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*PublisherMunger) Name

func (p *PublisherMunger) Name() string

Name is the name usable in --pr-mungers

func (*PublisherMunger) RequiredFeatures

func (p *PublisherMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type ReleaseNoteLabel

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

ReleaseNoteLabel will add the doNotMergeLabel to a PR which has not set one of the appropriete 'release-note-*' labels but has LGTM

func (*ReleaseNoteLabel) AddFlags

func (r *ReleaseNoteLabel) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*ReleaseNoteLabel) EachLoop

func (r *ReleaseNoteLabel) EachLoop() error

EachLoop is called at the start of every munge loop

func (*ReleaseNoteLabel) Initialize

func (r *ReleaseNoteLabel) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*ReleaseNoteLabel) Munge

func (r *ReleaseNoteLabel) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*ReleaseNoteLabel) Name

func (r *ReleaseNoteLabel) Name() string

Name is the name usable in --pr-mungers

func (*ReleaseNoteLabel) RequiredFeatures

func (r *ReleaseNoteLabel) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*ReleaseNoteLabel) StaleIssueComments

func (r *ReleaseNoteLabel) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type RepoClient

type RepoClient interface {
	GetUser(login string) (*githubapi.User, error)
	GetLabels() ([]*githubapi.Label, error)
	ListAllIssues(options *githubapi.IssueListByRepoOptions) ([]*githubapi.Issue, error)
	NewIssue(title, body string, labels, owners []string) (*github.MungeObject, error)

	// RealConfig gets the underlying *github.Config or returns nil if the RepoClient is a testing instance.
	RealConfig() *github.Config
	// contains filtered or unexported methods
}

RepoClient is the interface IssueCreator used to interact with github. This interface is necessary for testing the IssueCreator with dependency injection.

type SigMentionHandler

type SigMentionHandler struct{}

func (*SigMentionHandler) AddFlags

func (*SigMentionHandler) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*SigMentionHandler) EachLoop

func (*SigMentionHandler) EachLoop() error

EachLoop is called at the start of every munge loop

func (*SigMentionHandler) HasNeedsSigLabel

func (*SigMentionHandler) HasNeedsSigLabel(obj *github.MungeObject) bool

func (*SigMentionHandler) HasSigLabel

func (*SigMentionHandler) HasSigLabel(obj *github.MungeObject) bool

func (*SigMentionHandler) Initialize

func (s *SigMentionHandler) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*SigMentionHandler) Munge

func (s *SigMentionHandler) Munge(obj *github.MungeObject)

Munge is the workhorse notifying issue owner to add a @kubernetes/sig mention if there is none The algorithm: (1) return if it is a PR and/or the issue is closed (2) find if the issue has a sig label (3) find if the issue has a needs-sig label (4) if the issue has both the sig and needs-sig labels, remove the needs-sig label (5) if the issue has none of the labels, add the needs-sig label and comment (6) if the issue has only the sig label, do nothing (7) if the issue has only the needs-sig label, do nothing

func (*SigMentionHandler) Name

func (*SigMentionHandler) Name() string

Name is the name usable in --pr-mungers

func (*SigMentionHandler) RequiredFeatures

func (*SigMentionHandler) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

type SizeMunger

type SizeMunger struct {
	GeneratedFilesFile string
	// contains filtered or unexported fields
}

SizeMunger will update a label on a PR based on how many lines are changed. It will exclude certain files in it's calculations based on the config file provided in --generated-files-config

func (*SizeMunger) AddFlags

func (s *SizeMunger) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (SizeMunger) EachLoop

func (SizeMunger) EachLoop() error

EachLoop is called at the start of every munge loop

func (*SizeMunger) Initialize

func (s *SizeMunger) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*SizeMunger) Munge

func (s *SizeMunger) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (SizeMunger) Name

func (SizeMunger) Name() string

Name is the name usable in --pr-mungers

func (SizeMunger) RequiredFeatures

func (SizeMunger) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*SizeMunger) StaleIssueComments

func (s *SizeMunger) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type StaleGreenCI

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

StaleGreenCI will re-run passed tests for LGTM PRs if they are more than 96 hours old.

func (*StaleGreenCI) AddFlags

func (s *StaleGreenCI) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*StaleGreenCI) EachLoop

func (s *StaleGreenCI) EachLoop() error

EachLoop is called at the start of every munge loop

func (*StaleGreenCI) Initialize

func (s *StaleGreenCI) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*StaleGreenCI) Munge

func (s *StaleGreenCI) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*StaleGreenCI) Name

func (s *StaleGreenCI) Name() string

Name is the name usable in --pr-mungers

func (*StaleGreenCI) RequiredFeatures

func (s *StaleGreenCI) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*StaleGreenCI) StaleIssueComments

func (s *StaleGreenCI) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type StaleIssueComment

type StaleIssueComment interface {
	StaleIssueComments(*github.MungeObject, []*githubapi.IssueComment) []*githubapi.IssueComment
}

StaleIssueComment is an interface for a munger which writes issue comments which might go stale and which should be cleaned up.

type StalePendingCI

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

StalePendingCI will ask the testBot-to test any PR with a LGTM that has been pending for more than 24 hours. This can happen when the jenkins VM is restarted.

The real fix would be for the jenkins VM restart to not move every single PR to pending without actually testing...

But this is our world and so we should really do this for all PRs which aren't likely to get another push (everything that is mergeable). Since that can be a lot of PRs, I'm just doing it for the LGTM PRs automatically...

func (*StalePendingCI) AddFlags

func (s *StalePendingCI) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*StalePendingCI) EachLoop

func (s *StalePendingCI) EachLoop() error

EachLoop is called at the start of every munge loop

func (*StalePendingCI) Initialize

func (s *StalePendingCI) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*StalePendingCI) Munge

func (s *StalePendingCI) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*StalePendingCI) Name

func (s *StalePendingCI) Name() string

Name is the name usable in --pr-mungers

func (*StalePendingCI) RequiredFeatures

func (s *StalePendingCI) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*StalePendingCI) StaleIssueComments

func (s *StalePendingCI) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type SubmitQueue

type SubmitQueue struct {
	BlockingJobNames    []string
	NonBlockingJobNames []string
	PresubmitJobNames   []string
	WeakStableJobNames  []string

	GateApproved bool

	// If FakeE2E is true, don't try to connect to JenkinsHost, all jobs are passing.
	FakeE2E bool

	Committers             string
	RequiredStatusContexts []string
	DoNotMergeMilestones   []string

	RequiredRetestContexts []string
	Metadata               submitQueueMetadata
	AdminPort              int

	sync.Mutex

	BatchURL   string
	ContextURL string
	// contains filtered or unexported fields
}

SubmitQueue will merge PR which meet a set of requirements.

PR must have LGTM after the last commit
PR must have passed all github CI checks
The google internal jenkins instance must be passing the BlockingJobNames e2e tests

func (*SubmitQueue) AddFlags

func (sq *SubmitQueue) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any request flags to the cobra `cmd`

func (*SubmitQueue) EachLoop

func (sq *SubmitQueue) EachLoop() error

EachLoop is called at the start of every munge loop

func (*SubmitQueue) EmergencyStopHTTP

func (sq *SubmitQueue) EmergencyStopHTTP(res http.ResponseWriter, req *http.Request)

EmergencyStopHTTP sets the emergency stop flag. It expects the path of req.URL to contain either "emergency/stop", "emergency/resume", or "emergency/status".

func (*SubmitQueue) Initialize

func (sq *SubmitQueue) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the munger

func (*SubmitQueue) Munge

func (sq *SubmitQueue) Munge(obj *github.MungeObject)

Munge is the workhorse the will actually make updates to the PR

func (*SubmitQueue) Name

func (sq *SubmitQueue) Name() string

Name is the name usable in --pr-mungers

func (*SubmitQueue) RequiredFeatures

func (sq *SubmitQueue) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided

func (*SubmitQueue) SetMergeStatus

func (sq *SubmitQueue) SetMergeStatus(obj *github.MungeObject, reason string)

SetMergeStatus will set the status given a particular PR. This function should be used instead of manipulating the prStatus directly as sq.Lock() must be called when manipulating that structure `obj` is the active github object `reason` is the new 'status' for this object

func (*SubmitQueue) StaleIssueComments

func (sq *SubmitQueue) StaleIssueComments(obj *github.MungeObject, comments []*githubapi.IssueComment) []*githubapi.IssueComment

StaleIssueComments returns a slice of stale issue comments.

type Test

type Test struct {
	Name string `json:"name"`
	Jobs []*Job `json:"jobs"`
}

type TriageFiler

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

TriageFiler files issues for clustered test failures.

func (*TriageFiler) AddFlags

func (f *TriageFiler) AddFlags(cmd *cobra.Command, config *github.Config)

AddFlags will add any requested flags to the cobra `cmd`.

func (*TriageFiler) EachLoop

func (f *TriageFiler) EachLoop() error

EachLoop is called at the start of every munge loop. The TriageFiler does work only if it hasn't done so in the past triageSyncFreq minutes.

func (*TriageFiler) FileIssues

func (f *TriageFiler) FileIssues() error

FileIssues is the main work function of the TriageFiler. It fetches and parses cluster data, then syncs the top issues to github with the IssueCreator.

func (*TriageFiler) Initialize

func (f *TriageFiler) Initialize(config *github.Config, features *features.Features) error

Initialize will initialize the TriageFiler. During initialization, the TriageFiler looks up the IssueCreator and sets the nextSync time.

func (*TriageFiler) Munge

func (f *TriageFiler) Munge(obj *github.MungeObject)

Munge is unused by the TriageFiler.

func (*TriageFiler) Name

func (f *TriageFiler) Name() string

Name returns the string identifier of this munger, usable in --pr-mungers flag.

func (*TriageFiler) RequiredFeatures

func (f *TriageFiler) RequiredFeatures() []string

RequiredFeatures is a slice of 'features' that must be provided for this munger to run. The TriageFiler has no required features.

Directories

Path Synopsis
e2e

Jump to

Keyboard shortcuts

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