codepipeline

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 22 Imported by: 0

README

CodePipeline

Parity grade: A · SDK aws-sdk-go-v2/service/codepipeline@v1.48.0 · last audited 2026-07-12 (0627d5d3)

Coverage

Metric Value
Operations audited 14 (11 ok, 2 partial, 1 deferred)
Feature families 5 (5 ok)
Known gaps 4
Deferred items 3
Resource leaks clean
Known gaps
  • RetryStageExecution, RollbackStage, OverrideStageCondition, PutActionRevision, PutApprovalResult validate the pipeline exists but otherwise perform no real state mutation (RetryStageExecution/RollbackStage fabricate a PipelineExecution response that is never persisted to executionsStore, so a subsequent GetPipelineExecution/ListPipelineExecutions will not reflect the retry/rollback). Deep fix requires modeling per-action failure/approval state, which no other part of this backend tracks either (all actions succeed synchronously on Start). Out of scope for this pass; not in the priority family list.
  • ListDeployActionExecutionTargets always returns an empty list -- no deploy-target model exists (documented in source, consistent with ListRuleExecutions' scoped-down design).
  • PutApprovalResult does not update actionStates/GetPipelineState output -- manual-approval actions are not modeled as a distinct action-state machine.
  • UpdatePipeline rejects a version mismatch with ConflictException; real AWS documentation does not clearly specify this as a hard requirement (the input Version field is described as system-managed). Left as-is since it is a defensible, non-obviously-wrong emulator choice and no test/behavior contradicts it; flagged for a future audit to verify against SDK integration tests.
Deferred
  • RetryStageExecution / RollbackStage / OverrideStageCondition deep state modeling
  • PutActionRevision / PutApprovalResult deep state modeling
  • ListPipelineExecutions / GetPipelineExecution optional-field completeness (StartTime, LastUpdateTime, SourceRevisions, ExecutionMode, ExecutionType, Trigger, ArtifactRevisions, RollbackMetadata, Variables)

More

Documentation

Overview

Package codepipeline provides an in-memory implementation of the AWS CodePipeline service.

Index

Constants

View Source
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

View Source
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)
)
View Source
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"`
}

ActionExecution records a single action's execution within a pipeline run.

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 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 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"`
	Tags     map[string]string   `json:"-"`

	Category                string                        `json:"category"`
	Owner                   string                        `json:"owner"`
	Provider                string                        `json:"provider"`
	Version                 string                        `json:"version"`
	ConfigurationProperties []ActionConfigurationProperty `json:"configurationProperties,omitempty"`
	InputArtifactDetails    ArtifactDetails               `json:"inputArtifactDetails"`
	OutputArtifactDetails   ArtifactDetails               `json:"outputArtifactDetails"`
	// contains filtered or unexported fields
}

CustomActionType represents an in-memory custom action type.

type EncryptionKey

type EncryptionKey struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

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

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the CodePipeline action from the X-Amz-Target header.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(_ *echo.Context) string

ExtractResource extracts the resource identifier from the request (not used for CodePipeline).

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

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

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all handler and backend state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches CodePipeline requests.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

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

func (b *InMemoryBackend) AcknowledgeJob(ctx context.Context, jobID, nonce string) (string, error)

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

func (b *InMemoryBackend) GetJobDetails(ctx context.Context, jobID string) (*Job, error)

GetJobDetails returns details for a job by ID.

func (*InMemoryBackend) GetPipeline

func (b *InMemoryBackend) GetPipeline(ctx context.Context, name string) (*Pipeline, error)

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 condition.

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 string) error

PutActionRevision puts an action revision for a pipeline source action.

func (*InMemoryBackend) PutApprovalResult

func (b *InMemoryBackend) PutApprovalResult(
	ctx context.Context,
	pipelineName, stageName, actionName, status, summary string,
) error

PutApprovalResult submits a manual approval for a pipeline action.

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

func (b *InMemoryBackend) PutWebhook(ctx context.Context, wh *Webhook) (*Webhook, error)

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 string,
) (*PipelineExecution, error)

RetryStageExecution retries a failed stage in a pipeline.

func (*InMemoryBackend) RollbackStage

func (b *InMemoryBackend) RollbackStage(
	ctx context.Context,
	pipelineName, stageName, targetExecutionID string,
) (*PipelineExecution, error)

RollbackStage rolls back a stage to a previous successful execution.

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.

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 action synchronously and instantaneously (see StartPipelineExecution), so there is never an in-progress action left to wait for by the time a client can call this -- 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.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags []Tag) error

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, cat *CustomActionType) error

UpdateActionType updates an action type definition with full fields.

func (*InMemoryBackend) UpdatePipeline

func (b *InMemoryBackend) UpdatePipeline(ctx context.Context, decl PipelineDeclaration) (*Pipeline, error)

UpdatePipeline replaces the pipeline declaration. If decl.Version is non-zero it must match the current version (optimistic concurrency).

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 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 {
	PipelineName        string `json:"pipelineName"`
	PipelineExecutionID string `json:"pipelineExecutionId"`
	Status              string `json:"status"`
	Trigger             string `json:"trigger,omitempty"`
	PipelineVersion     int    `json:"pipelineVersion"`
}

PipelineExecution represents a stored pipeline execution.

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

Init initializes the CodePipeline service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

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 Tag

type Tag struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Tag represents a key-value tag.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL