release

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package release turns the per-application Release (a deployed, rollback-able version) into a promotable artifact: a workspace-wide catalog with provenance, approval gates per environment, and promotion (re-pointing an application at a release) that the gate guards.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("release not found")
	ErrEnvNotFound     = errors.New("environment not found")
	ErrApprovalsNeeded = errors.New("release lacks the approvals this environment requires")
)

Functions

This section is empty.

Types

type ApprovalStatus

type ApprovalStatus struct {
	Environments []EnvApproval            `json:"environments"`
	Approvals    []models.ReleaseApproval `json:"approvals"`
}

ApprovalStatus is a release's approval standing across all environments plus the raw approval log.

type EnvApproval

type EnvApproval struct {
	EnvironmentID     uint   `json:"environment_id"`
	EnvironmentName   string `json:"environment_name"`
	RequiredApprovals int    `json:"required_approvals"`
	Approvals         int    `json:"approvals"`
	Satisfied         bool   `json:"satisfied"`
}

EnvApproval reports a release's approval standing for one environment.

type Service

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

Service exposes the workspace release catalog, approvals, and promotion.

func NewService

NewService wires the release service.

func (*Service) Approvals

func (s *Service) Approvals(workspaceID, releaseID uint) (*ApprovalStatus, error)

Approvals returns the approval standing of a release across the workspace's environments.

func (*Service) Approve

func (s *Service) Approve(workspaceID, releaseID uint, environmentID *uint, approverID uint, approved bool, comment string) error

Approve records one approver's decision on promoting a release into an environment.

func (*Service) List

func (s *Service) List(workspaceID uint) ([]View, error)

List returns every release in the workspace, newest first, with app identity.

func (*Service) ListPaged

func (s *Service) ListPaged(workspaceID uint, limit, offset int) ([]View, int64, error)

ListPaged returns a page of workspace releases (with app identity) plus the total count.

func (*Service) Promote

func (s *Service) Promote(workspaceID, releaseID, environmentID, userID uint) (*models.Deployment, error)

Promote re-points the release's application at it (making it the active release), gated by the target environment's required approvals. Driven through the existing deploy pipeline.

type View

type View struct {
	models.Release
	ApplicationName        string `json:"application_name"`         // unique slug handle
	ApplicationDisplayName string `json:"application_display_name"` // free-text label
}

View is a release enriched with its application's identity for the catalog.

Jump to

Keyboard shortcuts

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