-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-10853) Remove legacy facts #9427
base: 7.x
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
Replaces legacy facts with newer structured facts. This is cherry-picked from 82cef23
I think this is ok from a purely "does puppet agent work" perspective. But I'm fairly certain it will break other parts of the ecosystem. Thinking of rspec-puppet and modules that stub out facts selectively. Do you have some confidence that vox modules won't be affected? |
Latest FacterDB doesn't contain any legacy facts. We were at the assumption that when there's an option like 'include_legacy_facts' it's safe to set it to false. And we need a FacterDB version without legacy facts to validate if modules work on Puppet 8. And maintaining different tooling versions for Testing on Puppet 7 vs Puppet 8 is incredible complicated because we don't do that at all at the moment. An example of issues we run into at the moment:
Latest FacterDB, rspec-puppet-facts and rspec-puppet don't rely on legacy facts. It's the opposite, they demand structured facts. |
Another broken module due to this: |
Would the issue have been detected if rspec-puppet was modified to warn about legacy facts? For example, in the |
Maybe. But that would only work if we downgrade facterdb to have legacy facts again. And if rspec-puppet works with a deny list there's a chance that we miss a fact. I still would prefer to merge this PR. I don't see potential impact for an actual running puppet agent. Only in tests when you don't use rspec-puppet-facts (which is the recommendation to use since years) + explicitly stub the facts hash with legacy facts without modern facts. And even that is deprecated since years. Those facts are marked as legacy and deprecated for years. |
I like where @joshcooper is heading. Technically rspec-puppet could look at the Puppet version (which it already does in various places). For Puppet 7 it could "rewrite" the fact for the known list of facts. That means we don't have to update FacterDB and test code can simply stub the modern fact consistently while still working in old Puppet versions. Yielding a warning is a good thing, but if Puppet always looks up some values that warning is going to be shown every single time. If a user can't get rid of a warning, they're going to ignore it. It's probably best to filter out the facts Puppet uses. From a code perspective it introduces less risk since it's only in the testing framework, not actual application code. |
This discussion reminds me of a previous regression with provider confinement/suitability based on facts. IIRC we modified something in puppet and the So while I agree this change is relatively safe for puppet, for example I'm wondering if there's a way for rspec-puppet to differentiate legacy fact lookups caused by builtin providers (and ignore those) versus everything else. |
Replaces legacy facts with newer structured facts.
This is cherry-picked from 82cef23
Puppet 7 already has an option to run without legacy facts. But disabling them causes a lot of issues. To workaround this, I backported the commit, that replaces them with modern facts, from the main branch.