utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPRCommentCount

func FetchPRCommentCount(user, repository string) (int, error)

func GetKubernetesOwnersFiles

func GetKubernetesOwnersFiles() (*[]string, error)

func GetOwnerFiles

func GetOwnerFiles(root string) ([]string, error)

func GetOwnersAliasesFile

func GetOwnersAliasesFile(root string) (string, error)

func GetSigsYamlFile

func GetSigsYamlFile(root string) (string, error)

func GroupIndex

func GroupIndex(groups []Group, predicate func(Group) bool) int

func RemoveUserFromOWNERS

func RemoveUserFromOWNERS(path string, users []string) error

Types

type Aliases

type Aliases struct {
	RepoAliases map[string][]string `json:"aliases,omitempty"`
}

Aliases defines groups of people to be used in OWNERS files

func GetOwnerAliases

func GetOwnerAliases(filename string) (*Aliases, error)

type Contact

type Contact struct {
	Slack              string       `yaml:",omitempty" json:",omitempty"`
	MailingList        string       `yaml:"mailing_list,omitempty" json:"mailing_list,omitempty"`
	PrivateMailingList string       `yaml:"private_mailing_list,omitempty" json:"private_mailing_list,omitempty"`
	GithubTeams        []GithubTeam `yaml:"teams,omitempty" json:"teams,omitempty"`
	Liaison            *Person      `yaml:"liaison,omitempty" json:"liaison,omitempty"`
}

Contact represents the various contact points for a group.

type Context

type Context struct {
	Sigs          []Group
	WorkingGroups []Group
	UserGroups    []Group
	Committees    []Group
}

Context is the context for the sigs.yaml file.

func GetSigsYaml

func GetSigsYaml(filename string) (*Context, error)

func (*Context) PrefixToGroupMap

func (c *Context) PrefixToGroupMap() map[string][]Group

PrefixToGroupMap returns a map of prefix to groups, useful for iteration over all groups

type Contribution

type Contribution struct {
	ID           string
	Alias        string
	ContribCount int
	CommentCount int
}

func GetContributionsForAYear

func GetContributionsForAYear(repository string, period string) (error, []Contribution)

type DirOptions

type DirOptions struct {
	NoParentOwners bool `json:"no_parent_owners,omitempty"`
}

type FiltersInfo

type FiltersInfo struct {
	Approvers         []string `json:"approvers,omitempty"`
	Reviewers         []string `json:"reviewers,omitempty"`
	Labels            []string `json:"labels,omitempty"`
	EmeritusApprovers []string `json:"emeritus_approvers,omitempty"`
	RequiredReviewers []string `json:"required_reviewers,omitempty"`
}

type FoldedString

type FoldedString string

FoldedString is a string that will be serialized in FoldedStyle by go-yaml

func (FoldedString) MarshalYAML

func (x FoldedString) MarshalYAML() (interface{}, error)

MarshalYAML customizes how FoldedStrings will be serialized by go-yaml

type Frames

type Frames struct {
	Schema map[string]interface{} `json:"schema,omitempty"`
	Data   Values                 `json:"data,omitempty"`
}

type GithubTeam

type GithubTeam struct {
	Name        string
	Description string `yaml:",omitempty" json:",omitempty"`
}

GithubTeam represents a specific Github Team.

type Group

type Group struct {
	Dir              string
	Name             string
	MissionStatement FoldedString `yaml:"mission_statement,omitempty" json:"mission_statement,omitempty"`
	CharterLink      string       `yaml:"charter_link,omitempty" json:"charter_link,omitempty"`
	StakeholderSIGs  []string     `yaml:"stakeholder_sigs,omitempty" json:"stakeholder_sigs,omitempty"`
	Label            string
	Leadership       LeadershipGroup `yaml:"leadership" json:"leadership"`
	Meetings         []Meeting
	Contact          Contact
	Subprojects      []Subproject `yaml:",omitempty" json:",omitempty"`
}

Group represents either a Special Interest Group (SIG) or a Working Group (WG)

func (*Group) DirName

func (g *Group) DirName(prefix string) string

DirName returns the directory that a group's documentation will be generated into. It is composed of a prefix (sig for SIGs and wg for WGs), and a formatted version of the group's name (in kebab case).

func (*Group) LabelName

func (g *Group) LabelName(prefix string) string

LabelName returns the expected label for a given group

type LeadershipGroup

type LeadershipGroup struct {
	Chairs         []Person
	TechnicalLeads []Person `yaml:"tech_leads,omitempty" json:"tech_leads,omitempty"`
	EmeritusLeads  []Person `yaml:"emeritus_leads,omitempty" json:"emeritus_leads,omitempty"`
}

LeadershipGroup represents the different groups of leaders within a group

func (*LeadershipGroup) PrefixToPersonMap

func (g *LeadershipGroup) PrefixToPersonMap() map[string][]Person

PrefixToPersonMap returns a map of prefix to persons, useful for iteration over all persons

type Meeting

type Meeting struct {
	Description   string
	Day           string
	Time          string
	TZ            string
	Frequency     string
	URL           string `yaml:",omitempty" json:",omitempty"`
	ArchiveURL    string `yaml:"archive_url,omitempty" json:"archive_url,omitempty"`
	RecordingsURL string `yaml:"recordings_url,omitempty" json:"recordings_url,omitempty"`
}

Meeting represents a regular meeting for a group.

type OwnersInfo

type OwnersInfo struct {
	Filters           map[string]FiltersInfo `json:"filters,omitempty"`
	Approvers         []string               `json:"approvers,omitempty"`
	Reviewers         []string               `json:"reviewers,omitempty"`
	RequiredReviewers []string               `json:"required_reviewers,omitempty"`
	Labels            []string               `json:"labels,omitempty"`
	EmeritusApprovers []string               `json:"emeritus_approvers,omitempty"`
	Options           DirOptions             `json:"options,omitempty"`
}

func GetOwnersInfo

func GetOwnersInfo(file string) (*OwnersInfo, error)

func GetOwnersInfoFromBytes

func GetOwnersInfoFromBytes(bytes []byte) (*OwnersInfo, error)

type Person

type Person struct {
	GitHub  string
	Name    string
	Company string `yaml:"company,omitempty" json:",omitempty"`
}

Person represents an individual person holding a role in a group.

type Subproject

type Subproject struct {
	Name        string
	Description string   `yaml:",omitempty" json:",omitempty"`
	Contact     *Contact `yaml:",omitempty" json:",omitempty"`
	Owners      []string
	Meetings    []Meeting `yaml:",omitempty" json:",omitempty"`
}

Subproject represents a specific subproject owned by the group

type Values

type Values struct {
	Items [][]interface{} `json:"values,omitempty"`
}

Jump to

Keyboard shortcuts

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