Documentation ¶
Index ¶
- func CompareRulesetParameters(ruletype string, left RuleSetParameters, right RuleSetParameters) bool
- func ReadAndAdjustTeamDirectory(fs billy.Filesystem, dirname string, users map[string]*User) ([]string, error)
- func StringArrayEquivalent(a, b []string) (bool, []string, []string)
- type Entity
- type Repository
- type RuleSet
- type RuleSetParameters
- type Team
- type User
- type Warning
- func ReadRepositories(fs billy.Filesystem, archivedDirname string, teamDirname string, ...) (map[string]*Repository, []error, []Warning)
- func ReadRuleSetDirectory(fs billy.Filesystem, dirname string) (map[string]*RuleSet, []error, []Warning)
- func ReadTeamDirectory(fs billy.Filesystem, dirname string, users map[string]*User) (map[string]*Team, []error, []Warning)
- func ReadUserDirectory(fs billy.Filesystem, dirname string) (map[string]*User, []error, []Warning)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareRulesetParameters ¶
func CompareRulesetParameters(ruletype string, left RuleSetParameters, right RuleSetParameters) bool
func ReadAndAdjustTeamDirectory ¶
func ReadAndAdjustTeamDirectory(fs billy.Filesystem, dirname string, users map[string]*User) ([]string, error)
*
- AdjustTeamDirectory adjust team's defintion depending on user availability.
- The goal is that if a user has been removed, we must update the team definition.
- Returns:
- - a list of (team's) file changes (to commit to Github)
Types ¶
type Repository ¶
type Repository struct { Entity `yaml:",inline"` Spec struct { Writers []string `yaml:"writers,omitempty"` Readers []string `yaml:"readers,omitempty"` ExternalUserReaders []string `yaml:"externalUserReaders,omitempty"` ExternalUserWriters []string `yaml:"externalUserWriters,omitempty"` IsPublic bool `yaml:"public,omitempty"` AllowAutoMerge bool `yaml:"allow_auto_merge,omitempty"` DeleteBranchOnMerge bool `yaml:"delete_branch_on_merge,omitempty"` AllowUpdateBranch bool `yaml:"allow_update_branch,omitempty"` } `yaml:"spec,omitempty"` Archived bool `yaml:"archived,omitempty"` // implicit: will be set by Goliac Owner *string `yaml:"owner,omitempty"` // implicit. team name owning the repo (if any) }
func NewRepository ¶
func NewRepository(fs billy.Filesystem, filename string) (*Repository, error)
* NewRepository reads a file and returns a Repository object * The next step is to validate the Repository object using the Validate method
type RuleSet ¶
type RuleSet struct { Entity `yaml:",inline"` Spec struct { // Target // branch, tag Enforcement string // disabled, active, evaluate BypassApps []struct { AppName string Mode string // always, pull_request } On struct { Include []string // ~DEFAULT_BRANCH, ~ALL, branch_name, ... Exclude []string // branch_name, ... } Rules []struct { Ruletype string // required_signatures, pull_request, required_status_checks... Parameters RuleSetParameters } `yaml:"rules"` } `yaml:"spec"` }
* Ruleset are applied per repos based on the goliac configuration file (pattern x ruleset name)
func NewRuleSet ¶
* NewRuleSet reads a file and returns a RuleSet object * The next step is to validate the RuleSet object using the Validate method
type RuleSetParameters ¶
type RuleSetParameters struct { // PullRequestParameters DismissStaleReviewsOnPush bool `yaml:"dismissStaleReviewsOnPush"` RequireCodeOwnerReview bool `yaml:"requireCodeOwnerReview"` RequiredApprovingReviewCount int `yaml:"requiredApprovingReviewCount"` RequiredReviewThreadResolution bool `yaml:"requiredReviewThreadResolution"` RequireLastPushApproval bool `yaml:"requireLastPushApproval"` // RequiredStatusChecksParameters RequiredStatusChecks []string `yaml:"requiredStatusChecks"` StrictRequiredStatusChecksPolicy bool `yaml:"strictRequiredStatusChecksPolicy"` }
type Team ¶
type Team struct { Entity `yaml:",inline"` Spec struct { Owners []string `yaml:"owners,omitempty"` Members []string `yaml:"members,omitempty"` } `yaml:"spec"` }
func NewTeam ¶
* NewTeam reads a file and returns a Team object * The next step is to validate the Team object using the Validate method
type User ¶
type User struct { Entity `yaml:",inline"` Spec struct { GithubID string `yaml:"githubID"` } `yaml:"spec"` }
type Warning ¶
type Warning error
func ReadRepositories ¶
func ReadRepositories(fs billy.Filesystem, archivedDirname string, teamDirname string, teams map[string]*Team, externalUsers map[string]*User) (map[string]*Repository, []error, []Warning)
*
- ReadRepositories reads all the files in the dirname directory and
- add them to the owner's team and returns
- - a map of Repository objects
- - a slice of errors that must stop the validation process
- - a slice of warning that must not stop the validation process
func ReadRuleSetDirectory ¶
func ReadRuleSetDirectory(fs billy.Filesystem, dirname string) (map[string]*RuleSet, []error, []Warning)
*
- ReadRuleSetDirectory reads all the files in the dirname directory and returns
- - a map of RuleSet objects
- - a slice of errors that must stop the validation process
- - a slice of warning that must not stop the validation process
func ReadTeamDirectory ¶
func ReadTeamDirectory(fs billy.Filesystem, dirname string, users map[string]*User) (map[string]*Team, []error, []Warning)
*
- ReadTeamDirectory reads all the files in the dirname directory and returns
- - a map of Team objects
- - a slice of errors that must stop the validation process
- - a slice of warning that must not stop the validation process
func ReadUserDirectory ¶
*
- ReadUserDirectory reads all the files in the dirname directory and returns
- - a map of User objects
- - a slice of errors that must stop the vlidation process
- - a slice of warning that must not stop the validation process
Click to show internal directories.
Click to hide internal directories.