Documentation ¶
Index ¶
- Constants
- func RegisterFeature(feat feature) error
- type BranchProtection
- type Features
- type RepoInfo
- func (o *RepoInfo) AllPossibleOwnerLabels() sets.String
- func (o *RepoInfo) Approvers(path string) sets.String
- func (o *RepoInfo) EachLoop() error
- func (o *RepoInfo) FindApproverOwnersForPath(path string) string
- func (o *RepoInfo) FindLabelsForPath(path string) sets.String
- func (o *RepoInfo) FindReviewersForPath(path string) string
- func (o *RepoInfo) GitCommand(args []string) ([]byte, error)
- func (o *RepoInfo) Initialize(config *github.Config) error
- func (o *RepoInfo) LeafApprovers(path string) sets.String
- func (o *RepoInfo) LeafReviewers(path string) sets.String
- func (o *RepoInfo) Name() string
- func (o *RepoInfo) RegisterOptions(opts *options.Options) sets.String
- func (o *RepoInfo) Reviewers(path string) sets.String
- type ServerFeature
Constants ¶
const (
// BranchProtectionFeature should update the branches with the required contexts
BranchProtectionFeature = "branch-protection"
)
const (
// RepoFeatureName is how mungers should indicate this is required
RepoFeatureName = "gitrepos"
)
const (
ServerFeatureName = "server"
)
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 BranchProtection ¶
type BranchProtection struct {
// contains filtered or unexported fields
}
BranchProtection is a features that sets branches as protected
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
func (*BranchProtection) RegisterOptions ¶
func (bp *BranchProtection) RegisterOptions(opts *options.Options) sets.String
RegisterOptions registers options for this feature; returns any that require a restart when changed.
type Features ¶
type Features struct { Repos *RepoInfo Server *ServerFeature // 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) GetActive ¶
func (f *Features) GetActive() []feature
GetActive returns all features requested by a munger
func (*Features) Initialize ¶
Initialize should be called with the set of all features needed by all (active) mungers
type RepoInfo ¶
type RepoInfo struct {
// contains filtered or unexported fields
}
RepoInfo provides information about users in OWNERS files in a git repo
func (*RepoInfo) AllPossibleOwnerLabels ¶
AllPossibleOwnerLabels returns all labels found in any owners files
func (*RepoInfo) Approvers ¶
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) FindApproverOwnersForPath ¶
FindApproversForPath returns the OWNERS file path furthest down the tree for a specified file that contains an approvers section
func (*RepoInfo) FindLabelsForPath ¶
FindLabelsForPath returns a set of labels which should be applied to PRs modifying files under the given path.
func (*RepoInfo) FindReviewersForPath ¶
FindReviewersForPath returns the OWNERS file path furthest down the tree for a specified file that contains a reviewers section
func (*RepoInfo) GitCommand ¶
GitCommand will execute the git command with the `args` within the project directory.
func (*RepoInfo) Initialize ¶
Initialize will initialize the munger
func (*RepoInfo) LeafApprovers ¶
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 ¶
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) RegisterOptions ¶
RegisterOptions registers options for this feature; returns any that require a restart when changed.
type ServerFeature ¶
type ServerFeature struct { *sharedmux.ConcurrentMux Enabled bool Address string WWWRoot string // contains filtered or unexported fields }
ServerFeature runs a server and allows mungers to register handlers for paths, or prometheus metrics.
func (*ServerFeature) EachLoop ¶
func (s *ServerFeature) EachLoop() error
EachLoop is called at the start of every munge loop
func (*ServerFeature) Initialize ¶
func (s *ServerFeature) Initialize(config *github.Config) error
Initialize will initialize the feature.
func (*ServerFeature) Name ¶
func (s *ServerFeature) Name() string
Name is just going to return the name mungers use to request this feature
func (*ServerFeature) RegisterOptions ¶
func (s *ServerFeature) RegisterOptions(opts *options.Options) sets.String
RegisterOptions registers options for this feature; returns any that require a restart when changed.