feat: add skip() function and fuzzy module exclusion support

- Add skip() function to terminate remaining steps in current module while continuing to next module, with optional message parameter
- Implement isFuzzyModuleExcluded() for substring-based module filtering in ExecuteFlow
- Add fuzzy_exclude_modules CLI flag (-X) to both run and scan commands for flexible module exclusion
- Handle ErrSkipModule sentinel error throughout executor (executeStep, executeStepsDAG, ExecuteModule, ExecuteFlow) with proper status propagation
- Update function registry and Goja runtime to register skip() function
- Add comprehensive unit tests for skip() behavior, SkipModuleError, and fuzzy module matching
- Update snapshot tests to use generic example.com instead of shopee.vn
This commit is contained in:
j3ssie
2026-02-13 15:56:02 +07:00
parent b6e9d12324
commit b0736ab0ed
12 changed files with 343 additions and 16 deletions
+6
View File
@@ -2,6 +2,7 @@ package executor
import (
"context"
"errors"
"fmt"
"sync"
"time"
@@ -68,6 +69,11 @@ func (e *FunctionExecutor) Execute(ctx context.Context, step *core.Step, execCtx
result.Duration = result.EndTime.Sub(result.StartTime)
if err != nil {
if errors.Is(err, functions.ErrSkipModule) {
result.Status = core.StepStatusSkipped
result.Error = err
return result, err
}
result.Status = core.StepStatusFailed
result.Error = err
return result, err