Documentation
¶
Overview ¶
Package config stores the user's rel profiles: which GitHub owner (org or user) to work with, an optional team, the branch names used by the release flow and the repository name filters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoProfiles = errors.New("no profiles configured")
ErrNoProfiles is returned when no profile has been configured yet.
Functions ¶
func ParsePatterns ¶
ParsePatterns splits a comma separated glob list entered by the user.
Types ¶
type Config ¶
type Config struct {
CurrentProfile string `json:"current_profile"`
Profiles []*Profile `json:"profiles"`
}
Config is the on-disk configuration file.
func (*Config) Current ¶
Current returns the active profile. It falls back to the only profile when current_profile is unset or dangling.
func (*Config) SetCurrent ¶
SetCurrent marks a profile as active.
type OwnerType ¶
type OwnerType string
OwnerType tells whether a profile targets a GitHub organization or a user.
type Profile ¶
type Profile struct {
Name string `json:"name"`
Owner string `json:"owner"`
OwnerType OwnerType `json:"owner_type"`
Team string `json:"team,omitempty"`
BaseBranch string `json:"base_branch"`
DevBranch string `json:"dev_branch"`
Include []string `json:"include,omitempty"`
Exclude []string `json:"exclude,omitempty"`
}
Profile describes one GitHub context rel can operate on.
func (*Profile) FilterRepos ¶
FilterRepos returns the repository names accepted by the profile filters.
func (*Profile) Fingerprint ¶
Fingerprint is a short hash of everything that changes which repositories a profile returns. It is used to invalidate caches.
func (*Profile) Matches ¶
Matches reports whether a repository name passes the profile filters. An empty Include list matches everything; Exclude always wins.
func (*Profile) SingleBranch ¶
SingleBranch reports whether the profile uses one branch for both the dev and the release side, which makes the sync flow meaningless.