Skip to content
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-12077) Respect rich_data setting in base context #9471

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

justinstoller
Copy link
Member

@justinstoller justinstoller commented Sep 3, 2024

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 #9470

@justinstoller justinstoller requested a review from a team as a code owner September 3, 2024 22:53
lib/puppet.rb Outdated Show resolved Hide resolved
@justinstoller justinstoller force-pushed the thats-rich branch 2 times, most recently from b284a3e to ae55600 Compare September 5, 2024 23:49
@justinstoller
Copy link
Member Author

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
Copy link
Contributor

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

@joshcooper joshcooper added the bug Something isn't working label Sep 6, 2024
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 puppetlabs#9470
@justinstoller justinstoller changed the title [#9470] Respect environment/settings in base context rich_data value (PUP-12077) Respect rich_data setting in base context Sep 6, 2024
@justinstoller
Copy link
Member Author

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.

@mhashizume mhashizume linked an issue Sep 6, 2024 that may be closed by this pull request
@justinstoller
Copy link
Member Author

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

@joshcooper joshcooper merged commit 1fba250 into puppetlabs:main Sep 24, 2024
11 checks passed
@justinstoller justinstoller deleted the thats-rich branch September 25, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rich Data setting not respected when converting catalogs to data
3 participants