Remove resource pools, leases and wait queues
Drop the resource allocation feature end to end: store tables and migration, runner scheduling and cleanup, protocol types and commands, CLI commands, TUI screens, tests and docs. Existing databases open cleanly and definitions carrying a retired resources block still validate.
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.a-wan.net/alan/pipelines/internal/protocol"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/charmbracelet/x/ansi"
|
||||
"github.com/muesli/termenv"
|
||||
)
|
||||
|
||||
func TestResourceWaitFrames(t *testing.T) {
|
||||
previous := lipgloss.ColorProfile()
|
||||
defer lipgloss.SetColorProfile(previous)
|
||||
for _, width := range []int{60, 120} {
|
||||
for _, plain := range []bool{false, true} {
|
||||
t.Run(fmt.Sprintf("width-%d-plain-%t", width, plain), func(t *testing.T) {
|
||||
if plain {
|
||||
lipgloss.SetColorProfile(termenv.Ascii)
|
||||
} else {
|
||||
lipgloss.SetColorProfile(termenv.TrueColor)
|
||||
}
|
||||
m := decisionModel()
|
||||
m.width = width
|
||||
m.runDetail.Status = protocol.RunStatusQueued
|
||||
m.runDetail.Steps = nil
|
||||
m.runDetail.ResourceWait = &protocol.ResourceWait{Resource: "phone-X", Stage: "review", Sequence: 1, QueuedSince: "2026-10-18T10:00:00Z"}
|
||||
frame := ansi.Strip(m.runsDetailsView(24))
|
||||
if !strings.Contains(frame, "Waiting for resource phone-X") || strings.Contains(frame, "c decide") || strings.Contains(frame, "Waiting for a person") {
|
||||
t.Fatal("wrong resource wait frame:\n", frame)
|
||||
}
|
||||
for _, line := range strings.Split(frame, "\n") {
|
||||
if ansi.StringWidth(line) > width {
|
||||
t.Fatalf("overflow: %q", line)
|
||||
}
|
||||
}
|
||||
t.Log("Rendered resource wait (no phone):\n" + frame)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,6 @@ import (
|
||||
)
|
||||
|
||||
func resultLabel(r protocol.RunSummary) string {
|
||||
if r.ResourceWait != nil {
|
||||
return r.StatusLabel() + " · stage " + r.ResourceWait.Stage
|
||||
}
|
||||
preview := ansi.Strip(r.ResultPreview)
|
||||
if r.Status == "succeeded" {
|
||||
if preview != "" {
|
||||
|
||||
@@ -276,9 +276,6 @@ func runStatus(status string) string {
|
||||
}
|
||||
|
||||
func (m Model) runSummaryStatus(run protocol.RunSummary) string {
|
||||
if run.ResourceWait != nil {
|
||||
return run.StatusLabel()
|
||||
}
|
||||
return m.progress(run.Status)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user