deploy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package deploy is the confirm screen for writing one named image into one env — the "image bump" half of hoist's problem statement, reached with d on the matrix and a tag chosen in internal/app/tags.

It exists as its own screen rather than as a mode of internal/app/plan because the two confirm different things. The plan screen confirms a set: several repos, each tickable, derived from a source env. A deploy confirms one image the operator named outright, so there is nothing to tick and no source to describe — and the questions it should answer ("what is in this build", "what is running now") are not the plan screen's.

From M10 it leads with the work (#85 screen 03/10/11): the commits this deploy ships and which of them migrate the database, with the YAML diff one key away rather than the headline — the diff is the mechanism, and principle 4 already guarantees its shape (one image line per occurrence, verified before git add). When the history cannot be resolved the diff is the only evidence left and becomes the body again, with the reason stated. What it still shares with the plan screen is the rule that no write happens without the bytes available to look at: the diff is always one key away, never absent, and enter means the same thing from either view — whether the operator looked is their call.

Index

Constants

View Source
const (
	ModePR     = plan.ModePR
	ModeDirect = plan.ModeDirect
)

Mode values — plan's own, so the root can treat both screens' StartMsgs the same way (M10: the two packages had spelled them differently while claiming to mirror each other).

Variables

This section is empty.

Functions

This section is empty.

Types

type BackMsg

type BackMsg struct{}

BackMsg asks whatever composes screens to pop this one.

type History

type History struct {
	Delta    *migrate.Delta
	Note     string
	Declared image.Ref
	Since    time.Time
}

History is what the picker already learned about the build being deployed, carried in so this screen leads with it without a second fetch (tags.SelectedMsg). Delta is nil when there is none, and Note then says why in a sentence. Declared is what the env declares today and Since when its manifest line last changed (zero when unknown).

type Model

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

Model is the deploy confirm screen.

func New

func New(pl gitops.Plan, root, image string, envs config.EnvsConfig, styles ui.Styles) Model

New builds the screen for an already-constructed deploy plan. root is the repo checkout the diff is read from; envs decides whether the target is production, which forces PR mode.

func (Model) CapturesText

func (m Model) CapturesText() bool

CapturesText reports whether a keypress belongs to this screen's own text input — true only while the direct-mode confirmation is open.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements the screen contract; nothing to load, the plan arrived built.

func (Model) SetSize

func (m Model) SetSize(width, height int) Model

SetSize implements the screen contract: the body viewport gets what the frame leaves after the fixed sections.

func (Model) SetStyles

func (m Model) SetStyles(s ui.Styles) Model

SetStyles implements the screen contract.

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update implements the screen contract.

func (Model) View

func (m Model) View() string

View implements the screen contract.

func (Model) WithDirectMode

func (m Model) WithDirectMode() Model

WithDirectMode opens the screen already in direct mode, for the picker's own D path: that gesture (keypress + huh.Confirm, internal/app/tags) has already been completed, and asking for it twice would be ceremony rather than safety. Production is the exception — §4.5 gives it no direct path at all, so the request is dropped and the screen says why.

func (Model) WithHistory

func (m Model) WithHistory(h History) Model

WithHistory supplies the commit history the picker loaded. With a delta the commits are the body and the YAML is behind d; without one the YAML is the body and the header says why there is no history.

func (Model) WithNow

func (m Model) WithNow(now func() time.Time) Model

WithNow fixes the clock (tests).

type StartMsg

type StartMsg struct {
	Plan      gitops.Plan
	Mode      string
	Confirmed bool
	Target    string
	Image     string
}

StartMsg is the operator confirming the deploy. Mode mirrors plan.StartMsg's: ModePR opens a pull request, ModeDirect commits straight to the base branch. Confirmed is true only when ModeDirect was reached through this screen's own huh.Confirm — engine.DirectCommitGateStep reads it as the record of that gesture (internal/engine/direct.go).

Jump to

Keyboard shortcuts

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