Skip to content

Conversation

@dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Nov 10, 2025

Proposed changes

closes #6594

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • Refactor
    • Adjusted when unique execution identifiers are set: default options now include a pre-populated ExecutionId, while engine initialization no longer auto-assigns one.
    • No changes to public interfaces or externally visible behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@dogancanbakir dogancanbakir self-assigned this Nov 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

ExecutionId generation was moved: pkg/types.DefaultOptions() now sets a generated ExecutionId; SDK constructors (lib.NewNucleiEngineCtx and related) no longer assign ExecutionId during engine creation and the xid import was removed from SDK files.

Changes

Cohort / File(s) Change Summary
SDK removal of ExecutionId assignment
lib/sdk.go, lib/multi.go
Removed import/use of github.com/rs/xid and deleted code that assigned a new ExecutionId during engine initialization paths.
DefaultOptions now populates ExecutionId
pkg/types/types.go
Added import of github.com/rs/xid and initialize DefaultOptions().ExecutionId with xid.New().String() so default options include a generated ExecutionId.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Types as pkg/types.DefaultOptions
    participant SDK as lib.NewNucleiEngineCtx

    Dev->>Types: call DefaultOptions()
    activate Types
    Types-->>Dev: returns Options { ExecutionId = xid.New().String(), ... }
    deactivate Types

    Dev->>SDK: call NewNucleiEngineCtx(ctx, WithOptions(Options?))
    activate SDK
    SDK-->>SDK: does not set ExecutionId (uses provided Options)
    SDK-->>Dev: returns NucleiEngine (ExecutionId present if provided by Options)
    deactivate SDK
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus:
    • pkg/types/types.go — ensure ExecutionId generation is unconditional and deterministic for callers using DefaultOptions().
    • lib/sdk.go, lib/multi.go — confirm removal of xid imports and no lingering assumptions that engine sets ExecutionId.
    • Call sites using WithOptions(...) — verify they either pass options with ExecutionId set or rely on DefaultOptions(); check error paths where missing ExecutionId could cause runtime panics.

Poem

🐇 I hopped a tiny ID across the code,
From SDK burrow to types' warm node.
Now options wear a nonce so neat,
Engines start with rhythm and beat —
A little hop, a tidy code.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving ExecutionId initialization from NewNucleiEngineCtx to the DefaultOptions function.
Linked Issues check ✅ Passed The PR successfully implements the fix for issue #6594 by initializing ExecutionId in DefaultOptions, preventing WithOptions from overriding it with an empty value.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the ExecutionId override issue; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 6594_init_exec_id

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce6070d and 683bc04.

📒 Files selected for processing (1)
  • lib/sdk.go (0 hunks)
💤 Files with no reviewable changes (1)
  • lib/sdk.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lint

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc0f1e9 and 6a1451f.

📒 Files selected for processing (2)
  • lib/sdk.go (0 hunks)
  • pkg/types/types.go (2 hunks)
💤 Files with no reviewable changes (1)
  • lib/sdk.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: Format Go code using go fmt
Run static analysis with go vet

Files:

  • pkg/types/types.go
🧬 Code graph analysis (1)
pkg/types/types.go (1)
pkg/reporting/reporting.go (1)
  • New (79-203)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lint
🔇 Additional comments (1)
pkg/types/types.go (1)

21-21: LGTM: Import addition is appropriate.

The xid import supports the ExecutionId auto-generation in DefaultOptions() and represents the shift of responsibility from the SDK initialization to the types package default constructor.

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good approach, but we need to ensure that the executionId is generated and persisted properly for the execution duration. For example NewThreadSafeNucleiEngineCtx requires a new ExecutionId as well, which is overwritten after DefaultOptions() is called, making the instruction apparently redundant at

defaultOptions.ExecutionId = xid.New().String()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] fatal error when using WithOptions

3 participants