Documentation ¶
Index ¶
- Variables
- func IsOneOf(check string, slice []string) bool
- type Document
- type FeatureGate
- type File
- type GroupFetcher
- type KEPHandler
- type Milestone
- type MockGroupFetcher
- type PRRApproval
- type PRRApprovals
- type PRRHandler
- type PRRMilestone
- type Parser
- type Proposal
- type Proposals
- type RemoteGroupFetcher
- type Stage
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( ErrPRRMilestonesAllEmpty error = errors.New( "none of the PRR milestones are populated", ) ErrPRRMilestoneIsNil error = errors.New( "the selected PRR milestone stage is not populated", ) ErrPRRApproverUnknown error = errors.New( "an unknown error occurred while trying to determine a PRR approver", ) )
var ValidStages = []Stage{ AlphaStage, BetaStage, StableStage, }
var ValidStatuses = []Status{ ProvisionalStatus, ImplementableStatus, ImplementedStatus, DeferredStatus, RejectedStatus, WithdrawnStatus, ReplacedStatus, }
Functions ¶
Types ¶
type Document ¶
type Document interface {
Validate() error
}
Document is an interface satisfied by the following types: - `Proposal` (KEP) - `PRRApproval` - `Receipt` (coming soon) TODO(api): Populate interface and regenerate mocks
type FeatureGate ¶
type GroupFetcher ¶
type GroupFetcher interface { // FetchGroups returns the list of valid Kubernetes Community groups // e.g. (SIGs, WGs, UGs, Committees) FetchGroups() ([]string, error) // FetchPRRApprovers returns the list of valid PRR Approvers FetchPRRApprovers() ([]string, error) }
GroupFetcher is responsible for getting informationg about groups in the Kubernetes Community
func DefaultGroupFetcher ¶
func DefaultGroupFetcher() GroupFetcher
DefaultGroupFetcher returns the default GroupFetcher, which depends on GitHub
func NewMockGroupFetcher ¶
func NewMockGroupFetcher(groups, prrApprovers []string) GroupFetcher
type KEPHandler ¶
type KEPHandler Parser
func (*KEPHandler) Parse ¶
func (k *KEPHandler) Parse(in io.Reader) (*Proposal, error)
TODO(api): Make this a generic parser for all `Document` types
func (*KEPHandler) Validate ¶
func (k *KEPHandler) Validate(p *Proposal) []error
Validate returns errors for each reason the given proposal is invalid, or nil if it is valid
type MockGroupFetcher ¶
MockGroupFetcher returns the given Groups and PRR Approvers
func (*MockGroupFetcher) FetchGroups ¶
func (f *MockGroupFetcher) FetchGroups() ([]string, error)
func (*MockGroupFetcher) FetchPRRApprovers ¶
func (f *MockGroupFetcher) FetchPRRApprovers() ([]string, error)
type PRRApproval ¶
type PRRApproval struct { Number string `json:"kepNumber" yaml:"kep-number" validate:"required"` // TODO: Need to validate these milestone pointers are not nil Alpha *PRRMilestone `json:"alpha" yaml:"alpha,omitempty"` Beta *PRRMilestone `json:"beta" yaml:"beta,omitempty"` Stable *PRRMilestone `json:"stable" yaml:"stable,omitempty"` Deprecated *PRRMilestone `json:"deprecated" yaml:"deprecated,omitempty"` Removed *PRRMilestone `json:"removed", yaml:"removed,omitempty"` // TODO(api): Move to separate struct for handling document parsing Error error `json:"-" yaml:"-"` }
func (*PRRApproval) ApproverForStage ¶
func (prr *PRRApproval) ApproverForStage(stage Stage) (string, error)
func (*PRRApproval) Validate ¶
func (prr *PRRApproval) Validate() error
type PRRApprovals ¶
type PRRApprovals []*PRRApproval
func (*PRRApprovals) AddPRRApproval ¶
func (p *PRRApprovals) AddPRRApproval(prrApproval *PRRApproval)
type PRRHandler ¶
type PRRHandler Parser
func (*PRRHandler) Parse ¶
func (p *PRRHandler) Parse(in io.Reader) (*PRRApproval, error)
TODO(api): Make this a generic parser for all `Document` types
type PRRMilestone ¶
type PRRMilestone struct {
Approver string `json:"approver" yaml:"approver" validate:"required"`
}
TODO(api): Can we refactor the proposal `Milestone` to retrieve this?
type Proposal ¶
type Proposal struct { ID string `json:"id"` PRNumber string `json:"prNumber,omitempty"` Name string `json:"name,omitempty"` Title string `json:"title" yaml:"title" validate:"required"` Number string `json:"kepNumber" yaml:"kep-number" validate:"required"` Authors []string `json:"authors" yaml:",flow" validate:"required"` OwningSIG string `json:"owningSig" yaml:"owning-sig" validate:"required"` ParticipatingSIGs []string `json:"participatingSigs" yaml:"participating-sigs,flow,omitempty"` Reviewers []string `json:"reviewers" yaml:",flow"` Approvers []string `json:"approvers" yaml:",flow" validate:"required"` Editor string `json:"editor" yaml:"editor,omitempty"` CreationDate string `json:"creationDate" yaml:"creation-date"` LastUpdated string `json:"lastUpdated" yaml:"last-updated"` Status Status `json:"status" yaml:"status" validate:"required"` SeeAlso []string `json:"seeAlso" yaml:"see-also,omitempty"` Replaces []string `json:"replaces" yaml:"replaces,omitempty"` SupersededBy []string `json:"supersededBy" yaml:"superseded-by,omitempty"` Stage Stage `json:"stage" yaml:"stage"` LatestMilestone string `json:"latestMilestone" yaml:"latest-milestone"` Milestone Milestone `json:"milestone" yaml:"milestone"` FeatureGates []FeatureGate `json:"featureGates" yaml:"feature-gates"` DisableSupported bool `json:"disableSupported" yaml:"disable-supported"` Metrics []string `json:"metrics" yaml:"metrics"` Filename string `json:"-" yaml:"-"` Error error `json:"-" yaml:"-"` Contents string `json:"markdown" yaml:"-"` }
TODO(api): json fields are not using consistent casing
func (*Proposal) IsMissingMilestone ¶
func (*Proposal) IsMissingStage ¶
type RemoteGroupFetcher ¶
type RemoteGroupFetcher struct { // Basically kubernetes/community/sigs.yaml GroupsListURL string // Basically kubernetes/enhancements/OWNERS_ALIASES OwnersAliasesURL string // The alias name to look for PRR approvers in OWNERS_ALIASES PRRApproversAlias string // The alias name to look for emeritus PRR approvers in OWNERS_ALIASES PRRApproversEmeritusAlias string }
RemoteGroupFetcher returns Groups and PRR Approvers from remote sources
func (*RemoteGroupFetcher) FetchGroups ¶
func (f *RemoteGroupFetcher) FetchGroups() ([]string, error)
FetchGroups returns the list of valid Kubernetes Community groups as fetched from a remote source
func (*RemoteGroupFetcher) FetchPRRApprovers ¶
func (f *RemoteGroupFetcher) FetchPRRApprovers() ([]string, error)
FetchPRRApprovers returns a list of PRR approvers.