puppetlabs / puppet

Server automation framework and application
https://puppet.com/open-source/#osp
Apache License 2.0
7.46k stars 2.19k forks source link

(PUP-12077) Respect rich_data setting in base context #9471

Closed justinstoller closed 2 months ago

justinstoller commented 2 months ago

Since Puppet 6.0 "datafication" has inspected the context for the value of rich_data. However, in only some code paths does the value in the context get overridden with a value taken from the settings. This means in some cases the rich_data value will always be true or always be false, regardless of how the user has configured the rich_data setting. And, in the case the simply calling to_data_hash on a resource the rich_data value will always be false.

This updates the base_context to set rich_data to the settings value, ensuring that the default value for rich_data in the context is the value users have set.

Additional changes are primarily where tests still assumed the default value of rich_data was false, with one exception - YAML serialization in the resource application will break if the internal rich_data __pcore values are output. This forces rich_data to be false for that code path in the resource application.

Fixes GH https://github.com/puppetlabs/puppet/issues/9470

justinstoller commented 2 months ago

Should I create a PUP ticket and follow the old processes for ticketing issues? Haven't done work in this repo since the JIRA migration and unclear if this got migrated to github issues.

joshcooper commented 2 months ago

I applied the triaged label to the GH issue, which generates a JIRA ticket https://perforce.atlassian.net/browse/PUP-12077

justinstoller commented 2 months ago

Updated the commit to follow style guidelines and, you know, actually be useful. Wasn't sure if we still adhere to those guidlines for branch names and changing the branch name would require a new PR. But happy to open a new PR from a branch that follows our old naming conventions if they're still used.

justinstoller commented 2 months ago

Let me know if there's anything you need from me on this