-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 merge facts option to add_custom_fact #160
Add merge facts option to add_custom_fact #160
Conversation
57b22e2
to
97ce604
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 95.23% 95.34% +0.11%
==========================================
Files 2 2
Lines 168 172 +4
==========================================
+ Hits 160 164 +4
Misses 8 8 ☔ View full report in Codecov by Sentry. |
6a9fdf3
to
b8517d3
Compare
b3be6bc
to
49673bf
Compare
This commit adds an option to the add_custom_fact method, which allows the user to specify whether they wish to deep_merge facts. This allows the user to determine whether they wish to completely overwrite a fact, or simply merge values into the existing fact in a given fact hash.
49673bf
to
d0c9451
Compare
@ekohl @bastelfreak 👋 sorry for the ping.. Does this need anything/any comments? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, but I would like to have a review from @ekohl as well.
This PR implements a new merge_facts option, which can be used with the add_custom_fact method in your configurations.
It allows users to determine whether they want to completely overwrite a fact already present in the facts hash, or simply merge values into the existing fact to expand/overwrite certain values whilst the entirety of the fact.
sample usage:
add_custom_fact :identity, { 'user' => "test_user" }, merge_facts: true
will update the value of user in the identity fact to "test_user", whilst keeping the rest of the identity fact values the same.
Failing tests rely on the merge of #157