sdk: per-execution result callback for thread-safe engine - #7587
Conversation
WalkthroughThe SDK adds ChangesResult callback routing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ExecuteNucleiWithOptsCtx
participant resolveEphemeralOutput
participant EphemeralExecutor
participant ResultCallbacks
ExecuteNucleiWithOptsCtx->>resolveEphemeralOutput: resolve execution-scoped output
resolveEphemeralOutput->>EphemeralExecutor: provide isolated or combined writer
EphemeralExecutor->>ResultCallbacks: emit result events
ResultCallbacks-->>ExecuteNucleiWithOptsCtx: invoke per-execution and global callbacks
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/multi.go`:
- Line 8: Replace the testutils.MockOutputWriter dependency in the production
multi execution path with a production runtime writer, and update the
lib/multi.go construction to use it. Ensure the writer synchronizes WriteResult
and all callback state accessed by concurrent template/work goroutines, while
preserving the existing per-call callback behavior through
output.NewMultiWriter.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 608e7db0-3acd-4f7c-aa21-e87ccb313207
📒 Files selected for processing (3)
lib/config.golib/multi.golib/result_callback_test.go
Summary
WithResultCallbackfor per-execution result callbacks onThreadSafeNucleiEngine.ExecuteNucleiWithOptsCtx(combined withGlobalResultCallbackvia MultiWriter)OutputCloses #5651
Summary by CodeRabbit
New Features
Tests