{{define "ladder"}} {{if $.Detail.Pipeline}}

Pipeline

Every version moves through these channels in order — the first is where carlos deploy lands. Promoting moves it one step up; whatever follows that step picks it up. Each channel's own rules, not a fixed name, decide what it takes to get there.

{{else}}

The ladder

Every version climbs the same steps — canary (test) → edge → beta → stable (live). Promoting moves it one step up; whatever follows that step picks it up.

{{with .Detail.Production}}
{{if .Err}}

Safety delay: this app's setting can't be read right now, so the delay stays on. {{if $.CanPromote}}

— writes a fresh signed flag over the unreadable one. {{end}}

{{else if .On}}

Safety delay: on — new versions wait ~24h on beta and ~72h on live before they go live. {{if and $.CanPromote $.IsOwner}}

Turning it off asks for your passkey and takes effect after ~72h. {{end}}

{{else if .TurningOff}}

Safety delay: turning off — in effect until ~{{fmtTime .EffectiveAt}}. {{if $.CanPromote}}

{{end}}

{{else}}

Safety delay: off — new versions go live as soon as they're promoted. {{if $.CanPromote}}

{{end}}

{{end}} {{if .Nudge}}

{{icon "triangle-alert"}} This app looks like it's serving real users but new versions go live immediately — consider turning the safety delay on.

{{end}}
{{end}} {{end}}
    {{range .Detail.Ladder}}
  1. {{.Rung}}

    {{if .Channels}} {{range .Channels}}
    {{if .Err}}

    {{.Channel}} — {{.Err}}

    {{else}}

    {{.Channel}} holds {{.Version}} promoted {{ago .PromotedAt}}{{if .Actor}} by {{.Actor}}{{end}} {{if .Hotfix}}{{icon "zap"}} published directly — skipped the pipeline{{end}} {{if .FastTrack}}{{icon "fast-forward"}} delay skipped{{end}}

    {{if and (not .BakedUntil.IsZero) $.CanPromote $.IsOwner}}
    goes live {{until .BakedUntil}} {{end}} {{end}} {{if .Routes}}
      {{range .Routes}}
    • {{.Host}} {{icon "layers"}} {{if .Environment}}{{.Environment}}{{else}}default{{end}} {{if .ProdWired}}{{icon "triangle-alert"}} canary in front of everybody {{else if .Canary}}{{icon "flask-conical"}} canary{{end}} {{if .Expired}}{{icon "hourglass"}} expired {{.ExpiredFor}}{{end}} {{if .Caps}}granted: {{.Caps}}{{end}}
    • {{end}}
    {{else}}

    Nothing follows this channel yet.

    {{end}}
    {{end}} {{else}}

    Nothing on {{.Rung}}.

    {{end}}

    {{.Gate}}

    {{if .Up}}
    {{icon "arrow-down"}} {{if and .Up.Version $.CanPromote (or $.Detail.Pipeline $.IsOwner)}}
    {{else if .Up.Note}} {{.Up.Note}} {{else}} Only an account owner can promote to {{.Up.To}}. {{end}}
    {{end}}
  2. {{end}}
{{end}}