repoowners

package
v0.0.0-...-6ca4c02 Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(
	gc *git.Client,
	ghc *github.Client,
	configGetter *prowConf.Agent,
	mdYAMLEnabled func(org, repo string) bool,
) *Client

func (*Client) LoadRepoAliases

func (c *Client) LoadRepoAliases(org, repo, base string) (RepoAliases, error)

LoadRepoAliases returns an up-to-date RepoAliases struct for the specified repo. If the repo does not have an aliases file then an empty alias map is returned with no error. Note: The returned RepoAliases should be treated as read only.

func (*Client) LoadRepoOwners

func (c *Client) LoadRepoOwners(org, repo, base string) (*RepoOwners, error)

LoadRepoOwners returns an up-to-date RepoOwners struct for the specified repo. Note: The returned *RepoOwners should be treated as read only.

type Config

type Config struct {
	Approvers []string `json:"approvers,omitempty"`
	Reviewers []string `json:"reviewers,omitempty"`
	Labels    []string `json:"labels,omitempty"`
}

type RepoAliases

type RepoAliases map[string]sets.String

func (RepoAliases) ExpandAlias

func (a RepoAliases) ExpandAlias(alias string) sets.String

func (RepoAliases) ExpandAliases

func (a RepoAliases) ExpandAliases(logins sets.String) sets.String

type RepoOwners

type RepoOwners struct {
	RepoAliases
	// contains filtered or unexported fields
}

func (*RepoOwners) Approvers

func (o *RepoOwners) 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 (*RepoOwners) FindApproverOwnersForFile

func (o *RepoOwners) FindApproverOwnersForFile(path string) string

FindApproversOwnersForFile returns the OWNERS file path furthest down the tree for a specified file that contains an approvers section

func (*RepoOwners) FindLabelsForFile

func (o *RepoOwners) FindLabelsForFile(path string) sets.String

FindLabelsForFile returns a set of labels which should be applied to PRs modifying files under the given path.

func (*RepoOwners) FindReviewersOwnersForFile

func (o *RepoOwners) FindReviewersOwnersForFile(path string) string

FindReviewersOwnersForFile returns the OWNERS file path furthest down the tree for a specified file that contains a reviewers section

func (*RepoOwners) IsNoParentOwners

func (o *RepoOwners) IsNoParentOwners(path string) bool

IsNoParentOwners checks if an OWNERS file path refers to an OWNERS file with NoParentOwners enabled.

func (*RepoOwners) LeafApprovers

func (o *RepoOwners) 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 (*RepoOwners) LeafReviewers

func (o *RepoOwners) 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 (*RepoOwners) Reviewers

func (o *RepoOwners) 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

Jump to

Keyboard shortcuts

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