-
-
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
Do not query for the exact facter version #151
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #151 +/- ##
==========================================
+ Coverage 94.93% 95.23% +0.30%
==========================================
Files 2 2
Lines 158 168 +10
==========================================
+ Hits 150 160 +10
Misses 8 8
☔ View full report in Codecov by Sentry. |
7be1bc7
to
b60270c
Compare
b60270c
to
c92683e
Compare
c92683e
to
e26ca6b
Compare
This assumes that no exact match can be found in most cases. This saves a call to FacterDB. Some testing on puppet-nginx this reduced the time for a dry run by about 1 to 2 seconds, from about ~11 to ~9 seconds. Implementation wise this switches to using Gem::Requirement to detect matching versions. This means you can also specify `~> 3.8` as a valid facterversion, or `>= 3 < 5`.
e26ca6b
to
d690765
Compare
# Interpret 3 as ~> 3.0 | ||
"~> #{version}.0" |
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.
This isn't = #{version}
because 3.3 should allow 3.3.1.
For me it does produce more warnings. Without the patch:
With the patch:
You could argue it's more correct that if you specify 4.2.11 that you should also get 4.2.11 facts. Overall the (very unscientific) performance difference is:
vs:
So about 2 seconds or about 20% faster. #152 shaves off another 2 seconds and brings it down to 6. |
I'd like to see this merged. Should I merge it myself? I wonder if this qualifies as backwards-incompatible or not. I think it isn't, though it generates more warnings. How strict should the warnings be? It looks to me that 4.2.11 != 4.2.9, but on the other hand: that's probably ok. |
I like the 'better safe than sorry' and suggest to merge this as backwards-incompatible. Then people won't pull it in automatically. |
This assumes that no exact match can be found in most cases. This saves a call to FacterDB. Some testing on puppet-nginx this reduced the time for a dry run by about 1 to 2 seconds, from about ~11 to ~9 seconds.
Implementation wise this switches to using Gem::Requirement to detect matching versions. This means you can also specify
~> 3.8
as a valid facterversion, or>= 3 < 5
.This is a reworked version of a patch in #124 that focuses on only reworking the facterversion selection.
There are some implementation differences that can be considered backwards incompatible. Right now this is not ready to be merged, but we should talk about what is desired. Please see the test cases and their diffs for how the behavior will change.