Documentation
¶
Index ¶
- Constants
- func FilesMatchAnyDirectory(files []*pull.File, dirs []string) bool
- func FilesMatchDirectory(files []*pull.File, dir string) bool
- type ClientProvider
- type ClientProviderConfig
- type Comment
- type Config
- type Context
- type EvaluationStatus
- type OrganizationConfig
- type Result
- type StatusPoster
- type WorkspaceConfig
Constants ¶
View Source
const ( LogKeyTFEWorkspace = "tfe_workspace" LogKeyTFERun = "tfe_run" )
Variables ¶
This section is empty.
Functions ¶
func FilesMatchAnyDirectory ¶ added in v0.4.3
FilesMatchAnyDirectory returns true if any file matches any of the given directories.
Types ¶
type ClientProvider ¶
type ClientProvider struct {
// contains filtered or unexported fields
}
func NewClientProvider ¶
func NewClientProvider(c ClientProviderConfig, middlewares ...githubapp.ClientMiddleware) (*ClientProvider, error)
func (*ClientProvider) Address ¶
func (p *ClientProvider) Address() string
type ClientProviderConfig ¶
type ClientProviderConfig struct {
Address string `yaml:"address"`
Organizations []OrganizationConfig `yaml:"organizations"`
}
func (*ClientProviderConfig) SetValuesFromEnv ¶
func (c *ClientProviderConfig) SetValuesFromEnv()
type Config ¶
type Config struct {
Workspaces []WorkspaceConfig `yaml:"workspaces"`
ApprovalRules []*approval.Rule `yaml:"approval_rules"`
Comments []Comment `yaml:"comments"`
// If changed files within a PR match any of these prefixes/directories,
// then all relevant workspaces will be matched.
TriggerPrefixes []string `yaml:"trigger_prefixes"`
// contains filtered or unexported fields
}
func (*Config) ParseComments ¶ added in v0.1.4
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) MonitorRun ¶
func (pc *Context) MonitorRun(ctx context.Context, poster StatusPoster, runID string)
type EvaluationStatus ¶
type EvaluationStatus int
const ( StatusSkipped EvaluationStatus = iota // note: values used for ordering StatusPolicyPending StatusPolicyDisapproved StatusPlanCreated StatusPlanPending StatusPlanDone )
func (EvaluationStatus) String ¶
func (s EvaluationStatus) String() string
type OrganizationConfig ¶
type StatusPoster ¶
type WorkspaceConfig ¶
type WorkspaceConfig struct {
Organization string `yaml:"organization"`
Name string `yaml:"name"`
WorkingDirectory string `yaml:"working_directory"`
Branch string `yaml:"branch"`
Policy policy.Policy `yaml:"policy"`
Comment string `yaml:"comment"`
ShowSkipped bool `yaml:"show_skipped"`
// Allows the exclusion of this workspace from being considered when
// evaluating Config.TriggerPrefixes
SkipTriggerPrefixes bool `yaml:"skip_trigger_prefixes"`
}
func FilterRelevantWorkspaces ¶ added in v0.4.3
func FilterRelevantWorkspaces(cfg *Config, baseBranch string, defaultBranch string, changedFiles []*pull.File) []WorkspaceConfig
FilterRelevantWorkspaces returns only the workspaces whose branch and file paths match the pull request, avoiding unnecessary evaluation of workspaces that would be skipped by matchPR. This allows callers to pre-filter before spawning concurrent evaluations.
func (WorkspaceConfig) String ¶
func (w WorkspaceConfig) String() string
Click to show internal directories.
Click to hide internal directories.