Skip to content

feat(report): a runFlow's steps are in the report as they run - #276

Open
luka-vladika-happening-xyz wants to merge 1 commit into
devicelab-dev:mainfrom
luka-vladika-happening-xyz:pr/live-substeps
Open

luka-vladika-happening-xyz wants to merge 1 commit into
devicelab-dev:mainfrom
luka-vladika-happening-xyz:pr/live-substeps

Conversation

@luka-vladika-happening-xyz

Copy link
Copy Markdown
Contributor

A runFlow's, retry's or repeat's steps were written to the flow's report file only when it ended (CommandEndWithSubs), so a reader following the report while the flow runs (a live view of the run, which updateSeq allows) saw the step as one running line for its whole run, then all its steps at once. A flow made mostly of runFlows showed almost nothing while it ran.

Maestro shows a subflow's steps as they run: Orchestra.executeSubflowCommands calls onCommandStart and onCommandComplete for each of them, MaestroCommandRunner redraws its view at each, and AnsiResultView expands a running or failed runFlow down to its steps. This gives the report the same.

Each nested step is now written to the flow's file as it starts (running) and as it ends, with the compound steps around it shown as running too, through a new FlowWriter.CommandSubs, which writes the command's steps so far and updates the index, as a top-level step's start and end do. The list written at the command's end is unchanged, so a finished report is the same as before.

The cost: each nested start and end rewrites the flow's file and the index once more, as each top-level step's start and end already do.

TestRunFlowStepsAreReportedAsTheyRun runs a runFlow holding a tap, a nested runFlow with a tap, and a tap, and reads the flow's file while each tap runs: first tapOn: running; then the first tap passed and the nested runFlow running with its tap running; then the nested runFlow passed and the last tap running. It fails on main. go test -race ./pkg/executor ./pkg/report passes; golangci-lint v2.13.2: 0 issues.

A runFlow's, repeat's or retry's steps were written to the flow's file only
when it ended, so a reader of the report (a live view of the run) saw a
one-line runFlow for its whole run and then all its steps at once. Each
nested step is now written as it starts (running) and as it ends, with the
compound steps running around it, through FlowWriter.CommandSubs; the list
written at the step's end (CommandEndWithSubs) is unchanged.
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/report/flow.go 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants