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

chore: refactor json logic evaluator to pass custom operators as options #684

Conversation

bacherfl
Copy link
Contributor

@bacherfl bacherfl commented Jun 1, 2023

Closes #667

This PR moves the registration of the custom JSON evaluators out of the NewJSONEvaluator method, and allows to pass the custom evaluators as options to the New function. This way, the JSONEvaluator does not need to be aware of the custom evaluations and reduces its responsibility to just providing the means to execute jsonLogic evaluations, based on its store and the flag configurations.

@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

❗ No coverage uploaded for pull request base (main@aef0b90). Click here to learn what that means.
The diff coverage is 95.00%.

@@           Coverage Diff           @@
##             main     #684   +/-   ##
=======================================
  Coverage        ?   73.77%           
=======================================
  Files           ?       26           
  Lines           ?     2601           
  Branches        ?        0           
=======================================
  Hits            ?     1919           
  Misses          ?      610           
  Partials        ?       72           
Impacted Files Coverage Δ
core/pkg/runtime/from_config.go 60.78% <91.66%> (ø)
core/pkg/eval/fractional_evaluation.go 66.66% <100.00%> (ø)
core/pkg/eval/json_evaluator.go 88.72% <100.00%> (ø)
core/pkg/eval/semver_evaluation.go 100.00% <100.00%> (ø)
core/pkg/eval/string_comparison_evaluation.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
Signed-off-by: Florian Bacher <[email protected]>
@bacherfl bacherfl marked this pull request as ready for review June 1, 2023 08:10
@bacherfl bacherfl requested a review from a team as a code owner June 1, 2023 08:10
@toddbaert
Copy link
Member

FYI I think the lint error that's appeared is a bug/false positive.

@beeme1mr beeme1mr self-requested a review June 6, 2023 20:20
@beeme1mr beeme1mr closed this Jun 7, 2023
@Kavindu-Dodan
Copy link
Contributor

Unfortunately cannot reopen the PR. This is discussed here : isaacs/github#361

let's open a new PR to get this through

@beeme1mr
Copy link
Member

beeme1mr commented Jun 7, 2023

Yeah, my bad. I thought closing and reopening the PR would fix the GitHub action issue.

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.

Refactor JSONEvaluator
5 participants