-
Notifications
You must be signed in to change notification settings - Fork 583
namespacing ensure_packages breaks a lot of modules #1365
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
Comments
In my Puppet-8 environment the upgrade to Stdlib-9 caused Puppet Evaluation Errors terminating every Puppet run. According to https://github.com/puppetlabs/puppet/wiki/Puppet-8-Compatibility the parameter If So how should the transition from the non-namespaced to the namespaced implementation of Running Puppet-8 with Stdlib-9 is only possible if all deprecated functions have been removed from all included modules, which probably will take some time. Setting |
ok, I didnt realise that it was puppet 8's fault. That timing sucks. The fact that puppet has gone warnings=error by default at the exact same time that its been decided to namespace the stdlib functions is very unfortunate. The only workaround I can see and I don't know if its practical would be as follows. |
Exactly my opinion.
I reverted the changed default in my
The error is gone with that setting. |
Yeah, theres something not right. |
definitely ensure_packages and stdlib::ensure_packages do not work the same (except for producing a warning). |
Interesting... maybe it's because it's an Internal function and is now being invoked with a different scope??? |
Make the `ensure_packages` shim an Internal function and pass scope to the namespaced version so as to not change the behaviour of where packages are contained. When the function was first ported to the new API, it was discussed that the existing behaviour might not be 'correct', but changing it would be a breaking change that might have consequences for many users. In namespacing the function in 9.0.0 we accidentally created a situation where the namespaced version worked as before, but the non-namespaced version, (the shim), now behaved differently. Fixes puppetlabs#1365
@robertc99 Are you able to test #1366 and verify that it does indeed fix your issue? |
Make the `ensure_packages` shim an Internal function and pass scope to the namespaced version so as to not change the behaviour of where packages are contained. When the function was first ported to the new API, it was discussed that the existing behaviour might not be 'correct', but changing it would be a breaking change that might have consequences for many users. In namespacing the function in 9.0.0 we accidentally created a situation where the namespaced version worked as before, but the non-namespaced version, (the shim), now behaved differently. Fixes puppetlabs#1365
FWIW, it wouldn't have done, because it had a bug in it... Should be good to go now though. |
Perhaps I should file a separate issue, but I believe the same basic problem causes problems for other functions as well, and it’s going to cause problems for a lot of modules. For example, I have a puppet module that uses
Strictly speaking I could also roll my own To be clear, I’m only mentioning my module as an example — I can work around this. This same basic issue will likely cause problems for a lot of people as they upgrade to stdlib 9.0.0. |
Also, I personally think that the “real” problem is the change in behavior in Puppet 8 — deprecation warnings should not be treated as errors by default. Of course, that is likely outside of any of our power to change. I just figured that I should clarify that I don’t think this was a bad change in stdlib. Rather, it was the right change, but Puppet 8 broke things. |
Sorry, last comment today. Should have gotten all my thoughts together before I started writing. I filed two tickets with Puppet:
Perhaps I’m wrong about all of this and #1366 will fix this, though? |
No, #1366 only fixes the change in behaviour when strict mode is off. You're right that we need to see how to improve the issue with deprecation warnings being more than just warnings. Or can we add a setting specific to deprecations instead of using the existing |
Make the `ensure_packages` shim an Internal function and pass scope to the namespaced version so as to not change the behaviour of where packages are contained. When the function was first ported to the new API, it was discussed that the existing behaviour might not be 'correct', but changing it would be a breaking change that might have consequences for many users. In namespacing the function in 9.0.0 we accidentally created a situation where the namespaced version worked as before, but the non-namespaced version, (the shim), now behaved differently. Fixes puppetlabs#1365
I was a little confused, so to clarify, it sounds like there are two issues:
Should there be a separate issue for one or both of these? |
Make the `ensure_packages` shim an Internal function and pass scope to the namespaced version so as to not change the behaviour of where packages are contained. When the function was first ported to the new API, it was discussed that the existing behaviour might not be 'correct', but changing it would be a breaking change that might have consequences for many users. In namespacing the function in 9.0.0 we accidentally created a situation where the namespaced version worked as before, but the non-namespaced version, (the shim), now behaved differently. Fixes puppetlabs#1365
The recent release of stdlib 9 namespaced a lot of functions.
However, namespacing ensure_packages breaks a lot of existing puppet forge modules.
Other namespaced functions like merge and the dropped has_keys have good alternatives.
I don't think ensure_packages does. So I don't think its a good idea to namespace it if the non namespaced version generates
an error.
So I think it would be better to namespace it, but leave the non namespaced version alone or at worst make it a warning.
Possibly the same reasoning applies to ensure_resources. But that doesn't seem to be as much of a problem.
The text was updated successfully, but these errors were encountered: