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
- type BackMsg
- type History
- type Model
- func (m Model) CapturesText() bool
- func (m Model) Init() tea.Cmd
- func (m Model) SetSize(width, height int) Model
- func (m Model) SetStyles(s ui.Styles) Model
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) WithDirectMode() Model
- func (m Model) WithHistory(h History) Model
- func (m Model) WithNow(now func() time.Time) Model
- type StartMsg
Constants ¶
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 History ¶
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 ¶
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 ¶
CapturesText reports whether a keypress belongs to this screen's own text input — true only while the direct-mode confirmation is open.
func (Model) SetSize ¶
SetSize implements the screen contract: the body viewport gets what the frame leaves after the fixed sections.
func (Model) WithDirectMode ¶
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 ¶
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.
type StartMsg ¶
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).