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

Add support for evaluation cost #43

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Add support for evaluation cost #43

merged 2 commits into from
Nov 23, 2023

Conversation

knrc
Copy link
Contributor

@knrc knrc commented Nov 15, 2023

Description

Adding support for evaluation costs

Note: this PR also updated the wasm exec js library to the version from go.1.21.3, if this is a problem I can roll back to 1.20

Linked Issues

Closes #34

How has this been tested?

  • Test cases updated
  • Ran evaluation in browser and checked that
    • Cost was displayed
    • Choosing new expression from drop down would reset cost/output

Checklist

  • I have labeled this PR with the relevant Type labels
  • I have documented my code (if applicable)
  • My changes are covered by tests

Signed-off-by: Kevin Conner <kev.conner@gmail.com>
@knrc
Copy link
Contributor Author

knrc commented Nov 15, 2023

Screenshot 2023-11-15 at 9 48 17 AM

@matheusfm matheusfm added the enhancement New feature or request label Nov 16, 2023
@matheusfm matheusfm self-requested a review November 16, 2023 13:31
@matheusfm
Copy link
Contributor

Hi, @knrc!
Thank you so much for this PR. We appreciate your contribution!

I observed that these changes lead to an unexpected result when running the expression below against URLs example:

{
    'scheme': url(object.href).getScheme()
}

image

Maybe it is related to the JSON serialization mentioned in the PR #15 (with protojson library).

Would you mind taking a look please?

@knrc
Copy link
Contributor Author

knrc commented Nov 16, 2023

@matheusfm fixed, it was a javascript error. I was missing a stringify call.

Signed-off-by: Kevin Conner <kev.conner@gmail.com>
Copy link
Contributor

@matheusfm matheusfm left a comment

Choose a reason for hiding this comment

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

Great @knrc! Thank you very much for your contribution and collaboration.

@matheusfm matheusfm merged commit 8687777 into undistro:main Nov 23, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrated with CEL cost system as in Kubernetes
2 participants