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

Fixes #7758: When several directives value have a CFEngine var, we get \"unexpected\" due to bad regex matching #1033

Conversation

fanf
Copy link
Member

@fanf fanf commented Jan 14, 2016

https://www.rudder-project.org/redmine/issues/7758
The PR is quite big but there is in fact 4 things in it:

    1. I factored out some logic in test so that it's much more easy to write test for value with CFEngine variables. Most of ExecutionBatchTest.scala changes are due to that, but there was ALSO uncoherencies and things that were not good, showed by 2. and 3. above
    1. I found a bug with the logic for getting simple value from reports. The algo was too greedy and was not letting "unused" reports to possible match for cfengine variables
    1. We weren't merging to worst type the values for the same component/directive/rule/node. In practice, it may have never been seen, because that case is only for value with cardinality > 1, but somes tests were testing a bad expectation
    1. And finally, I rebuild most of the logic for matching CFEngine vars. The high level view is that we are testing all reports for all patterns, with a lot of pruning along the side (i.e: each time we are finding a pattern matching exactly one report, we remove that report for testing, pruning any new case where a pattern precendently matching two reports now match one)

@fanf fanf force-pushed the bug_7758/when_several_directives_value_have_a_cfengine_var_we_get_unexpected_due_to_bad_regex_matching branch from 9902148 to b127ae0 Compare January 14, 2016 19:07
@ncharles
Copy link
Member

looks good (but this is complex...)

ncharles added a commit that referenced this pull request Jan 14, 2016
…alue_have_a_cfengine_var_we_get_unexpected_due_to_bad_regex_matching

Fixes #7758: When several directives value have a CFEngine var, we get \"unexpected\" due to bad regex matching
@ncharles ncharles merged commit 5bd07cf into Normation:branches/rudder/3.0 Jan 14, 2016
@fanf fanf deleted the bug_7758/when_several_directives_value_have_a_cfengine_var_we_get_unexpected_due_to_bad_regex_matching branch March 15, 2024 10:51
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