Skip to content

refactor: switch from Knetic/govaluate to projectdiscovery fork (#7380)#7381

Closed
ChrisJr404 wants to merge 1 commit into
projectdiscovery:devfrom
ChrisJr404:refactor/projectdiscovery-govaluate-7380
Closed

refactor: switch from Knetic/govaluate to projectdiscovery fork (#7380)#7381
ChrisJr404 wants to merge 1 commit into
projectdiscovery:devfrom
ChrisJr404:refactor/projectdiscovery-govaluate-7380

Conversation

@ChrisJr404
Copy link
Copy Markdown
Contributor

Closes #7380.

Summary

github.com/Knetic/govaluate is archived. Switch to the maintained fork at github.com/projectdiscovery/govaluate (bug fixes + perf improvements, including the nuclei#5580 quote-string parsing called out in the issue). All 17 source files swapped, plus go.mod/go.sum.

Why this is a draft

projectdiscovery/dsl still re-exports Knetic/govaluate types in its public API (HelperFunctions() map[string]Knetic/govaluate.ExpressionFunction). Without the matching swap on the dsl side, this PR fails to build with:

cannot use dsl.HelperFunctions() (value of type map[string]"github.com/Knetic/govaluate".ExpressionFunction) as map[string]"github.com/projectdiscovery/govaluate".ExpressionFunction value

go modules can't satisfy two different module paths from the same source, so the dsl swap has to land first.

Companion PR: projectdiscovery/dsl#305 — same refactor, no public-API shape change.

Current state of this PR

  • Source-file import paths: swapped everywhere (15 files under pkg/).
  • go.mod / go.sum: drop Knetic, add projectdiscovery/govaluate.
  • Temporary replace: github.com/projectdiscovery/dsl => github.com/ChrisJr404/dsl <hash> pinned at the dsl#305 commit so this PR builds green for review. This needs to come out before merge — once dsl#305 is tagged, bump the projectdiscovery/dsl version in the require block and drop the replace.

Tests

go test ./pkg/operators/... ./pkg/protocols/common/... ./pkg/templates/... — all packages pass (matchers, extractors, dsl, variables, expressions, templates).

Path to merge

  1. Land dsl#305.
  2. Tag a new projectdiscovery/dsl release.
  3. On this PR: go get github.com/projectdiscovery/dsl@, drop the replace directive, mark ready for review.

Happy to do step 3 once the dsl PR is in.

Closes projectdiscovery#7380.

github.com/Knetic/govaluate has been archived. Switch all import paths
in the source tree and go.mod to the maintained fork at
github.com/projectdiscovery/govaluate (bug fixes + perf improvements
including the nuclei#5580 quote-string parsing already cited in the
issue).

The temporary go.mod replace pointing at github.com/ChrisJr404/dsl is
there because projectdiscovery/dsl still exposes Knetic types in its
public API — without that update, go modules can't satisfy two
different module paths from the same source. The companion PR
projectdiscovery/dsl#305 lands the matching swap on the dsl side.
Once dsl#305 is merged and tagged, the replace can come out and the
dsl version bumped.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5352d5af-ae21-4070-af09-90ff38e234bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@dogancanbakir
Copy link
Copy Markdown
Member

dogancanbakir commented May 19, 2026

Thanks for the PR! Superseded by #7414

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.

Replace github.com/Knetic/govaluate with github.com/projectdiscovery/govaluate

2 participants