Skip to content

Collapse execute/executeParallel into a shared executeFlow #364

@kindermax

Description

@kindermax

Parent

#355

What to build

Extract executeFlow(ctx *Context, runScripts func() error) error containing the four phases that execute() and executeParallel() currently duplicate verbatim: initCmd, executeDepends, persistChecksum, and executeAfterScript. Both existing methods become thin callers that supply either a sequential or a parallel runScripts closure.

No observable behaviour changes. The test suite from #363 must remain fully green as the verification signal.

Acceptance criteria

  • A shared executeFlow function (or equivalent internal helper) encapsulates initCmd, executeDepends, persistChecksum, and executeAfterScript
  • execute() delegates to executeFlow with a sequential runScripts closure
  • executeParallel() delegates to executeFlow with a parallel (errgroup) runScripts closure
  • No duplication of the four shared phases between the two callers
  • Public interface (Execute, NewExecutor, Context, error types) is unchanged
  • All tests from Add RecordingRunner and Execute() test suite #363 pass without modification
  • All existing Bats integration tests pass

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions