Documentation ¶
Index ¶
- Constants
- func Health() http.Handler
- type Base
- func (b *Base) Evaluate(ctx context.Context, installationID int64, trigger common.Trigger, ...) error
- func (b *Base) EvaluateFetchedConfig(ctx context.Context, prctx pull.Context, client *github.Client, ...) error
- func (b *Base) EvaluateWorkspace(ctx context.Context, prctx pull.Context, client *github.Client, ...) error
- func (b *Base) PostStatus(ctx context.Context, prctx pull.Context, wkcfg plan.WorkspaceConfig, ...) error
- func (b *Base) PreparePRContext(ctx context.Context, installationID int64, pr *github.PullRequest) (context.Context, zerolog.Logger)
- type CheckRun
- type ConfigFetcher
- type CrossOrgMembershipContext
- func (c *CrossOrgMembershipContext) IsOrgMember(org, user string) (bool, error)
- func (c *CrossOrgMembershipContext) IsTeamMember(team, user string) (bool, error)
- func (c *CrossOrgMembershipContext) OrganizationMembers(org string) ([]string, error)
- func (c *CrossOrgMembershipContext) TeamMembers(team string) ([]string, error)
- type FetchedConfig
- type HealthCheck
- type IssueComment
- type PullEvaluationOptions
- type PullRequest
- type PullRequestReview
- type Status
Constants ¶
View Source
const ( DefaultPolicyPath = ".tfe-plan.yml" DefaultStatusCheckContext = "TFE" LogKeyGitHubSHA = "github_sha" )
View Source
const (
LogKeyAudit string = "audit"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct { githubapp.ClientCreator Installations githubapp.InstallationsService GlobalCache pbpull.GlobalCache ConfigFetcher *ConfigFetcher BaseConfig *baseapp.HTTPConfig TFEClientProvider *plan.ClientProvider HTTPClient *http.Client PullOpts *PullEvaluationOptions AppName string }
func (*Base) EvaluateFetchedConfig ¶
func (*Base) EvaluateWorkspace ¶
func (*Base) PostStatus ¶
type ConfigFetcher ¶
type ConfigFetcher struct {
PolicyPath string
}
func (*ConfigFetcher) ConfigForPR ¶
func (cf *ConfigFetcher) ConfigForPR(ctx context.Context, prctx pull.Context, client *github.Client) (FetchedConfig, error)
ConfigForPR fetches the policy configuration for a PR. It returns an error only if the existence of the policy could not be determined. If the policy does not exist or is invalid, the returned error is nil and the appropriate fields are set on the FetchedConfig.
type CrossOrgMembershipContext ¶
type CrossOrgMembershipContext struct {
// contains filtered or unexported fields
}
func NewCrossOrgMembershipContext ¶
func NewCrossOrgMembershipContext(ctx context.Context, client *github.Client, orgName string, installations githubapp.InstallationsService, clientCreator githubapp.ClientCreator) *CrossOrgMembershipContext
func (*CrossOrgMembershipContext) IsOrgMember ¶
func (c *CrossOrgMembershipContext) IsOrgMember(org, user string) (bool, error)
func (*CrossOrgMembershipContext) IsTeamMember ¶
func (c *CrossOrgMembershipContext) IsTeamMember(team, user string) (bool, error)
func (*CrossOrgMembershipContext) OrganizationMembers ¶
func (c *CrossOrgMembershipContext) OrganizationMembers(org string) ([]string, error)
func (*CrossOrgMembershipContext) TeamMembers ¶
func (c *CrossOrgMembershipContext) TeamMembers(team string) ([]string, error)
type FetchedConfig ¶
type FetchedConfig struct { Owner string Repo string Ref string Path string Config *plan.Config Error error }
func (FetchedConfig) Description ¶
func (fc FetchedConfig) Description() string
func (FetchedConfig) Invalid ¶
func (fc FetchedConfig) Invalid() bool
func (FetchedConfig) Missing ¶
func (fc FetchedConfig) Missing() bool
func (FetchedConfig) String ¶
func (fc FetchedConfig) String() string
func (FetchedConfig) Valid ¶
func (fc FetchedConfig) Valid() bool
type HealthCheck ¶
type IssueComment ¶
type IssueComment struct {
Base
}
func (*IssueComment) Handle ¶
func (h *IssueComment) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle issue_comment See https://developer.github.com/v3/activity/events/types/#issuecommentevent
func (*IssueComment) Handles ¶
func (h *IssueComment) Handles() []string
type PullEvaluationOptions ¶
type PullEvaluationOptions struct { ConfigPath string `yaml:"config_path"` // StatusCheckContext will be used to create the status context. It will be used in the following // pattern: <StatusCheckContext>/<TFE Organization Name>/<TFE Workspace Name> StatusCheckContext string `yaml:"status_check_context"` // This field is unused but is left to avoid breaking configuration files: // yaml.UnmarshalStrict returns an error for unmapped fields // // TODO(jgiannuzzi): remove in version 1.0 Deprecated_AppName string `yaml:"app_name"` }
func (*PullEvaluationOptions) FillDefaults ¶
func (p *PullEvaluationOptions) FillDefaults()
type PullRequest ¶
type PullRequest struct {
Base
}
func (*PullRequest) Handle ¶
func (h *PullRequest) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle pull_request https://developer.github.com/v3/activity/events/types/#requestevent
func (*PullRequest) Handles ¶
func (h *PullRequest) Handles() []string
type PullRequestReview ¶
type PullRequestReview struct {
Base
}
func (*PullRequestReview) Handle ¶
func (h *PullRequestReview) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle pull_request_review https://developer.github.com/v3/activity/events/types/#pullrequestreviewevent
func (*PullRequestReview) Handles ¶
func (h *PullRequestReview) Handles() []string
Click to show internal directories.
Click to hide internal directories.