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

Group expectations evaluation #4

Merged
merged 11 commits into from
Aug 4, 2022
Merged

Group expectations evaluation #4

merged 11 commits into from
Aug 4, 2022

Conversation

fabriziosestito
Copy link
Member

@fabriziosestito fabriziosestito commented Aug 3, 2022

This PR adds the group expectation evaluation and removes the local one.
An expectation declared with expect is expected to return true on all the agents that execute the check.
An expectation declare with expect_same is expected to return the same value on all the agents that execute the check.

It also refactors the shape of the result struct, aggregating the agent evaluations in check results and the check results in an execution result, so we can remove this responsibility from the dashboard.

ATM we provide basic error handling if an expression is invalid or a fact is missing, we will provide more errors in followup PRs and if we add the rustler module for evaluating expressions.

fabriziosestito and others added 3 commits August 3, 2022 06:58
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
@fabriziosestito fabriziosestito changed the title Group expectations Group expectations evaluation Aug 3, 2022
@fabriziosestito fabriziosestito marked this pull request as ready for review August 3, 2022 05:04
fabriziosestito and others added 4 commits August 3, 2022 07:19
… logic

Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Co-authored-by: Carmine Di Monaco  <carmine.dimonaco@suse.com>
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Excellent piece of work @fabriziosestito and @CDimonaco , really fantastic.
The work on the evaluation.ex file is totally great.

I took my time to check the evaluation flow, and even though it is not that simple, with some effort it is easy to understand.

Maybe some docstring explanation above about the general process would help others to understand, something like, but in any case the code is enough meaningful. So don't give to much thought to this hehe

lib/wanda/execution/evaluation.ex Outdated Show resolved Hide resolved
lib/wanda/execution/evaluation.ex Show resolved Hide resolved
test/execution/evaluation_test.exs Show resolved Hide resolved
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

LGTM

lib/wanda/execution/check_result.ex Outdated Show resolved Hide resolved
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM

@fabriziosestito fabriziosestito merged commit 6d5120f into main Aug 4, 2022
@fabriziosestito fabriziosestito deleted the group_expectations branch August 17, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants