pipelines

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPipelineReferenceNotFound         = xerror.NotFound(xerror.PipelineReference)
	ErrPipelineDraftAttemptStale         = xerror.InvalidInput(xerror.PipelineReference).Detail("pipeline draft attempt is stale")
	ErrPipelineProposalAuthorityNotFound = xerror.NotFound(xerror.PipelineReference).
											Detail("active pipeline proposal authority not found")
	ErrPipelineDeploymentConflict = xerror.New(xerror.KindAlreadyExists, "PIPELINE_DEPLOYMENT_CONFLICT", "pipeline deployment conflict")
	ErrPipelineDeploymentNotFound = xerror.NotFound(xerror.PipelineDeployment)
	ErrPipelineVersionNotFound    = xerror.NotFound(xerror.PipelineVersion)
	ErrPipelineVersionAmbiguous   = xerror.InvalidInput(xerror.PipelineVersion)
)

Functions

func SyncStatusStrings

func SyncStatusStrings() []string

SyncStatusStrings returns a slice of all String values of the enum

Types

type CompleteDraftPublishParams

type CompleteDraftPublishParams struct {
	PipelineSlug          slug.Slug
	MemberSlug            slug.Slug
	DraftState            string
	BranchName            string
	BranchHeadSHA         string
	ProposalProvider      string
	ProposalID            string
	ProposalURL           string
	ProposalState         string
	LastProposedDraftHash string
	PublishAttemptID      string
}

CompleteDraftPublishParams contains safe provider metadata returned by proposal execution.

type CreateVersionParams

type CreateVersionParams struct {
	SourcePath        *string
	PipelineSlug      slug.Slug
	GitCommitSHA      *string
	SpecJSONB         []byte
	SpecHash          string
	ResolvedContracts []byte
}

CreateVersionParams contains fields for creating a pipeline version.

type DeployParams

type DeployParams struct {
	ExpectedRevision        *int64
	ResolutionDigest        *string
	PipelineSlug            slug.Slug
	VersionID               int64
	ExpectedCurrentSpecHash *string
	DeployedByActorType     string
	DeployedByActorSlug     *slug.Slug
}

DeployParams contains fields for pointing an environment at a pipeline version.

type FailDraftProposalRefreshParams

type FailDraftProposalRefreshParams struct {
	PipelineSlug     slug.Slug
	MemberSlug       slug.Slug
	ProposalID       string
	RefreshAttemptID string
	FailureCode      string
	FailureMessage   string
}

FailDraftProposalRefreshParams records safe diagnostics without changing proposal lifecycle state.

type FailDraftPublishParams

type FailDraftPublishParams struct {
	PipelineSlug     slug.Slug
	MemberSlug       slug.Slug
	DraftState       string
	PublishAttemptID string
	FailureCode      string
	FailureMessage   string
}

FailDraftPublishParams identifies a member proposal whose latest provider attempt failed.

type PipelineDeployment

type PipelineDeployment struct {
	Revision                 int64
	CurrentResolutionDigest  *string
	PreviousResolutionDigest *string
	ID                       int64
	ProjectSlug              slug.Slug
	EnvironmentSlug          slug.Slug
	PipelineSlug             slug.Slug
	CurrentVersionID         int64
	CurrentVersionSpecHash   string
	PreviousVersionID        *int64
	PreviousVersionSpecHash  *string
	DeployedByActorType      string
	DeployedByActorSlug      *string
	DeployedAt               time.Time
	UpdatedAt                time.Time
}

PipelineDeployment stores the deployed immutable version for one project environment.

type PipelineDraft

