Run then: chains from GenericManager - #42
Merged
Merged
Conversation
andrew
force-pushed
the
run-then-chains
branch
from
September 15, 2026 18:49
47b50d7 to
96140bd
Compare
andrew
marked this pull request as ready for review
September 15, 2026 20:37
andrew
force-pushed
the
run-then-chains
branch
from
September 15, 2026 20:48
81761cd to
6a1f8c6
Compare
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
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.
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.
andrew
force-pushed
the
run-then-chains
branch
from
September 16, 2026 07:06
6a1f8c6 to
2415708
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BuildCommands and Command.Then existed but every GenericManager
operation called BuildCommand (singular), so gomod add never ran
go mod tidyand renv add/remove/update never ranrenv::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
Stack created with GitHub Stacks CLI • Give Feedback 💬