Documentation
¶
Index ¶
- Constants
- func ClearPlugins()
- func Detect() provider.Provider
- func DetectOrError() (provider.Provider, error)
- func Execute(opts ExecuteOptions) error
- func Get(name string) (provider.Provider, error)
- func GetPlugin(componentType string) (plugin.Plugin, bool)
- func GetPluginForEvent(event string) plugin.Plugin
- func IsCI() bool
- func IsCommitSHA(s string) bool
- func List() []string
- func ListPlugins() []string
- func Register(p provider.Provider)
- func RegisterPlugin(p plugin.Plugin) error
- func Reset()
- func SwapRegistryForTest() func()
- type BaseResolution
- type BranchStatus
- type CheckStatus
- type CheckStatusState
- type DebugModeInfo
- type ExecuteOptions
- type PRStatus
- type Provider
- type Status
- type StatusOptions
Constants ¶
const ( // CheckStatusStatePending indicates the check is pending or in progress. CheckStatusStatePending = provider.CheckStatusStatePending // CheckStatusStateSuccess indicates the check passed. CheckStatusStateSuccess = provider.CheckStatusStateSuccess // CheckStatusStateFailure indicates the check failed. CheckStatusStateFailure = provider.CheckStatusStateFailure // CheckStatusStateCancelled indicates the check was cancelled. CheckStatusStateCancelled = provider.CheckStatusStateCancelled // CheckStatusStateSkipped indicates the check was skipped. CheckStatusStateSkipped = provider.CheckStatusStateSkipped )
Variables ¶
This section is empty.
Functions ¶
func ClearPlugins ¶
func ClearPlugins()
ClearPlugins removes all registered plugins. This is primarily for testing.
func DetectOrError ¶
DetectOrError returns the detected provider or an error if none is detected.
func Execute ¶
func Execute(opts ExecuteOptions) error
Execute runs all CI actions for a hook event. Returns nil if not in CI or if the event is not handled.
func GetPluginForEvent ¶
GetPluginForEvent returns the plugin that handles a specific hook event. Returns nil if no plugin handles the event.
func IsCommitSHA ¶ added in v1.214.0
IsCommitSHA returns true if s looks like a git commit SHA (7-40 hex chars).
func Register ¶
Register registers a CI provider. Providers should call this in their init() function.
func RegisterPlugin ¶
RegisterPlugin registers a CI plugin for a component type. Plugins should call this in their init() function for self-registration.
func Reset ¶ added in v1.214.0
func Reset()
Reset clears all registered providers. Intended for use in tests to ensure clean state between subtests that register providers.
func SwapRegistryForTest ¶
func SwapRegistryForTest() func()
SwapRegistryForTest clears the provider registry and returns a restore function that puts the previous registry back in place when invoked. Intended for use in tests (including tests in other packages) that need to isolate themselves from the set of CI providers that are auto-registered via init() in the hosting binary — for example, tests asserting that ci.IsCI() returns false even when running under GitHub Actions.
Types ¶
type BaseResolution ¶ added in v1.214.0
type BaseResolution = provider.BaseResolution
BaseResolution contains the resolved base commit for affected detection.
type BranchStatus ¶
type BranchStatus = provider.BranchStatus
BranchStatus contains status information for a specific branch.
type CheckStatus ¶
type CheckStatus = provider.CheckStatus
CheckStatus contains status information for a single check.
type CheckStatusState ¶
type CheckStatusState = provider.CheckStatusState
CheckStatusState represents the simplified state for display.
type DebugModeInfo ¶
type DebugModeInfo struct {
// Active is true when the detected provider reports that CI debug
// logging is enabled for the current run.
Active bool
// Provider is the name of the detected CI provider (e.g.
// "github-actions"). Empty when no CI provider is detected.
Provider string
}
DebugModeInfo describes the detected CI provider's debug-mode state. Returned by DetectDebugMode to keep callers provider-agnostic.
func DetectDebugMode ¶
func DetectDebugMode() DebugModeInfo
DetectDebugMode inspects the active CI provider for a debug-mode signal. Returns a zero-value DebugModeInfo when no provider is detected or the detected provider does not implement provider.DebugModeDetector.
Callers (e.g., the CLI startup path) use this to auto-promote their own log level when the user has opted into CI-side debug logging, without hard-coding any provider-specific environment variables.
type ExecuteOptions ¶
type ExecuteOptions struct {
// Event is the hook event (e.g., "after.terraform.plan").
Event string
// AtmosConfig is the Atmos configuration.
AtmosConfig *schema.AtmosConfiguration
// Info contains component and stack information.
Info *schema.ConfigAndStacksInfo
// Output is the command output to process.
Output string
// ComponentType overrides the component type detection.
// If empty, it's extracted from the event.
ComponentType string
// ForceCIMode forces CI mode even if environment detection fails.
// This is set when --ci flag is used.
ForceCIMode bool
// CommandError is the error from the command execution, if any.
// When set, check runs are updated with failure status.
CommandError error
// ExitCode is the exit code from the command execution. See HookContext.ExitCode
// for semantics. Required for accurate success/failure reporting on commands
// that fail before producing parseable terraform output (e.g., auth errors).
ExitCode int
}
ExecuteOptions contains options for executing CI hooks.
type StatusOptions ¶
type StatusOptions = provider.StatusOptions
StatusOptions contains options for fetching CI status.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package artifact is a generated GoMock package.
|
Package artifact is a generated GoMock package. |
|
internal
|
|
|
plugin
Package plugin defines the CI plugin interface and related types for component type abstractions.
|
Package plugin defines the CI plugin interface and related types for component type abstractions. |
|
provider
Package provider defines the CI/CD provider interface and related types.
|
Package provider defines the CI/CD provider interface and related types. |
|
plugins
|
|
|
terraform
Package terraform provides the CI provider implementation for Terraform.
|
Package terraform provides the CI provider implementation for Terraform. |
|
providers
|
|
|
generic
Package generic provides a fallback CI provider for when --ci flag is used but no specific CI platform is detected.
|
Package generic provides a fallback CI provider for when --ci flag is used but no specific CI platform is detected. |
|
github
Package github provides GitHub Actions CI provider implementation.
|
Package github provides GitHub Actions CI provider implementation. |
|
Package templates provides CI summary template loading and rendering.
|
Package templates provides CI summary template loading and rendering. |