Documentation
¶
Overview ¶
Package codepipeline provides an in-memory implementation of the AWS CodePipeline service.
Index ¶
- Constants
- Variables
- type Action
- type ActionConfigurationProperty
- type ActionExecution
- type ActionRevisionRecord
- type ActionTypeExecutor
- type ActionTypeExecutorConfiguration
- type ActionTypeID
- type ActionTypePermissions
- type ActionTypeProperty
- type ActionTypeSettings
- type ActionTypeUrls
- type ArtifactDetails
- type ArtifactRef
- type ArtifactStore
- type Condition
- type CustomActionType
- type EncryptionKey
- type GitBranchFilterCriteria
- type GitConfiguration
- type GitFilePathsFilterCriteria
- type GitPullRequestFilter
- type GitPushFilter
- type GitTagFilterCriteria
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(_ *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AcknowledgeJob(ctx context.Context, jobID, nonce string) (string, error)
- func (b *InMemoryBackend) AcknowledgeThirdPartyJob(ctx context.Context, jobID, nonce, clientToken string) (string, error)
- func (b *InMemoryBackend) AddCustomActionTypeInternal(cat *CustomActionType)
- func (b *InMemoryBackend) AddJobInternal(job *Job)
- func (b *InMemoryBackend) AddPipelineInternal(decl PipelineDeclaration, tags map[string]string) *Pipeline
- func (b *InMemoryBackend) AddWebhookInternal(wh *Webhook)
- func (b *InMemoryBackend) CreateCustomActionType(ctx context.Context, cat *CustomActionType) (*CustomActionType, error)
- func (b *InMemoryBackend) CreatePipeline(ctx context.Context, decl PipelineDeclaration, tags map[string]string) (*Pipeline, error)
- func (b *InMemoryBackend) DeleteCustomActionType(ctx context.Context, category, provider, version string) error
- func (b *InMemoryBackend) DeletePipeline(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteWebhook(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeregisterWebhookWithThirdParty(ctx context.Context, name string) error
- func (b *InMemoryBackend) DisableStageTransition(ctx context.Context, pipelineName, stageName, transitionType, reason string) error
- func (b *InMemoryBackend) EnableStageTransition(ctx context.Context, pipelineName, stageName, transitionType string) error
- func (b *InMemoryBackend) GetActionType(ctx context.Context, category, owner, provider, version string) (*CustomActionType, error)
- func (b *InMemoryBackend) GetJobDetails(ctx context.Context, jobID string) (*Job, error)
- func (b *InMemoryBackend) GetPipeline(ctx context.Context, name string) (*Pipeline, error)
- func (b *InMemoryBackend) GetPipelineExecution(ctx context.Context, pipelineName, executionID string) (*PipelineExecution, error)
- func (b *InMemoryBackend) GetPipelineState(ctx context.Context, pipelineName string) ([]StageState, error)
- func (b *InMemoryBackend) GetStageTransitionState(ctx context.Context, pipelineName, stageName, transitionType string) *StageTransitionState
- func (b *InMemoryBackend) GetThirdPartyJobDetails(ctx context.Context, jobID, clientToken string) (*Job, error)
- func (b *InMemoryBackend) ListActionExecutions(ctx context.Context, pipelineName, pipelineExecutionID string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListActionTypes(ctx context.Context) []*CustomActionType
- func (b *InMemoryBackend) ListDeployActionExecutionTargets(ctx context.Context, pipelineName, executionID string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListPipelineExecutions(ctx context.Context, pipelineName string) ([]PipelineExecution, error)
- func (b *InMemoryBackend) ListPipelines(ctx context.Context) []PipelineSummary
- func (b *InMemoryBackend) ListRuleExecutions(ctx context.Context, pipelineName string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListRuleTypes() []map[string]any
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)
- func (b *InMemoryBackend) ListWebhooks(ctx context.Context) []*Webhook
- func (b *InMemoryBackend) OverrideStageCondition(ctx context.Context, pipelineName, stageName, executionID string) error
- func (b *InMemoryBackend) PollForJobs(ctx context.Context, category, owner, provider, version string) ([]*Job, error)
- func (b *InMemoryBackend) PollForThirdPartyJobs(ctx context.Context, category, provider, version string) ([]*Job, error)
- func (b *InMemoryBackend) PutActionRevision(ctx context.Context, ...) (*PipelineExecution, bool, error)
- func (b *InMemoryBackend) PutApprovalResult(ctx context.Context, ...) (time.Time, error)
- func (b *InMemoryBackend) PutJobFailureResult(ctx context.Context, jobID, message string) error
- func (b *InMemoryBackend) PutJobSuccessResult(ctx context.Context, jobID string) error
- func (b *InMemoryBackend) PutThirdPartyJobFailureResult(ctx context.Context, jobID, _, message string) error
- func (b *InMemoryBackend) PutThirdPartyJobSuccessResult(ctx context.Context, jobID, _ string) error
- func (b *InMemoryBackend) PutWebhook(ctx context.Context, wh *Webhook) (*Webhook, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RegisterWebhookWithThirdParty(ctx context.Context, name string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RetryStageExecution(ctx context.Context, pipelineName, stageName, executionID, retryMode string) (*PipelineExecution, error)
- func (b *InMemoryBackend) RollbackStage(ctx context.Context, pipelineName, stageName, targetExecutionID string) (*PipelineExecution, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartPipelineExecution(ctx context.Context, pipelineName string) (*PipelineExecution, error)
- func (b *InMemoryBackend) StopPipelineExecution(ctx context.Context, pipelineName, executionID, reason string, abandon bool) (*PipelineExecution, error)
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags []Tag) error
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateActionType(ctx context.Context, upd *CustomActionType) error
- func (b *InMemoryBackend) UpdatePipeline(ctx context.Context, decl PipelineDeclaration) (*Pipeline, error)
- type Job
- type JobWorkerExecutorConfig
- type LambdaExecutorConfig
- type Pipeline
- type PipelineDeclaration
- type PipelineExecution
- type PipelineMetadata
- type PipelineSummary
- type PipelineVariable
- type Provider
- type Rule
- type Stage
- type StageState
- type StageTransitionState
- type Tag
- type Trigger
- type Webhook
- type WebhookAuthConfig
- type WebhookFilter
Constants ¶
const ( // PipelineTypeV1 and PipelineTypeV2 are the valid PipelineType values. PipelineTypeV1 = "V1" PipelineTypeV2 = "V2" // ExecutionModeQueued is the QUEUED execution mode. ExecutionModeQueued = "QUEUED" // ExecutionModeSuperseded is the SUPERSEDED execution mode. ExecutionModeSuperseded = "SUPERSEDED" // ExecutionModeParallel is the PARALLEL execution mode. ExecutionModeParallel = "PARALLEL" // WebhookAuthGitHubHMAC is the GITHUB_HMAC authentication type for webhooks. WebhookAuthGitHubHMAC = "GITHUB_HMAC" // WebhookAuthIP is the IP authentication type for webhooks. WebhookAuthIP = "IP" // WebhookAuthUnauthenticated is the UNAUTHENTICATED authentication type for webhooks. WebhookAuthUnauthenticated = "UNAUTHENTICATED" )
Variables ¶
var ( // ErrNotFound is returned when a pipeline resource does not exist. ErrNotFound = awserr.New("PipelineNotFoundException", awserr.ErrNotFound) // ErrPipelineNameInUse is returned when a pipeline with the same name already exists. ErrPipelineNameInUse = awserr.New("PipelineNameInUseException", awserr.ErrAlreadyExists) // ErrAlreadyExists is returned when a non-pipeline resource with the same key already exists. ErrAlreadyExists = awserr.New("InvalidStructureException", awserr.ErrAlreadyExists) // ErrActionTypeNotFound is returned when a requested custom action type does not exist. ErrActionTypeNotFound = awserr.New("ActionTypeNotFoundException", awserr.ErrNotFound) // ErrJobNotFound is returned when a requested job does not exist. ErrJobNotFound = awserr.New("JobNotFoundException", awserr.ErrNotFound) // ErrWebhookNotFound is returned when a requested webhook does not exist. ErrWebhookNotFound = awserr.New("WebhookNotFoundException", awserr.ErrNotFound) // ErrValidation is returned when request input fails validation. ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter) // ErrConflict is returned on optimistic-concurrency version mismatch. ErrConflict = awserr.New("ConflictException", awserr.ErrConflict) // ErrResourceInUse is returned when a resource is referenced by another resource. ErrResourceInUse = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) // ErrResourceNotFound is returned for non-pipeline ARNs (e.g. webhook ARNs). ErrResourceNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrStageNotFound is returned when a stage name does not exist in a pipeline. ErrStageNotFound = awserr.New("StageNotFoundException", awserr.ErrNotFound) // ErrInvalidStructure is returned for structural pipeline validation errors. ErrInvalidStructure = awserr.New("InvalidStructureException", awserr.ErrInvalidParameter) // ErrExecutionNotFound is returned when a requested pipeline execution ID does not exist. ErrExecutionNotFound = awserr.New("PipelineExecutionNotFoundException", awserr.ErrNotFound) // ErrVersionNotFound is returned when a requested pipeline version does not exist. ErrVersionNotFound = awserr.New("PipelineVersionNotFoundException", awserr.ErrNotFound) // ErrActionNotFound is returned when a stage/action name does not exist, // or (for PutApprovalResult) does not identify an Approval-category action. ErrActionNotFound = awserr.New("ActionNotFoundException", awserr.ErrNotFound) // ErrInvalidApprovalToken is returned when PutApprovalResult's token does // not match the pending approval request's system-generated token. ErrInvalidApprovalToken = awserr.New("InvalidApprovalTokenException", awserr.ErrInvalidParameter) // ErrApprovalAlreadyCompleted is returned when PutApprovalResult targets // an action with no open (InProgress) approval request. ErrApprovalAlreadyCompleted = awserr.New("ApprovalAlreadyCompletedException", awserr.ErrConflict) // ErrStageNotRetryable is returned when RetryStageExecution targets a // stage/execution pair with no failed action to retry. ErrStageNotRetryable = awserr.New("StageNotRetryableException", awserr.ErrInvalidParameter) // ErrUnableToRollbackStage is returned when RollbackStage's target // execution never completed the given stage successfully. ErrUnableToRollbackStage = awserr.New("UnableToRollbackStageException", awserr.ErrInvalidParameter) )
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Configuration map[string]string `json:"configuration,omitempty"`
ActionTypeID ActionTypeID `json:"actionTypeId"`
Name string `json:"name"`
RoleArn string `json:"roleArn,omitempty"`
Region string `json:"region,omitempty"`
Namespace string `json:"namespace,omitempty"`
InputArtifacts []ArtifactRef `json:"inputArtifacts,omitempty"`
OutputArtifacts []ArtifactRef `json:"outputArtifacts,omitempty"`
RunOrder int `json:"runOrder,omitempty"`
TimeoutInMinutes int `json:"timeoutInMinutes,omitempty"`
}
Action represents a single action within a pipeline stage.
type ActionConfigurationProperty ¶
type ActionConfigurationProperty struct {
Description string `json:"description,omitempty"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Key bool `json:"key"`
Queryable bool `json:"queryable,omitempty"`
Required bool `json:"required"`
Secret bool `json:"secret"`
}
ActionConfigurationProperty represents a property in a custom action type's configuration.
type ActionExecution ¶
type ActionExecution struct {
StartTime time.Time `json:"startTime"`
LastUpdateTime time.Time `json:"lastUpdateTime"`
PipelineExecutionID string `json:"pipelineExecutionId"`
ActionExecutionID string `json:"actionExecutionId"`
StageName string `json:"stageName"`
ActionName string `json:"actionName"`
Status string `json:"status"`
Token string `json:"token,omitempty"`
Summary string `json:"summary,omitempty"`
}
ActionExecution records a single action's execution within a pipeline run.
Token carries the system-generated approval token while the action is a gating Approval-category action awaiting PutApprovalResult (InProgress with a non-empty Token); it is cleared once the approval is resolved. Summary carries the reviewer's PutApprovalResult summary, mirroring the real ActionExecution.Summary field.
type ActionRevisionRecord ¶ added in v1.2.0
type ActionRevisionRecord struct {
RevisionID string `json:"revisionId"`
RevisionChangeID string `json:"revisionChangeId"`
Created float64 `json:"created"`
}
ActionRevisionRecord tracks the most recent ActionRevision submitted via PutActionRevision for a single pipeline/stage/action, surfaced back through GetPipelineState's ActionState.CurrentRevision.
type ActionTypeExecutor ¶ added in v1.2.0
type ActionTypeExecutor struct {
Configuration *ActionTypeExecutorConfiguration `json:"configuration"`
Type string `json:"type"`
JobTimeout *int `json:"jobTimeout,omitempty"`
PolicyStatementsTemplate string `json:"policyStatementsTemplate,omitempty"`
}
ActionTypeExecutor is types.ActionTypeExecutor's wire-equivalent: the action engine (Lambda or JobWorker integration model) for an action type managed via the newer ActionTypeDeclaration shape (GetActionType/UpdateActionType), as opposed to the legacy ActionType shape (CreateCustomActionType/ListActionTypes) which has no Executor concept at all.
type ActionTypeExecutorConfiguration ¶ added in v1.2.0
type ActionTypeExecutorConfiguration struct {
// JobWorkerExecutorConfiguration configures Executor.Type == "JobWorker".
JobWorkerExecutorConfiguration *JobWorkerExecutorConfig `json:"jobWorkerExecutorConfiguration,omitempty"`
// LambdaExecutorConfiguration configures Executor.Type == "Lambda".
LambdaExecutorConfiguration *LambdaExecutorConfig `json:"lambdaExecutorConfiguration,omitempty"`
}
ActionTypeExecutorConfiguration is types.ExecutorConfiguration's wire-equivalent: exactly one of JobWorkerExecutorConfiguration/LambdaExecutorConfiguration is set, matching the real SDK (a union in practice, though not enforced as one server-side).
type ActionTypeID ¶
type ActionTypeID struct {
Category string `json:"category"`
Owner string `json:"owner"`
Provider string `json:"provider"`
Version string `json:"version"`
}
ActionTypeID represents the identifier for an action type.
type ActionTypePermissions ¶ added in v1.2.0
type ActionTypePermissions struct {
AllowedAccounts []string `json:"allowedAccounts,omitempty"`
}
ActionTypePermissions is types.ActionTypePermissions' wire-equivalent.
type ActionTypeProperty ¶ added in v1.2.0
type ActionTypeProperty struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Key bool `json:"key"`
NoEcho bool `json:"noEcho"`
Optional bool `json:"optional"`
Queryable bool `json:"queryable,omitempty"`
}
ActionTypeProperty is types.ActionTypeProperty's wire-equivalent: the ActionTypeDeclaration-shaped sibling of ActionConfigurationProperty (used by the legacy CreateCustomActionType/ListActionTypes shape). Same role, different real SDK type -- NoEcho/Optional here vs Required/Secret there.
type ActionTypeSettings ¶
type ActionTypeSettings struct {
EntityURLTemplate string `json:"entityUrlTemplate,omitempty"`
ExecutionURLTemplate string `json:"executionUrlTemplate,omitempty"`
RevisionURLTemplate string `json:"revisionUrlTemplate,omitempty"`
ThirdPartyConfigurationURL string `json:"thirdPartyConfigurationUrl,omitempty"`
}
ActionTypeSettings represents the URLs for a custom action type.
type ActionTypeUrls ¶ added in v1.2.0
type ActionTypeUrls struct {
ConfigurationURL string `json:"configurationUrl,omitempty"`
EntityURLTemplate string `json:"entityUrlTemplate,omitempty"`
ExecutionURLTemplate string `json:"executionUrlTemplate,omitempty"`
RevisionURLTemplate string `json:"revisionUrlTemplate,omitempty"`
}
ActionTypeUrls is types.ActionTypeUrls' wire-equivalent: the ActionTypeDeclaration-shaped sibling of ActionTypeSettings. Not a superset/subset of ActionTypeSettings -- ConfigurationURL has no legacy equivalent and ThirdPartyConfigurationUrl has no declaration equivalent, confirmed against types.ActionTypeUrls/types.ActionTypeSettings.
type ArtifactDetails ¶
type ArtifactDetails struct {
MinimumCount int `json:"minimumCount"`
MaximumCount int `json:"maximumCount"`
}
ArtifactDetails represents min/max artifact counts for a custom action type.
type ArtifactRef ¶
type ArtifactRef struct {
Name string `json:"name"`
}
ArtifactRef represents a reference to an artifact.
type ArtifactStore ¶
type ArtifactStore struct {
EncryptionKey *EncryptionKey `json:"encryptionKey,omitempty"`
Type string `json:"type"`
Location string `json:"location"`
}
ArtifactStore represents the artifact store for a pipeline stage.
type Condition ¶
type Condition struct {
Result string `json:"result,omitempty"`
Rules []Rule `json:"rules,omitempty"`
}
Condition represents a set of rules that control stage entry or exit.
type CustomActionType ¶
type CustomActionType struct {
Settings *ActionTypeSettings `json:"settings,omitempty"`
Urls *ActionTypeUrls `json:"urls,omitempty"`
Permissions *ActionTypePermissions `json:"permissions,omitempty"`
Executor *ActionTypeExecutor `json:"executor,omitempty"`
Tags map[string]string `json:"-"`
Description string `json:"description,omitempty"`
Owner string `json:"owner"`
Provider string `json:"provider"`
Version string `json:"version"`
Category string `json:"category"`
ConfigurationProperties []ActionConfigurationProperty `json:"configurationProperties,omitempty"`
Properties []ActionTypeProperty `json:"properties,omitempty"`
OutputArtifactDetails ArtifactDetails `json:"outputArtifactDetails"`
InputArtifactDetails ArtifactDetails `json:"inputArtifactDetails"`
// contains filtered or unexported fields
}
CustomActionType represents an in-memory custom action type.
Field order here is fieldalignment-optimized (slices, then same-size structs/ strings, then pointers/maps), not declaration/grouping order -- see the doc comments below for which real API shape each field belongs to.
type EncryptionKey ¶
EncryptionKey represents a KMS or custom encryption key for an artifact store.
type GitBranchFilterCriteria ¶
type GitBranchFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitBranchFilterCriteria is the include/exclude filter for branch names.
type GitConfiguration ¶
type GitConfiguration struct {
SourceActionName string `json:"sourceActionName"`
Push []GitPushFilter `json:"push,omitempty"`
PullRequest []GitPullRequestFilter `json:"pullRequest,omitempty"`
}
GitConfiguration holds the source action name and push/PR trigger filters.
type GitFilePathsFilterCriteria ¶
type GitFilePathsFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitFilePathsFilterCriteria is the include/exclude filter for file paths.
type GitPullRequestFilter ¶
type GitPullRequestFilter struct {
Branches *GitBranchFilterCriteria `json:"branches,omitempty"`
FilePaths *GitFilePathsFilterCriteria `json:"filePaths,omitempty"`
Events []string `json:"events,omitempty"`
}
GitPullRequestFilter describes what pull request events trigger the pipeline.
type GitPushFilter ¶
type GitPushFilter struct {
Branches *GitBranchFilterCriteria `json:"branches,omitempty"`
Tags *GitTagFilterCriteria `json:"tags,omitempty"`
FilePaths *GitFilePathsFilterCriteria `json:"filePaths,omitempty"`
}
GitPushFilter describes what git push events trigger the pipeline.
type GitTagFilterCriteria ¶
type GitTagFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitTagFilterCriteria is the include/exclude filter for git tags.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for CodePipeline operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new CodePipeline handler backed by backend.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the CodePipeline action from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request (not used for CodePipeline).
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for CodePipeline requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches CodePipeline requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is a thread-safe in-memory store for CodePipeline resources.
pipelines, customActionTypes, jobs, webhooks, and stageTransitions are flat store.Table collections keyed by a composite "region|id" string (see regionKey below), replacing the old map[string]map[K]*V nesting (outer key = region) that isolated same-named resources across regions. Each table's companion *store.Index values replace the old per-region iteration/reverse-ARN-map lookups -- see store_setup.go. executions and actionExecutions remain plain region-nested maps: their values are bare []*T slices with no identity of their own, so they are not candidates for store.Table (see pkgs/store's package doc). Callers must hold b.mu while accessing any of these collections.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new backend for the given account and region.
func (*InMemoryBackend) AcknowledgeJob ¶
AcknowledgeJob acknowledges that a job worker has received a job. Returns InProgress if Nonce matches; otherwise returns current status unchanged.
func (*InMemoryBackend) AcknowledgeThirdPartyJob ¶
func (b *InMemoryBackend) AcknowledgeThirdPartyJob( ctx context.Context, jobID, nonce, clientToken string, ) (string, error)
AcknowledgeThirdPartyJob acknowledges that a third-party job worker has received a job.
func (*InMemoryBackend) AddCustomActionTypeInternal ¶
func (b *InMemoryBackend) AddCustomActionTypeInternal(cat *CustomActionType)
AddCustomActionTypeInternal seeds a custom action type into the backend's default region (for testing).
func (*InMemoryBackend) AddJobInternal ¶
func (b *InMemoryBackend) AddJobInternal(job *Job)
AddJobInternal seeds a job into the backend's default region (for testing).
func (*InMemoryBackend) AddPipelineInternal ¶
func (b *InMemoryBackend) AddPipelineInternal(decl PipelineDeclaration, tags map[string]string) *Pipeline
AddPipelineInternal seeds a pipeline directly into the backend's default region (for testing).
func (*InMemoryBackend) AddWebhookInternal ¶
func (b *InMemoryBackend) AddWebhookInternal(wh *Webhook)
AddWebhookInternal seeds a webhook into the backend's default region (for testing).
func (*InMemoryBackend) CreateCustomActionType ¶
func (b *InMemoryBackend) CreateCustomActionType( ctx context.Context, cat *CustomActionType, ) (*CustomActionType, error)
CreateCustomActionType stores a new custom action type.
func (*InMemoryBackend) CreatePipeline ¶
func (b *InMemoryBackend) CreatePipeline( ctx context.Context, decl PipelineDeclaration, tags map[string]string, ) (*Pipeline, error)
CreatePipeline creates a new CodePipeline pipeline.
func (*InMemoryBackend) DeleteCustomActionType ¶
func (b *InMemoryBackend) DeleteCustomActionType(ctx context.Context, category, provider, version string) error
DeleteCustomActionType removes a custom action type. Returns ResourceInUseException if any pipeline references the type.
func (*InMemoryBackend) DeletePipeline ¶
func (b *InMemoryBackend) DeletePipeline(ctx context.Context, name string) error
DeletePipeline removes the pipeline with the given name and cleans up associated state.
func (*InMemoryBackend) DeleteWebhook ¶
func (b *InMemoryBackend) DeleteWebhook(ctx context.Context, name string) error
DeleteWebhook removes a webhook by name (idempotent).
func (*InMemoryBackend) DeregisterWebhookWithThirdParty ¶
func (b *InMemoryBackend) DeregisterWebhookWithThirdParty(ctx context.Context, name string) error
DeregisterWebhookWithThirdParty clears the third-party registration flag on a webhook.
func (*InMemoryBackend) DisableStageTransition ¶
func (b *InMemoryBackend) DisableStageTransition( ctx context.Context, pipelineName, stageName, transitionType, reason string, ) error
DisableStageTransition disables a stage transition and records the reason. Returns StageNotFoundException if stageName does not exist in the pipeline.
func (*InMemoryBackend) EnableStageTransition ¶
func (b *InMemoryBackend) EnableStageTransition( ctx context.Context, pipelineName, stageName, transitionType string, ) error
EnableStageTransition re-enables a stage transition.
func (*InMemoryBackend) GetActionType ¶
func (b *InMemoryBackend) GetActionType( ctx context.Context, category, owner, provider, version string, ) (*CustomActionType, error)
GetActionType retrieves a custom action type.
func (*InMemoryBackend) GetJobDetails ¶
GetJobDetails returns details for a job by ID.
func (*InMemoryBackend) GetPipeline ¶
GetPipeline returns the pipeline with the given name.
func (*InMemoryBackend) GetPipelineExecution ¶
func (b *InMemoryBackend) GetPipelineExecution( ctx context.Context, pipelineName, executionID string, ) (*PipelineExecution, error)
GetPipelineExecution returns the stored execution by pipeline name and execution ID.
func (*InMemoryBackend) GetPipelineState ¶
func (b *InMemoryBackend) GetPipelineState(ctx context.Context, pipelineName string) ([]StageState, error)
GetPipelineState returns the current state of each stage in a pipeline.
func (*InMemoryBackend) GetStageTransitionState ¶
func (b *InMemoryBackend) GetStageTransitionState( ctx context.Context, pipelineName, stageName, transitionType string, ) *StageTransitionState
GetStageTransitionState returns the disabled state for a stage transition, or nil if enabled.
func (*InMemoryBackend) GetThirdPartyJobDetails ¶
func (b *InMemoryBackend) GetThirdPartyJobDetails(ctx context.Context, jobID, clientToken string) (*Job, error)
GetThirdPartyJobDetails returns details for a third-party job.
func (*InMemoryBackend) ListActionExecutions ¶
func (b *InMemoryBackend) ListActionExecutions( ctx context.Context, pipelineName, pipelineExecutionID string, ) ([]map[string]any, error)
ListActionExecutions returns the recorded action executions for a pipeline, most recent first. An optional pipelineExecutionId filters to a single run.
func (*InMemoryBackend) ListActionTypes ¶
func (b *InMemoryBackend) ListActionTypes(ctx context.Context) []*CustomActionType
ListActionTypes returns all registered action types in the request region.
func (*InMemoryBackend) ListDeployActionExecutionTargets ¶
func (b *InMemoryBackend) ListDeployActionExecutionTargets( ctx context.Context, pipelineName, executionID string, ) ([]map[string]any, error)
ListDeployActionExecutionTargets returns the deploy targets for an action execution. The emulator does not model deployment targets, so it returns an empty (but valid) list for a known pipeline and ErrNotFound otherwise.
func (*InMemoryBackend) ListPipelineExecutions ¶
func (b *InMemoryBackend) ListPipelineExecutions( ctx context.Context, pipelineName string, ) ([]PipelineExecution, error)
ListPipelineExecutions returns stored executions for a pipeline, most recent first.
func (*InMemoryBackend) ListPipelines ¶
func (b *InMemoryBackend) ListPipelines(ctx context.Context) []PipelineSummary
ListPipelines returns a sorted summary of all pipelines in the request region.
func (*InMemoryBackend) ListRuleExecutions ¶
func (b *InMemoryBackend) ListRuleExecutions(ctx context.Context, pipelineName string) ([]map[string]any, error)
ListRuleExecutions returns rule executions for a pipeline. The emulator does not run condition rules, so this returns an empty (but valid) list for a known pipeline and ErrNotFound otherwise.
func (*InMemoryBackend) ListRuleTypes ¶
func (b *InMemoryBackend) ListRuleTypes() []map[string]any
ListRuleTypes returns the AWS-managed CodePipeline rule types. These mirror the built-in condition rule providers AWS exposes.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)
ListTagsForResource returns the sorted tags for a pipeline by ARN. Returns ResourceNotFoundException when the ARN refers to a non-pipeline resource.
func (*InMemoryBackend) ListWebhooks ¶
func (b *InMemoryBackend) ListWebhooks(ctx context.Context) []*Webhook
ListWebhooks returns all webhooks in the request region, sorted by name.
func (*InMemoryBackend) OverrideStageCondition ¶
func (b *InMemoryBackend) OverrideStageCondition( ctx context.Context, pipelineName, stageName, executionID string, ) error
OverrideStageCondition overrides a stage's BEFORE_ENTRY or ON_SUCCESS condition result (types.ConditionType), letting a pipeline execution proceed past a blocking condition. In real AWS this flips the relevant StageState.{BeforeEntryConditionState,OnSuccessConditionState} .LatestExecution.Status to ConditionExecutionStatusOverridden ("Overridden").
This backend cannot perform that mutation because it has no condition-rule engine anywhere: StageDeclaration here has no BeforeEntry/OnFailure/ OnSuccess members at all (the real SDK's StageDeclaration.BeforeEntry /OnFailure/OnSuccess -- BeforeEntryConditions/FailureConditions/ SuccessConditions, each wrapping []Condition/[]RuleDeclaration -- is entirely unimplemented: CreatePipeline never parses it, and StageState here has no BeforeEntryConditionState/OnSuccessConditionState/ OnFailureConditionState to flip in the first place). Building real condition-rule evaluation (parsing stage Conditions, gating stage entry on rule results, tracking per-execution ConditionState/RuleState) would be a new subsystem, not a field patch, and is out of scope here -- see PARITY.md for the explicit gap writeup. ListRuleExecutions (rules.go) is correspondingly always empty for the same underlying reason: there is never a rule execution to report because rules never run.
Given that, this validates the pipeline, stage, and pipeline execution referenced by the request all exist (real backend logic, not a stub) and otherwise performs no additional mutation, which is the AWS-correct wire shape for this op regardless (OverrideStageConditionOutput carries no fields) -- but the *effect* AWS documents (unblocking a waiting stage) is an honest no-op here because there is nothing to unblock.
func (*InMemoryBackend) PollForJobs ¶
func (b *InMemoryBackend) PollForJobs(ctx context.Context, category, owner, provider, version string) ([]*Job, error)
PollForJobs returns available queued jobs matching the given ActionTypeID.
func (*InMemoryBackend) PollForThirdPartyJobs ¶
func (b *InMemoryBackend) PollForThirdPartyJobs( ctx context.Context, category, provider, version string, ) ([]*Job, error)
PollForThirdPartyJobs returns available third-party jobs.
func (*InMemoryBackend) PutActionRevision ¶
func (b *InMemoryBackend) PutActionRevision( ctx context.Context, pipelineName, stageName, actionName, revisionID, revisionChangeID string, ) (*PipelineExecution, bool, error)
PutActionRevision records a new ActionRevision for a pipeline source action and starts a new pipeline execution to process it, mirroring real AWS's "PutActionRevision triggers a pipeline execution" behavior. NewRevision reports whether revisionID differs from the previously stored revision for this stage/action (false the first time it is called with an identical revisionID, matching the real semantics of "was this revision already processed by this pipeline").
func (*InMemoryBackend) PutApprovalResult ¶
func (b *InMemoryBackend) PutApprovalResult( ctx context.Context, pipelineName, stageName, actionName, token, status, summary string, ) (time.Time, error)
PutApprovalResult submits a manual approval or rejection for a pipeline's pending Approval-category action, resuming (Approved) or failing (Rejected) the paused pipeline execution that action gated -- see runPipelineActions in action_engine.go for how the gate is created. Returns the timestamp the result was recorded, for the wire response's approvedAt field.
func (*InMemoryBackend) PutJobFailureResult ¶
func (b *InMemoryBackend) PutJobFailureResult(ctx context.Context, jobID, message string) error
PutJobFailureResult acknowledges job failure.
func (*InMemoryBackend) PutJobSuccessResult ¶
func (b *InMemoryBackend) PutJobSuccessResult(ctx context.Context, jobID string) error
PutJobSuccessResult acknowledges job success.
func (*InMemoryBackend) PutThirdPartyJobFailureResult ¶
func (b *InMemoryBackend) PutThirdPartyJobFailureResult(ctx context.Context, jobID, _, message string) error
PutThirdPartyJobFailureResult acknowledges third-party job failure.
func (*InMemoryBackend) PutThirdPartyJobSuccessResult ¶
func (b *InMemoryBackend) PutThirdPartyJobSuccessResult(ctx context.Context, jobID, _ string) error
PutThirdPartyJobSuccessResult acknowledges third-party job success.
func (*InMemoryBackend) PutWebhook ¶
PutWebhook creates or updates a webhook with full definition fields.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default region for this backend instance.
func (*InMemoryBackend) RegisterWebhookWithThirdParty ¶
func (b *InMemoryBackend) RegisterWebhookWithThirdParty(ctx context.Context, name string) error
RegisterWebhookWithThirdParty registers a webhook with a third-party provider.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state in the backend, resetting it to a pristine empty state.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot produced by Snapshot.
func (*InMemoryBackend) RetryStageExecution ¶
func (b *InMemoryBackend) RetryStageExecution( ctx context.Context, pipelineName, stageName, executionID, retryMode string, ) (*PipelineExecution, error)
RetryStageExecution retries the failed actions of a stage within a specific pipeline execution. RetryMode FAILED_ACTIONS (the common case) resets only actions currently Failed/Abandoned in that stage; ALL_ACTIONS resets every action in the stage regardless of status. Either way, at least one action in the stage must currently be Failed/Abandoned for this execution or StageNotRetryableException is returned (matching real AWS, which only allows retrying a stage that actually failed). The reset actions are then re-run synchronously via runPipelineActions, resuming the SAME pipeline execution from that point -- unlike RollbackStage, retry never creates a new execution.
func (*InMemoryBackend) RollbackStage ¶
func (b *InMemoryBackend) RollbackStage( ctx context.Context, pipelineName, stageName, targetExecutionID string, ) (*PipelineExecution, error)
RollbackStage rolls back stageName to the state it was in after targetExecutionID last completed it successfully, creating (and persisting) a new ROLLBACK-type PipelineExecution rather than mutating the target execution. Real AWS requires the target execution to have actually succeeded through that stage; this backend enforces the same precondition via stageSucceededInExecution and returns UnableToRollbackStageException otherwise.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. Returns nil on marshal failure.
func (*InMemoryBackend) StartPipelineExecution ¶
func (b *InMemoryBackend) StartPipelineExecution(ctx context.Context, pipelineName string) (*PipelineExecution, error)
StartPipelineExecution starts and stores a new execution of a pipeline.
gopherstack runs every action synchronously via runPipelineActions (action_engine.go): ordinary actions complete instantly, but an Approval-category action gates the run and leaves the execution InProgress until PutApprovalResult resolves it (see PutApprovalResult in approvals.go). Leaving Status at statusInProgress unconditionally here (the pre-fix behavior) left every execution stuck InProgress forever, even when it contained no approval gate at all: GetPipelineExecution/ ListPipelineExecutions would never report a terminal status, so any client polling for completion (as the real, asynchronous AWS service expects callers to do) would spin indefinitely.
func (*InMemoryBackend) StopPipelineExecution ¶
func (b *InMemoryBackend) StopPipelineExecution( ctx context.Context, pipelineName, executionID, reason string, abandon bool, ) (*PipelineExecution, error)
StopPipelineExecution stops a pipeline execution. Real AWS transitions through a transient "Stopping" state while in-progress actions finish (or are abandoned, if abandon is true) before reaching the terminal "Stopped" state. gopherstack runs every ordinary action synchronously and instantaneously (see StartPipelineExecution), so there is never an in-progress *ordinary* action left to wait for -- the execution goes straight to "Stopped" regardless of abandon. Leaving it at "Stopping" left every stopped execution stuck there forever, indistinguishable (to a polling client) from a stop request that never completed.
An execution can, however, still be genuinely InProgress here if it is gated on a manual approval (see runPipelineActions in action_engine.go): stopping such an execution abandons that pending approval action (marks it Abandoned and clears its token) so a subsequent PutApprovalResult against a stopped execution correctly fails instead of silently resurrecting it.
func (*InMemoryBackend) TagResource ¶
TagResource adds or updates tags on a pipeline by ARN.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
UntagResource removes tags from a pipeline by ARN.
func (*InMemoryBackend) UpdateActionType ¶
func (b *InMemoryBackend) UpdateActionType(ctx context.Context, upd *CustomActionType) error
UpdateActionType updates an action type using the real ActionTypeDeclaration shape (Description/Executor/InputArtifactDetails/OutputArtifactDetails/ Permissions/Properties/Urls). Only fields ActionTypeDeclaration can express are replaced; the legacy CreateCustomActionType-era Settings/ConfigurationProperties (and Tags) have no equivalent in this op's real input and are preserved unchanged on the existing record -- AWS's real UpdateActionType has no way to clear data its own input shape can't carry.
func (*InMemoryBackend) UpdatePipeline ¶
func (b *InMemoryBackend) UpdatePipeline(ctx context.Context, decl PipelineDeclaration) (*Pipeline, error)
UpdatePipeline replaces the pipeline declaration. decl.Version, if set by the caller, is IGNORED: real AWS's PipelineDeclaration.Version field is documented as purely informational/system-managed ("A new pipeline always has a version number of 1. This number is incremented when a pipeline is updated" -- aws-sdk-go-v2/service/codepipeline/types/types.go), with no documented optimistic-concurrency check against it anywhere in UpdatePipeline's contract, and the real UpdatePipeline API/CLI docs describe updating as always incrementing the version by exactly 1 regardless of what the caller sent. An earlier revision of this backend rejected a mismatched Version with a fabricated ConflictException (flagged, but left unfixed, in a prior audit pass -- see PARITY.md); that was gopherstack-invented behavior with no basis in the real API and has been removed.
type Job ¶
type Job struct {
ActionTypeID ActionTypeID `json:"actionTypeId,omitzero"`
ID string `json:"id"`
PipelineName string `json:"pipelineName,omitempty"`
Nonce string `json:"nonce"`
Status string `json:"status"`
// contains filtered or unexported fields
}
Job represents a CodePipeline job queued for a custom action.
type JobWorkerExecutorConfig ¶ added in v1.2.0
type JobWorkerExecutorConfig struct {
PollingAccounts []string `json:"pollingAccounts,omitempty"`
PollingServicePrincipals []string `json:"pollingServicePrincipals,omitempty"`
}
JobWorkerExecutorConfig is types.JobWorkerExecutorConfiguration's wire-equivalent: the accounts/service-principals allowed to poll for jobs when Executor.Type is "JobWorker". Both members are optional per the real SDK.
type LambdaExecutorConfig ¶ added in v1.2.0
type LambdaExecutorConfig struct {
LambdaFunctionArn string `json:"lambdaFunctionArn,omitempty"`
}
LambdaExecutorConfig is types.LambdaExecutorConfiguration's wire-equivalent: the Lambda function backing an ActionTypeDeclaration's Executor when Executor.Type is "Lambda".
type Pipeline ¶
type Pipeline struct {
Tags map[string]string `json:"tags"`
Declaration PipelineDeclaration `json:"declaration"`
Metadata PipelineMetadata `json:"metadata"`
// contains filtered or unexported fields
}
Pipeline wraps the declaration and metadata.
type PipelineDeclaration ¶
type PipelineDeclaration struct {
ArtifactStores map[string]ArtifactStore `json:"artifactStores,omitempty"`
ArtifactStore ArtifactStore `json:"artifactStore"`
Name string `json:"name"`
RoleArn string `json:"roleArn"`
PipelineType string `json:"pipelineType,omitempty"`
ExecutionMode string `json:"executionMode,omitempty"`
Stages []Stage `json:"stages"`
Variables []PipelineVariable `json:"variables,omitempty"`
Triggers []Trigger `json:"triggers,omitempty"`
Version int `json:"version"`
}
PipelineDeclaration represents the full pipeline structure.
type PipelineExecution ¶
type PipelineExecution struct {
StartTime time.Time `json:"startTime"`
LastUpdateTime time.Time `json:"lastUpdateTime"`
PipelineName string `json:"pipelineName"`
PipelineExecutionID string `json:"pipelineExecutionId"`
Status string `json:"status"`
Trigger string `json:"trigger,omitempty"`
ExecutionMode string `json:"executionMode,omitempty"`
ExecutionType string `json:"executionType,omitempty"`
RollbackTargetExecutionID string `json:"rollbackTargetExecutionId,omitempty"`
PipelineVersion int `json:"pipelineVersion"`
}
PipelineExecution represents a stored pipeline execution.
RollbackTargetExecutionID is set only for ExecutionType ROLLBACK executions created by RollbackStage; it mirrors the real PipelineRollbackMetadata.RollbackTargetPipelineExecutionId field.
type PipelineMetadata ¶
type PipelineMetadata struct {
PipelineArn string `json:"pipelineArn"`
Created float64 `json:"created"`
Updated float64 `json:"updated"`
}
PipelineMetadata holds pipeline metadata.
type PipelineSummary ¶
type PipelineSummary struct {
PipelineArn string `json:"pipelineArn,omitempty"`
Name string `json:"name"`
PipelineType string `json:"pipelineType,omitempty"`
ExecutionMode string `json:"executionMode,omitempty"`
Version int `json:"version"`
Created float64 `json:"created"`
Updated float64 `json:"updated"`
}
PipelineSummary is a condensed view of a pipeline for listing.
type PipelineVariable ¶
type PipelineVariable struct {
Name string `json:"name"`
DefaultValue string `json:"defaultValue,omitempty"`
Description string `json:"description,omitempty"`
}
PipelineVariable represents a pipeline-level variable declaration.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for AWS CodePipeline.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the CodePipeline service backend and handler.
type Rule ¶
type Rule struct {
Configuration map[string]string `json:"configuration,omitempty"`
RuleTypeID ActionTypeID `json:"ruleTypeId"`
Name string `json:"name"`
RoleArn string `json:"roleArn,omitempty"`
Region string `json:"region,omitempty"`
InputArtifacts []ArtifactRef `json:"inputArtifacts,omitempty"`
}
Rule represents a condition rule within a stage condition.
type Stage ¶
type Stage struct {
BeforeEntry *Condition `json:"beforeEntry,omitempty"`
OnFailure *Condition `json:"onFailure,omitempty"`
OnSuccess *Condition `json:"onSuccess,omitempty"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Actions []Action `json:"actions"`
}
Stage represents a pipeline stage.
type StageState ¶
type StageState struct {
InboundTransitionState *StageTransitionState
OutboundTransitionState *StageTransitionState
StageName string
ActionStates []map[string]any
}
StageState represents the state of a pipeline stage.
type StageTransitionState ¶
type StageTransitionState struct {
PipelineName string `json:"pipelineName"`
StageName string `json:"stageName"`
TransitionType string `json:"transitionType"`
Reason string `json:"reason"`
Disabled bool `json:"disabled"`
// contains filtered or unexported fields
}
StageTransitionState holds the disabled state and reason for a pipeline stage transition.
type Trigger ¶
type Trigger struct {
GitConfiguration *GitConfiguration `json:"gitConfiguration,omitempty"`
ProviderType string `json:"providerType"`
}
Trigger represents a pipeline trigger definition.
type Webhook ¶
type Webhook struct {
Tags map[string]string `json:"-"`
AuthenticationConfiguration WebhookAuthConfig `json:"authenticationConfiguration,omitzero"`
Name string `json:"name"`
TargetPipeline string `json:"targetPipeline"`
TargetAction string `json:"targetAction"`
Authentication string `json:"authentication,omitempty"`
URL string `json:"url,omitempty"`
ARN string `json:"arn,omitempty"`
LastTriggered string `json:"lastTriggered,omitempty"`
Filters []WebhookFilter `json:"filters,omitempty"`
RegisteredWithThirdParty bool `json:"registeredWithThirdParty"`
// contains filtered or unexported fields
}
Webhook represents a CodePipeline webhook with full AWS-parity fields.
type WebhookAuthConfig ¶
type WebhookAuthConfig struct {
SecretToken string `json:"secretToken,omitempty"`
AllowedIPRange string `json:"allowedIPRange,omitempty"`
}
WebhookAuthConfig holds the authentication configuration for a webhook.
type WebhookFilter ¶
type WebhookFilter struct {
JSONPath string `json:"jsonPath"`
MatchEquals string `json:"matchEquals,omitempty"`
}
WebhookFilter represents a filter applied to incoming webhook payloads.
Source Files
¶
- action_engine.go
- approvals.go
- custom_action_types.go
- errors.go
- handler.go
- handler_approvals.go
- handler_custom_action_types.go
- handler_jobs.go
- handler_pipeline_executions.go
- handler_pipeline_state.go
- handler_pipelines.go
- handler_rules.go
- handler_tags.go
- handler_third_party_jobs.go
- handler_webhooks.go
- jobs.go
- models.go
- persistence.go
- pipeline_executions.go
- pipeline_state.go
- pipelines.go
- provider.go
- rules.go
- store.go
- store_setup.go
- tags.go
- third_party_jobs.go
- webhooks.go