config

package
Version: v0.0.0-...-005854d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config defines and grabs overall bot config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchConfig

func FetchConfig(ctx context.Context, c *github.Client, owner, repo, path string, out interface{}) error

FetchConfig grabs a yaml config file from github and writes it to out.

func IsBotEnabled

func IsBotEnabled(ctx context.Context, c *github.Client, owner, repo string) bool

IsBotEnabled determines if allstar is enabled overall on the provided repo.

func IsEnabled

func IsEnabled(o OrgOptConfig, r RepoOptConfig, repo string) bool

IsEnabled determines if a repo is enabled by interpreting the provided org-level and repo-level OptConfigs.

Types

type OrgConfig

type OrgConfig struct {
	// OptConfig contains the opt in/out configuration.
	OptConfig OrgOptConfig `yaml:"optConfig"`
}

OrgConfig is the org-level config definition for Allstar

type OrgOptConfig

type OrgOptConfig struct {
	// OptOutStrategy : set to true to change from opt-in to opt-out.
	OptOutStrategy bool `yaml:"optOutStrategy"`

	// OptInRepos is the list of repos to opt-in when in opt-in strategy.
	OptInRepos []string `yaml:"optInRepos"`

	// OptOutRepos is the list of repos to opt-out when in opt-out strategy.
	OptOutRepos []string `yaml:"optOutRepos"`

	// DisableRepoOverride : set to true to disallow repos from opt-in/out in
	// their config.
	DisableRepoOverride bool `yaml:"disableRepoOverride"`
}

OrgOptConfig is used in Allstar and policy-secific org-level config to define the opt in/out configuration.

type RepoConfig

type RepoConfig struct {
	// OptConfig contains the opt in/out configuration.
	OptConfig RepoOptConfig `yaml:"optConfig"`
}

RepoConfig is the repo-level config definition for Allstar

type RepoOptConfig

type RepoOptConfig struct {
	// OptIn : set to true to opt-in this repo when in opt-in strategy
	OptIn bool `yaml:"optIn"`

	// OptOut: set to true to opt-out this repo when in opt-out strategy
	OptOut bool `yaml:"optOut"`
}

RepoOptConfig is used in Allstar and policy-specific repo-level config to opt in/out of enforcement.

Source Files

Directories

Path Synopsis
Package operator contains config to be set by the GitHub App operator
Package operator contains config to be set by the GitHub App operator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL