Skip to content

Updated Ferret to v2.0.0-alpha.7#37

Merged
ziflex merged 1 commit intomainfrom
chore/ferret-v2.0.0-alpha.7
Apr 9, 2026
Merged

Updated Ferret to v2.0.0-alpha.7#37
ziflex merged 1 commit intomainfrom
chore/ferret-v2.0.0-alpha.7

Conversation

@ziflex
Copy link
Copy Markdown
Member

@ziflex ziflex commented Apr 8, 2026

This pull request updates the Ferret engine dependency to a newer alpha release and simplifies how query parameters are passed to the engine in the Builtin runtime. The main focus is on removing unnecessary parameter parsing, leveraging improvements in the updated Ferret library.

Dependency update:

  • Upgraded the github.com/MontFerret/ferret/v2 dependency from v2.0.0-alpha.5 to v2.0.0-alpha.7 in go.mod.

Parameter handling simplification:

  • Removed the use of runtime.NewParamsFrom to parse parameters in both Run and RunArtifact methods in pkg/runtime/builtin.go, passing the params map directly to ferret.WithSessionParams. This makes the code simpler and relies on the updated Ferret API. [1] [2] [3]

Code cleanup:

  • Removed the now-unused import of github.com/MontFerret/ferret/v2/pkg/runtime from pkg/runtime/builtin.go.

Copilot AI review requested due to automatic review settings April 8, 2026 19:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the core Ferret engine dependency to v2.0.0-alpha.7 and aligns the builtin runtime with the updated Ferret session parameter API by removing intermediate parameter parsing.

Changes:

  • Bump github.com/MontFerret/ferret/v2 from v2.0.0-alpha.5 to v2.0.0-alpha.7.
  • Simplify builtin runtime execution by passing params directly to ferret.WithSessionParams in both Run and RunArtifact.
  • Remove the now-unused Ferret pkg/runtime import from the builtin runtime.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/runtime/builtin.go Removes runtime.NewParamsFrom usage and passes params directly into Ferret session options.
go.mod Updates Ferret dependency version to v2.0.0-alpha.7.
go.sum Updates checksums for the new Ferret version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 46 to 48
func (rt *Builtin) Run(ctx context.Context, query *source.Source, params map[string]any) (io.ReadCloser, error) {
parsedParams, err := runtime.NewParamsFrom(params)

if err != nil {
return nil, err
}

res, err := rt.engine.Run(ctx, query, ferret.WithSessionParams(parsedParams))
res, err := rt.engine.Run(ctx, query, ferret.WithSessionParams(params))

Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The behavior of passing params directly into ferret.WithSessionParams is now relied on for non-artifact execution as well, but existing tests only appear to cover the compiled-artifact path with params. Please add a test that runs a source query with params (e.g., RETURN @value) to ensure the updated Ferret version correctly consumes map[string]any session params in Run too.

Copilot uses AI. Check for mistakes.
@ziflex ziflex merged commit 6a2976f into main Apr 9, 2026
12 checks passed
@ziflex ziflex deleted the chore/ferret-v2.0.0-alpha.7 branch April 9, 2026 14:52
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.

2 participants