Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: allow selecting wasm target for evaluation #276

Closed
wants to merge 1 commit into from

Conversation

srenatus
Copy link
Collaborator

@srenatus srenatus commented Aug 9, 2021

This turns the simple grpc tests scenario into a matrix test for both
evaluation variants.

⚠️ the inter query builtin cache doesn't seem to be wired up in wasm (see open-policy-agent/opa#3721 -- blocks this, I think)

Fixes #650.

@srenatus srenatus force-pushed the sr/wasm/opt-in branch 3 times, most recently from 61c6e3d to 4fb6822 Compare August 10, 2021 08:12
@srenatus srenatus marked this pull request as ready for review September 13, 2021 12:09
@srenatus srenatus marked this pull request as draft September 14, 2021 08:17
This turns the simple grpc tests scenario into a matrix test for both
evaluation variants.

Fixes open-policy-agent/opa#3716.

Signed-off-by: Stephan Renatus <[email protected]>
@srenatus srenatus marked this pull request as ready for review September 27, 2021 10:23
internal/internal.go Show resolved Hide resolved
target := "rego"
if ec, ok := evalContext.(EvalContextWithTarget); ok {
target = ec.Target()
}
Copy link
Member

Choose a reason for hiding this comment

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

This feels like a better approach. This also means that if we wanted to add something new, we would create a new interface ? But maybe there's no avoiding that 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can have anonymous interfaces, we don't need to name it. We could do

if ec, ok := evalContext.(interface{ Target() string }); ok {
	target = ec.Target()
}

However, that'll make the assertion bit you've pointed at in the other comment impossible, I think. We'd need to find a way to get a similar assurance somehow, like with an extra test of some sort 🤔

Copy link
Member

@ashutosh-narkar ashutosh-narkar left a comment

Choose a reason for hiding this comment

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

LGTM. We should make sure we include this new config field in the docs.

@ashutosh-narkar
Copy link
Member

@srenatus do we want to revive this PR ?

@srenatus
Copy link
Collaborator Author

Let's do it when someone asks for it 😄 what do you think?

@srenatus
Copy link
Collaborator Author

OTOH it would perhaps be good if this didn't blow up when fed a wasm bundle... We should perhaps test that?

@srenatus
Copy link
Collaborator Author

It probably doesn't, the dependency should be there, I've just never tried.

@srenatus srenatus closed this Jan 11, 2022
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.

allow opt-in with wasm engine
2 participants