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

Switch parsejson() from PSON to JSON parsing #1240

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

seanmil
Copy link
Collaborator

@seanmil seanmil commented May 2, 2022

The use of PSON is deprecated and mostly removed from Puppet.
Switch this function from using PSON to a real JSON parsing
library via the MultiJson helper in Puppet::Util::Json.

The use of PSON is deprecated and mostly removed from Puppet.
Switch this function from using PSON to a real JSON parsing
library via the MultiJson helper in Puppet::Util::Json.
@seanmil seanmil requested a review from a team as a code owner May 2, 2022 20:33
@puppet-community-rangefinder
Copy link

parsejson is a function

Breaking changes to this file MAY impact these 13 modules (near match):

This module is declared in 318 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@david22swan
Copy link
Member

@seanmil Apologies but could you provide some evidence regarding the said deprecation?
From what I can tell PSON is still included within the newest versions of puppet.

@chelnak
Copy link
Contributor

chelnak commented Jul 11, 2022

Hey @seanmil, are you still interested in progressing with this Pull Request?

It looks like there is a question from @david22swan to address.

@seanmil
Copy link
Collaborator Author

seanmil commented Jul 25, 2022

Apologies but could you provide some evidence regarding the said deprecation?
From what I can tell PSON is still included within the newest versions of puppet.

@david22swan Sorry, I could have phrased that a lot better. What I meant was that unless I'm misremembering, back in the distant past everything in Puppet which used JSON used PSON instead, even if it was supposed to be real JSON and that using PSON instead of JSON for things which should be JSON has been not in favor for quite a while.

Regardless though, that is not really the point. The point is that the function name is "parsejson", but actually parses PSON, which doesn't parse all the JSON which the JSON functions will parse (see the updated spec examples).

If there is a desire/need for parsepson then that should be introduced as a separate function.

Thanks!

Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Logic behind this makes sense to me so I'm happy to merge. Have put up a PR to create a specific parsepson function:
#1259

@david22swan david22swan merged commit 1306ed5 into puppetlabs:main Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants