feat(executor): implement command executor with timeout and retry #186
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/ttheart!186
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/implement-command-executor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement the command executor in
internal/executor/executor.go:RunActions()executes matched rules' commands asynchronously (#72)/bin/sh -cfor full shell support (#70)CombinedOutput(#71)timeoutfield, defaults to 30s (#73)retryfield — retries N times on failure (#74)Extended
models.ActionwithTimeoutandRetryfields.Why
The final step in the webhook pipeline. Rules match → templates render → commands execute. This closes the loop from webhook receipt to action execution.
Testing
go test ./...and pre-commit passexecutor_test.goBreaking Changes
Actionstruct gainedtimeoutandretryfields (backwards compatible: zero-values mean defaults)Notes
Closes #75
Closes #70
Closes #71
Closes #72
Closes #73
Closes #74
Review
Solid command executor implementation. All 12 tests pass (5 executor + 7 template). Lint and vet clean.
Design highlights:
RunActionsspawns goroutines per rule, actions run sequentially within each ruleInterpolate()before execution/bin/sh -cfor full shell supportCombinedOutputcaptures both stdout/stderrcontext.WithTimeout,parseTimeouthandles empty/invalid gracefullyfunc(r models.Rule))Models:
Actionextended withTimeout stringandRetry int(zero-value defaults). Backward compatible.Non-blocking:
Result.Actionfield in the struct is never populated. Consider removing or populating it for completeness.No blocking issues.
APPROVED