features

package
v0.0.0-...-89f796a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AliasesFeature is how mungers should indicate this is required.
	AliasesFeature = "aliases"
)
View Source
const (
	// BranchProtectionFeature should update the branches with the required contexts
	BranchProtectionFeature = "branch-protection"
)
View Source
const (
	// GCSFeature is how mungers should indicate this is required.
	GCSFeature = "google-cloud-storage"
)
View Source
const (

	// RepoFeatureName is how mungers should indicate this is required
	RepoFeatureName = "gitrepos"
)
View Source
const (
	// TestOptionsFeature is how mungers should indicate this is required.
	TestOptionsFeature = "test-options"
)

Variables

This section is empty.

Functions

func RegisterFeature

func RegisterFeature(feat feature) error

RegisterFeature should be called in `init()` by each feature to make itself available by name

Types

type Aliases

type Aliases struct {
	AliasFile string
	IsEnabled bool
	// contains filtered or unexported fields
}

Aliases is a struct that handles parameters required by mungers to expand and lookup aliases.

func (*Aliases) AddFlags

func (a *Aliases) AddFlags(cmd *cobra.Command)

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

func (*Aliases) EachLoop

func (a *Aliases) EachLoop() error

EachLoop is called at the start of every munge loop

func (*Aliases) Expand

func (a *Aliases) Expand(toExpand sets.String) sets.String

Expand takes aliases and expands them into owner lists.

func (*Aliases) Initialize

func (a *Aliases) Initialize(config *github.Config) error

Initialize will initialize the feature.

func (*Aliases) Name

func (a *Aliases) Name() string

Name is just going to return the name mungers use to request this feature

type BranchProtection

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

BranchProtection is a features that sets branches as protected

func (*BranchProtection) AddFlags

func (bp *BranchProtection) AddFlags(cmd *cobra.Command)

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

func (*BranchProtection) EachLoop

func (bp *BranchProtection) EachLoop() error

EachLoop is called at the start of every munge loop

func (*BranchProtection) Initialize

func (bp *BranchProtection) Initialize(config *github.Config) error

Initialize will initialize the feature.

func (*BranchProtection) Name

func (bp *BranchProtection) Name() string

Name is just going to return the name mungers use to request this feature

type Features

type Features struct {
	Aliases     *Aliases
	Repos       *RepoInfo
	GCSInfo     *GCSInfo
	TestOptions *TestOptions
	// contains filtered or unexported fields
}

Features are all features the code know about. Care should be taken not to try to use a feature which isn't 'active'

func (*Features) AddFlags

func (f *Features) AddFlags(cmd *cobra.Command) error

AddFlags allow every feature to add flags to the command

func (*Features) EachLoop

func (f *Features) EachLoop() error

EachLoop allows active features to update every loop

func (*Features) GetActive

func (f *Features) GetActive() []feature

GetActive returns all features requested by a munger

func (*Features) Initialize

func (f *Features) Initialize(config *github.Config, requestedFeatures []string) error

Initialize should be called with the set of all features needed by all (active) mungers

type GCSInfo

type GCSInfo struct {
	BucketName string
	LogDir     string

	// PullLogDir is the directory of the pr builder jenkins
	PullLogDir string

	// PullKey is a string to look for in a job name to figure out if it's
	// a pull (presubmit) job.
	PullKey string
}

GCSInfo is a struct that handles parameters required by GCS to read log files and determine the status of tests.

func (*GCSInfo) AddFlags

func (g *GCSInfo) AddFlags(cmd *cobra.Command)

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

func (*GCSInfo) EachLoop

func (g *GCSInfo) EachLoop() error

EachLoop is called at the start of every munge loop

func (*GCSInfo) Initialize

func (g *GCSInfo) Initialize(config *github.Config) error

Initialize will initialize the feature.

func (*GCSInfo) Name

func (g *GCSInfo) Name() string

Name is just going to return the name mungers use to request this feature

type RepoInfo

type RepoInfo struct {
	BaseDir      string
	EnableMdYaml bool
	UseReviewers bool
	// contains filtered or unexported fields
}

RepoInfo provides information about users in OWNERS files in a git repo

func (*RepoInfo) AddFlags

func (o *RepoInfo) AddFlags(cmd *cobra.Command)

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

func (*RepoInfo) Approvers

func (o *RepoInfo) Approvers(path string) sets.String

Approvers returns ALL of the users who are approvers for the requested file (including approvers in parent dirs' OWNERS). If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will return both user1 and user2 for the path pkg/util/sets/file.go

func (*RepoInfo) EachLoop

func (o *RepoInfo) EachLoop() error

EachLoop is called at the start of every munge loop

func (*RepoInfo) FindOwnersForPath

func (o *RepoInfo) FindOwnersForPath(path string) string

FindOwnersForPath returns the OWNERS file path further down the tree for a file

func (*RepoInfo) GitCommand

func (o *RepoInfo) GitCommand(args []string) ([]byte, error)

GitCommand will execute the git command with the `args` within the project directory.

func (*RepoInfo) Initialize

func (o *RepoInfo) Initialize(config *github.Config) error

Initialize will initialize the munger

func (*RepoInfo) LeafApprovers

func (o *RepoInfo) LeafApprovers(path string) sets.String

LeafApprovers returns a set of users who are the closest approvers to the requested file. If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will only return user2 for the path pkg/util/sets/file.go

func (*RepoInfo) LeafReviewers

func (o *RepoInfo) LeafReviewers(path string) sets.String

LeafReviewers returns a set of users who are the closest reviewers to the requested file. If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will only return user2 for the path pkg/util/sets/file.go

func (*RepoInfo) Name

func (o *RepoInfo) Name() string

Name is just going to return the name mungers use to request this feature

func (*RepoInfo) Reviewers

func (o *RepoInfo) Reviewers(path string) sets.String

Reviewers returns ALL of the users who are reviewers for the requested file (including reviewers in parent dirs' OWNERS). If pkg/OWNERS has user1 and pkg/util/OWNERS has user2 this will return both user1 and user2 for the path pkg/util/sets/file.go

type TestOptions

type TestOptions struct {
	RequiredRetestContexts []string
}

TestOptions is a struct that handles parameters required by mungers to find out about specific tests.

func (*TestOptions) AddFlags

func (t *TestOptions) AddFlags(cmd *cobra.Command)

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

func (*TestOptions) EachLoop

func (t *TestOptions) EachLoop() error

EachLoop is called at the start of every munge loop

func (*TestOptions) Initialize

func (t *TestOptions) Initialize(config *github.Config) error

Initialize will initialize the feature.

func (*TestOptions) Name

func (t *TestOptions) Name() string

Name is just going to return the name mungers use to request this feature

Jump to

Keyboard shortcuts

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