Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/solo/subcommand/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func Execute() int {
rootCmd.AddCommand(NewCleanSubCommand(soloCtx))

// Tooling
rootCmd.AddCommand(NewWorkflowLogSubCommand(soloCtx))
rootCmd.AddCommand(NewShCommand(soloCtx))
rootCmd.AddCommand(NewLogsCommand(soloCtx))
rootCmd.AddCommand(NewToolCommands(soloCtx)...)
Expand Down
36 changes: 36 additions & 0 deletions cmd/solo/subcommand/wflog.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package subcommand

import (
"github.com/spf13/cobra"

tea "charm.land/bubbletea/v2"

"github.com/spaulg/solo/internal/pkg/host/app/bubbletea/views/workflow_log"

"github.com/spaulg/solo/internal/pkg/host/app/context"
)

func NewWorkflowLogSubCommand(soloCtx *context.CliContext) *cobra.Command {
buildLogCmd := &cobra.Command{
Use: "wflogs",
GroupID: "tooling",
Short: "Workflow logs",
Long: "Workflow logs",
Aliases: []string{"wflog"},
RunE: soloCtx.ProtectWithLock(func(cmd *cobra.Command, args []string) error {
model, err := workflow_log.NewView(soloCtx)
if err != nil {
return err
}

p := tea.NewProgram(model)
if _, err := p.Run(); err != nil {
return err
}

return nil
}),
}

return buildLogCmd
}
16 changes: 16 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module github.com/spaulg/solo
go 1.25.0

require (
charm.land/bubbles/v2 v2.1.0
charm.land/bubbletea/v2 v2.0.7
charm.land/lipgloss/v2 v2.0.4
github.com/arch-go/arch-go/v2 v2.1.2
github.com/compose-spec/compose-go/v2 v2.4.1
github.com/gofrs/flock v0.12.1
Expand All @@ -19,6 +22,14 @@ require (
)

require (
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20260525132238-948f4557a654 // indirect
github.com/charmbracelet/x/ansi v0.11.7 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
Expand All @@ -27,12 +38,16 @@ require (
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.23 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.12.0 // indirect
Expand All @@ -43,6 +58,7 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
Expand Down
36 changes: 36 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
charm.land/bubbles/v2 v2.1.0 h1:YSnNh5cPYlYjPxRrzs5VEn3vwhtEn3jVGRBT3M7/I0g=
charm.land/bubbles/v2 v2.1.0/go.mod h1:l97h4hym2hvWBVfmJDtrEHHCtkIKeTEb3TTJ4ZOB3wY=
charm.land/bubbletea/v2 v2.0.7 h1:7qw2tTAVar7m7klOPBYfTB0mniv/RuexsYwMRNxSeL0=
charm.land/bubbletea/v2 v2.0.7/go.mod h1:DGW2q8gvzHnOpMpZTORs0aySVHCox5C+2Svk0fci1qs=
charm.land/lipgloss/v2 v2.0.4 h1:lcPeVtcp23SNra7lHy8iYE4UC2aIipVQ47sbGyyxR5Q=
charm.land/lipgloss/v2 v2.0.4/go.mod h1:0653x8epbZSzdDfO/XPS1a/uYPOBeSsCssOpJOqDzik=
github.com/agiledragon/gomonkey/v2 v2.14.0 h1:FASzes6sjtD0hRo5lu0g796qKL03bOHCgcIA/4am9QM=
github.com/agiledragon/gomonkey/v2 v2.14.0/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/arch-go/arch-go/v2 v2.1.2 h1:kYf2VIVjtbKLGTs0/lr+2FOqiXFFKAiGc4UhoIS/l0M=
github.com/arch-go/arch-go/v2 v2.1.2/go.mod h1:8W9kj7Pgv0iPioau6yoaiC3HLvzqyq5LydXam9Z1Fpc=
github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=
github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
github.com/charmbracelet/ultraviolet v0.0.0-20260525132238-948f4557a654 h1:FpSYhY28ucg9ZRr+2wj67FAQ0Ey5yiK0072PmRDJNek=
github.com/charmbracelet/ultraviolet v0.0.0-20260525132238-948f4557a654/go.mod h1:hFpumms29Smx3LStRfku8vcCTBe1Kq8aCXtHUJa3mjY=
github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI=
github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ=
github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA=
github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I=
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM=
github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k=
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
github.com/compose-spec/compose-go/v2 v2.4.1 h1:tEg6Qn/9LZnKg42fZlFmxN4lxSqnCvsiG5TXnxzvI4c=
github.com/compose-spec/compose-go/v2 v2.4.1/go.mod h1:lFN0DrMxIncJGYAXTfWuajfwj5haBJqrBkarHcnjJKc=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
Expand Down Expand Up @@ -43,13 +69,19 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4=
github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.23 h1:7ykA0T0jkPpzSvMS5i9uoNn2Xy3R383f9HDx3RybWcw=
github.com/mattn/go-runewidth v0.0.23/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU=
github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
Expand All @@ -60,6 +92,8 @@ github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xl
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down Expand Up @@ -94,6 +128,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
Expand Down
3 changes: 3 additions & 0 deletions internal/pkg/architecture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func (t *ArchitectureTestSuite) TestLayerDependencies() {
"github.com/gofrs/flock.**",
"github.com/oklog/ulid/v2.**",
"github.com/spf13/cobra.**",
"charm.land/bubbles/v2/key.**",
"charm.land/bubbletea/v2.**",
"charm.land/lipgloss/v2.**",
},
},
},
Expand Down
14 changes: 7 additions & 7 deletions internal/pkg/host/app/audit/state_directory_auditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type StateDirectoryAuditor struct {
mu sync.Mutex
outputDirectory string
executionEventRepository domain.ExecutionEventRepository
workflowLogMetaRepository domain.WorkflowLogMetaRepository
containerStepMapRepository domain.ContainerStepMapRepository
workflowStepLogMetaRepository domain.WorkflowStepLogMetaRepository
logWriter domain.LogWriter
}
Expand All @@ -35,7 +35,7 @@ func NewAuditor(
config *domain.Config,
project domain.Project,
executionEventRepository domain.ExecutionEventRepository,
workflowLogMetaRepository domain.WorkflowLogMetaRepository,
containerStepMapRepository domain.ContainerStepMapRepository,
workflowStepLogMetaRepository domain.WorkflowStepLogMetaRepository,
logWriter domain.LogWriter,
) *StateDirectoryAuditor {
Expand All @@ -52,7 +52,7 @@ func NewAuditor(
project: project,
outputDirectory: outputDirectory,
executionEventRepository: executionEventRepository,
workflowLogMetaRepository: workflowLogMetaRepository,
containerStepMapRepository: containerStepMapRepository,
workflowStepLogMetaRepository: workflowStepLogMetaRepository,
logWriter: logWriter,
}
Expand Down Expand Up @@ -200,8 +200,8 @@ func (t *StateDirectoryAuditor) writeStepResult(e *wf.StepCompleteEvent) {
))
}

workflowMetaPath := path.Join(outputDirectory, e.WorkflowName.String()+".meta.json")
workflowMeta, err := t.workflowLogMetaRepository.Load(workflowMetaPath)
workflowMetaPath := path.Join(outputDirectory, "container_step_map.meta.json")
workflowMeta, err := t.containerStepMapRepository.Load(workflowMetaPath)
if err != nil {
t.logger.Error(fmt.Sprintf(
"Failed to load workflow meta file: failed to load meta file: %s: %v",
Expand All @@ -213,12 +213,12 @@ func (t *StateDirectoryAuditor) writeStepResult(e *wf.StepCompleteEvent) {
}

if workflowMeta == nil {
workflowMeta = domain.NewWorkflowLogMeta()
workflowMeta = domain.NewWorkflowContainerStepMap()
}

workflowMeta.AppendStep(e.ContainerName, e.StepID)

if err = t.workflowLogMetaRepository.Save(workflowMetaPath, workflowMeta); err != nil {
if err = t.containerStepMapRepository.Save(workflowMetaPath, workflowMeta); err != nil {
t.logger.Error(fmt.Sprintf(
"Failed to write workflow meta file: failed to save meta file: %s: %v",
workflowMetaPath,
Expand Down
57 changes: 57 additions & 0 deletions internal/pkg/host/app/bubbletea/components/heading/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package heading

import (
tea "charm.land/bubbletea/v2"
"charm.land/lipgloss/v2"

"github.com/spaulg/solo/internal/pkg/host/app/bubbletea/messages"
)

type Component struct {
heading string
style lipgloss.Style

width int
height int
}

func DefaultStyle() lipgloss.Style {
return lipgloss.NewStyle().Align(lipgloss.Center).Background(lipgloss.Color("212"))
}

func WithStyle(style lipgloss.Style) Option {
return func(component *Component) {
component.style = style
}
}

func NewComponent(heading string, opts ...Option) Component {
component := Component{
heading: heading,
style: DefaultStyle(),
}

for _, opt := range opts {
opt(&component)
}

return component
}

func (t Component) Init() tea.Cmd {
return nil
}

func (t Component) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

switch m := msg.(type) {
case messages.ComponentSizeMsg:
t.width, t.height = m.Width, m.Height
}

return t, nil
}

func (t Component) View() tea.View {
return tea.NewView(t.style.Width(t.width).Height(t.height).Render(t.heading))
}
3 changes: 3 additions & 0 deletions internal/pkg/host/app/bubbletea/components/heading/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package heading

type Option func(component *Component)
Loading
Loading