type PipelineDraft struct {
	PipelineSlug              slug.Slug
	BasedOnVersionID          *int64
	BasedOnSpecHash           *string
	CurrentVersionID          *int64
	SpecJSONB                 []byte
	DraftState                *string
	BaseRef                   *string
	BaseCommitSHA             *string
	BranchName                *string
	BranchHeadSHA             *string
	ProposalProvider          *string
	ProposalID                *string
	ProposalURL               *string
	ProposalState             *string
	LastProposedDraftHash     *string
	QueuedAt                  *time.Time
	ProposalUpdatedAt         *time.Time
	FailedAt                  *time.Time
	PublishAttemptID          *string
	RefreshAttemptID          *string
	FailureCode               *string
	FailureMessage            *string
	ProposalAuthorityID       *int64
	PublicationMode           *string
	ProviderHost              *string
	ProviderAccountID         *string
	ProviderRepositoryID      *string
	ProviderCredentialID      *string
	ExecutingPrincipalID      *string
	ExecutingPrincipalDisplay *string
	AuthoritySource           *string
	CreatedAt                 time.Time
	UpdatedAt                 time.Time
}

PipelineDraft stores mutable draft pipeline state.

type PipelineReference

type PipelineReference struct {
	Slug             slug.Slug
	Name             string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	CurrentVersionID *int64
	HasDraft         bool
}

PipelineReference holds indexed pipeline identity metadata.

type PipelineSpec

type PipelineSpec struct {
	Slug                   slug.Slug
	Name                   string
	HasDraft               bool
	SpecJSONB              []byte
	SpecHash               string
	CurrentVersionID       *int64
	CurrentVersionSpecHash *string
	SyncStatus             SyncStatus
	SourcePath             *string
	SourceRef              *string
	LastAppliedCommit      *string
	CreatedAt              time.Time
	UpdatedAt              time.Time
}

PipelineSpec holds the DB-canonical pipeline spec and ownership lifecycle metadata.

type PipelineVersion

type PipelineVersion struct {
	SourcePath        *string
	ID                int64
	PipelineSlug      slug.Slug
	GitCommitSHA      *string
	CreatedAt         time.Time
	SpecJSONB         []byte
	SpecHash          string
	ResolvedContracts []byte
}

PipelineVersion stores immutable pipeline revision metadata.

type ProposalAuthority

type ProposalAuthority struct {
	ID                        int64
	PublicationMode           string
	ProviderHost              string
	ProviderAccountID         string
	ProviderRepositoryID      string
	ProviderCredentialID      string
	ExecutingPrincipalID      string
	ExecutingPrincipalDisplay string
	AuthoritySource           string
	GitConfigurationHash      string
	GitRepository             string
	GitBaseRef                string
	GitDataSourceSlug         string
	GitCredentialSlug         string
	GitCredentialRevision     string
}

ProposalAuthority is the active provider identity selected for one project repository.

type QueueDraftProposalRefreshParams

type QueueDraftProposalRefreshParams struct {
	PipelineSlug     slug.Slug
	MemberSlug       slug.Slug
	ProposalID       string
	RefreshAttemptID string
}

QueueDraftProposalRefreshParams identifies one exact provider refresh attempt.

type QueueDraftPublishParams

type QueueDraftPublishParams struct {
	PipelineSlug     slug.Slug
	MemberSlug       slug.Slug
	DraftState       string
	BaseRef          *string
	BaseCommitSHA    *string
	BranchName       string
	PublishAttemptID string
	Authority        ProposalAuthority
}

QueueDraftPublishParams contains proposal continuity fields for Git-authored draft publish.

type RefreshDraftProposalParams

type RefreshDraftProposalParams struct {
	PipelineSlug     slug.Slug
	MemberSlug       slug.Slug
	DraftState       string
	BranchName       *string
	BranchHeadSHA    *string
	ProposalProvider *string
	ProposalID       *string
	ProposalURL      *string
	ProposalState    *string
	RefreshAttemptID string
}

RefreshDraftProposalParams contains safe state read back for one exact provider proposal.

type Repository

type Repository interface {
	Upsert(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params UpsertParams,
	) (*PipelineReference, error)
	FindBySlug(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) (*PipelineReference, error)
	List(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug slug.Slug) ([]*PipelineReference, error)
	Delete(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug, pipelineSlug slug.Slug) error
	SetHasDraft(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		hasDraft bool,
	) error

	UpsertDraft(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		memberSlug slug.Slug,
		params UpsertDraftParams,
	) (*PipelineDraft, error)
	FindDraft(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug, memberSlug slug.Slug,
	) (*PipelineDraft, error)
	FindAnyDraft(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) (*PipelineDraft, error)
	FindProposalAuthority(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
	) (*ProposalAuthority, error)
	QueueDraftPublish(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params QueueDraftPublishParams,
	) error
	CompleteDraftPublish(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params CompleteDraftPublishParams,
	) error
	FailDraftPublish(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params FailDraftPublishParams,
	) error
	QueueDraftProposalRefresh(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params QueueDraftProposalRefreshParams,
	) error
	RefreshDraftProposal(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params RefreshDraftProposalParams,
	) error
	FailDraftProposalRefresh(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params FailDraftProposalRefreshParams,
	) error
	DeleteDraft(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug, memberSlug slug.Slug,
	) error

	// Canonical spec storage (P9-1).
	UpsertSpec(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params UpsertSpecParams,
	) (*PipelineSpec, error)
	FindSpec(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) (*PipelineSpec, error)
	FindSpecForUpdate(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) (*PipelineSpec, error)
	ListSpecs(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		req model.ListRequest,
	) ([]*PipelineSpec, error)
	DeleteSpec(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug, pipelineSlug, deletedBy slug.Slug) error
	RestoreSpec(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug, pipelineSlug slug.Slug) error
	// FindSpecDeletedAtForUpdate exposes source-removal tombstone state to reconciliation.
	FindSpecDeletedAtForUpdate(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) (time.Time, bool, error)
	CreateVersion(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug slug.Slug,
		params CreateVersionParams,
	) (*PipelineVersion, error)
	FindVersionBySpecHash(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		specHash string,
	) (*PipelineVersion, error)
	FindVersionBySpecHashPrefix(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		specHashPrefix string,
	) (*PipelineVersion, error)
	FindVersionByCommitSHA(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		commitSHA string,
	) (*PipelineVersion, error)
	FindVersionByID(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		versionID int64,
	) (*PipelineVersion, error)
	ListVersions(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
	) ([]*PipelineVersion, error)
	SetCurrentVersion(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, pipelineSlug slug.Slug,
		versionID int64,
	) error
	Deploy(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, environmentSlug slug.Slug,
		params DeployParams,
	) (*PipelineDeployment, error)
	FindDeployment(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, environmentSlug, pipelineSlug slug.Slug,
	) (*PipelineDeployment, error)
	ListDeployments(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, environmentSlug slug.Slug,
	) ([]*PipelineDeployment, error)
	ProjectEnvironmentEnabled(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, environmentSlug slug.Slug,
	) (bool, error)
	FindProjectEnvironmentProtection(
		ctx context.Context,
		tx postgres.DBTX,
		orgSlug, projectSlug, environmentSlug slug.Slug,
	) (*model.ProjectEnvironmentProtection, error)
}

Repository provides pipeline reference and canonical spec persistence operations.

func New

func New() Repository

New creates a new pipeline reference repository.

func NewRepositoryWithLogging

func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository

NewRepositoryWithLogging wraps base with method completion logging.

type RepositoryWithLogging

type RepositoryWithLogging struct {
	// contains filtered or unexported fields
}

RepositoryWithLogging implements Repository with method completion logging.

func (RepositoryWithLogging) CompleteDraftPublish

func (_d RepositoryWithLogging) CompleteDraftPublish(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params CompleteDraftPublishParams) (err error)

CompleteDraftPublish implements Repository.

func (RepositoryWithLogging) CreateVersion

func (_d RepositoryWithLogging) CreateVersion(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params CreateVersionParams) (pp1 *PipelineVersion, err error)

CreateVersion implements Repository.

func (RepositoryWithLogging) Delete

func (_d RepositoryWithLogging) Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (err error)

Delete implements Repository.

func (RepositoryWithLogging) DeleteDraft

func (_d RepositoryWithLogging) DeleteDraft(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, memberSlug slug.Slug) (err error)

DeleteDraft implements Repository.

func (RepositoryWithLogging) DeleteSpec

func (_d RepositoryWithLogging) DeleteSpec(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, deletedBy slug.Slug) (err error)

DeleteSpec implements Repository.

func (RepositoryWithLogging) Deploy

func (_d RepositoryWithLogging) Deploy(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, params DeployParams) (pp1 *PipelineDeployment, err error)

Deploy implements Repository.

func (RepositoryWithLogging) FailDraftProposalRefresh

func (_d RepositoryWithLogging) FailDraftProposalRefresh(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params FailDraftProposalRefreshParams) (err error)

FailDraftProposalRefresh implements Repository.

func (RepositoryWithLogging) FailDraftPublish

func (_d RepositoryWithLogging) FailDraftPublish(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params FailDraftPublishParams) (err error)

FailDraftPublish implements Repository.

func (RepositoryWithLogging) FindAnyDraft

func (_d RepositoryWithLogging) FindAnyDraft(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineDraft, err error)

FindAnyDraft implements Repository.

func (RepositoryWithLogging) FindBySlug

func (_d RepositoryWithLogging) FindBySlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineReference, err error)

FindBySlug implements Repository.

func (RepositoryWithLogging) FindDeployment

func (_d RepositoryWithLogging) FindDeployment(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineDeployment, err error)

FindDeployment implements Repository.

func (RepositoryWithLogging) FindDraft

func (_d RepositoryWithLogging) FindDraft(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, memberSlug slug.Slug) (pp1 *PipelineDraft, err error)

FindDraft implements Repository.

func (RepositoryWithLogging) FindProjectEnvironmentProtection

func (_d RepositoryWithLogging) FindProjectEnvironmentProtection(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug) (pp1 *model.ProjectEnvironmentProtection, err error)

FindProjectEnvironmentProtection implements Repository.

func (RepositoryWithLogging) FindProposalAuthority

