lifecycleprojection

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package lifecycleprojection owns PostgreSQL projections shared by durable lifecycle transitions and the runner evidence transactions that establish those transitions' prerequisites.

Index

Constants

View Source
const (
	StageTeardownDrainCommitted            = "teardown_drain_committed"
	StageTeardownFenceDispatched           = "teardown_fence_dispatched"
	StageTeardownFenceAcknowledged         = "teardown_fence_acknowledged"
	StageTeardownGenerationAdvanced        = "teardown_generation_advanced"
	StageTeardownStopCommitted             = "teardown_stop_committed"
	StageTeardownWorkspaceDeleteDispatched = "teardown_workspace_delete_dispatched"
	StageTeardownFinalized                 = "teardown_finalized"
)

Teardown orchestration milestones. Each names one durable control-plane transition on the drain, stop, and delete path, so the interval between two adjacent milestones is attributable to exactly one hop. The names are fixed and carry no identifiers.

Variables

This section is empty.

Functions

func ProjectReadyOperations

func ProjectReadyOperations(
	ctx context.Context,
	tx pgx.Tx,
	sandboxID string,
	now time.Time,
) error

ProjectReadyOperations completes pending create or start Operations in the same transaction that projects their Sandbox ready.

func RecordTeardownStage added in v0.3.0

func RecordTeardownStage(
	ctx context.Context,
	tx pgx.Tx,
	sandboxID string,
	stage string,
	observedAt time.Time,
) error

RecordTeardownStage attributes one teardown milestone to every in-flight drain, stop, or delete Operation of the Sandbox, inside the transaction that establishes the milestone's fact. A delete traverses stop semantics, so a stop Operation and a delete Operation observe the same shared hops.

The write is intentionally keyed by Sandbox rather than by Operation: the transitions that establish these facts already hold the Sandbox row and do not all carry an Operation identity. Sandboxes with no in-flight lifecycle Operation record nothing, which is correct — an unattributed transition has no Operation wall clock to account for.

Types

This section is empty.

Jump to

Keyboard shortcuts

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