Skip to content

v0.12.0

@andrew andrew tagged this 16 Sep 07:14
* Run then: chains from GenericManager

BuildCommands and Command.Then existed but every GenericManager
operation called BuildCommand (singular), so gomod add never ran
`go mod tidy` and renv add/remove/update never ran `renv::snapshot`.

Route all operations except Path through a run() helper that executes
the full chain, stopping on the first non-zero exit. On success the
result is the primary command's; on failure it is the failing
command's so callers see what broke.

Fixes #39

* Surface follow-up results in Result.Then; route Replace through run

The chain executor discarded every result after the first, so callers
could not see which follow-up commands ran or read their output. Add
Result.Then to carry them and make Success() consider the whole chain.

Replace still called BuildCommand directly, so a then: entry on any
operation it invokes was ignored. Route each replace step through the
chain executor and attach subsequent operation results to the first
result's Then.

* Guard nil follow-up results in run()

A Runner that returns (nil, err) for a follow-up command, as
PolicyRunner does on a violation, had nil appended to first.Then
before the error check, so Success() on the returned Result panicked.
Skip the append when res is nil and stop the chain.
Assets 2
Loading