func (_d RepositoryWithLogging) FindProposalAuthority(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (pp1 *ProposalAuthority, err error)

FindProposalAuthority implements Repository.

func (RepositoryWithLogging) FindSpec

func (_d RepositoryWithLogging) FindSpec(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineSpec, err error)

FindSpec implements Repository.

func (RepositoryWithLogging) FindSpecDeletedAtForUpdate

func (_d RepositoryWithLogging) FindSpecDeletedAtForUpdate(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (t1 time.Time, b1 bool, err error)

FindSpecDeletedAtForUpdate implements Repository.

func (RepositoryWithLogging) FindSpecForUpdate

func (_d RepositoryWithLogging) FindSpecForUpdate(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (pp1 *PipelineSpec, err error)

FindSpecForUpdate implements Repository.

func (RepositoryWithLogging) FindVersionByCommitSHA

func (_d RepositoryWithLogging) FindVersionByCommitSHA(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, commitSHA string) (pp1 *PipelineVersion, err error)

FindVersionByCommitSHA implements Repository.

func (RepositoryWithLogging) FindVersionByID

func (_d RepositoryWithLogging) FindVersionByID(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, versionID int64) (pp1 *PipelineVersion, err error)

FindVersionByID implements Repository.

func (RepositoryWithLogging) FindVersionBySpecHash

func (_d RepositoryWithLogging) FindVersionBySpecHash(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, specHash string) (pp1 *PipelineVersion, err error)

FindVersionBySpecHash implements Repository.

func (RepositoryWithLogging) FindVersionBySpecHashPrefix

func (_d RepositoryWithLogging) FindVersionBySpecHashPrefix(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, specHashPrefix string) (pp1 *PipelineVersion, err error)

FindVersionBySpecHashPrefix implements Repository.

func (RepositoryWithLogging) List

func (_d RepositoryWithLogging) List(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (ppa1 []*PipelineReference, err error)

List implements Repository.

func (RepositoryWithLogging) ListDeployments

func (_d RepositoryWithLogging) ListDeployments(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug) (ppa1 []*PipelineDeployment, err error)

ListDeployments implements Repository.

func (RepositoryWithLogging) ListSpecs

func (_d RepositoryWithLogging) ListSpecs(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, req model.ListRequest) (ppa1 []*PipelineSpec, err error)

ListSpecs implements Repository.

func (RepositoryWithLogging) ListVersions

func (_d RepositoryWithLogging) ListVersions(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (ppa1 []*PipelineVersion, err error)

ListVersions implements Repository.

func (RepositoryWithLogging) ProjectEnvironmentEnabled

func (_d RepositoryWithLogging) ProjectEnvironmentEnabled(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, environmentSlug slug.Slug) (b1 bool, err error)

ProjectEnvironmentEnabled implements Repository.

func (RepositoryWithLogging) QueueDraftProposalRefresh

func (_d RepositoryWithLogging) QueueDraftProposalRefresh(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params QueueDraftProposalRefreshParams) (err error)

QueueDraftProposalRefresh implements Repository.

func (RepositoryWithLogging) QueueDraftPublish

func (_d RepositoryWithLogging) QueueDraftPublish(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params QueueDraftPublishParams) (err error)

QueueDraftPublish implements Repository.

func (RepositoryWithLogging) RefreshDraftProposal

func (_d RepositoryWithLogging) RefreshDraftProposal(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params RefreshDraftProposalParams) (err error)

RefreshDraftProposal implements Repository.

func (RepositoryWithLogging) RestoreSpec

func (_d RepositoryWithLogging) RestoreSpec(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug) (err error)

RestoreSpec implements Repository.

func (RepositoryWithLogging) SetCurrentVersion

func (_d RepositoryWithLogging) SetCurrentVersion(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, versionID int64) (err error)

SetCurrentVersion implements Repository.

func (RepositoryWithLogging) SetHasDraft

func (_d RepositoryWithLogging) SetHasDraft(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, pipelineSlug slug.Slug, hasDraft bool) (err error)

SetHasDraft implements Repository.

func (RepositoryWithLogging) Upsert

func (_d RepositoryWithLogging) Upsert(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params UpsertParams) (pp1 *PipelineReference, err error)

Upsert implements Repository.

func (RepositoryWithLogging) UpsertDraft

func (_d RepositoryWithLogging) UpsertDraft(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, memberSlug slug.Slug, params UpsertDraftParams) (pp1 *PipelineDraft, err error)

UpsertDraft implements Repository.

func (RepositoryWithLogging) UpsertSpec

func (_d RepositoryWithLogging) UpsertSpec(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug, params UpsertSpecParams) (pp1 *PipelineSpec, err error)

UpsertSpec implements Repository.

type SyncStatus

type SyncStatus int

SyncStatus describes whether a pipeline's DB spec is in sync with its git source.

const (
	SyncStatusUnknown SyncStatus = iota // unknown
	SyncStatusSynced                    // synced
	SyncStatusDrifted                   // drifted
)

func SyncStatusString

func SyncStatusString(s string) (SyncStatus, error)

SyncStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func SyncStatusValues

func SyncStatusValues() []SyncStatus

SyncStatusValues returns all values of the enum

func (SyncStatus) IsASyncStatus

func (i SyncStatus) IsASyncStatus() bool

IsASyncStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (SyncStatus) MarshalJSON

func (i SyncStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for SyncStatus

func (SyncStatus) MarshalText

func (i SyncStatus) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for SyncStatus

func (SyncStatus) String

func (i SyncStatus) String() string

func (*SyncStatus) UnmarshalJSON

func (i *SyncStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SyncStatus

func (*SyncStatus) UnmarshalText

func (i *SyncStatus) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for SyncStatus

type UpsertDraftParams

type UpsertDraftParams struct {
	PipelineSlug     slug.Slug
	BasedOnVersionID *int64
	SpecJSONB        []byte
	DraftState       string
}

UpsertDraftParams contains fields for creating or updating a pipeline draft.

type UpsertParams

type UpsertParams struct {
	Slug slug.Slug
	Name string
}

UpsertParams contains fields for creating or updating a pipeline reference.

type UpsertSpecParams

type UpsertSpecParams struct {
	Slug              slug.Slug
	Name              string
	SpecJSONB         []byte
	SpecHash          string
	SyncStatus        SyncStatus
	SourcePath        *string
	SourceRef         *string
	LastAppliedCommit *string
}

UpsertSpecParams contains fields for upserting a canonical pipeline spec.

Jump to

Keyboard shortcuts

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