Skip to content

re-add support for loading aliases in yaml files#1362

Merged
b4ldr merged 1 commit intopuppetlabs:mainfrom
lollipopman:readd-support-for-loading-aliases
Jun 1, 2023
Merged

re-add support for loading aliases in yaml files#1362
b4ldr merged 1 commit intopuppetlabs:mainfrom
lollipopman:readd-support-for-loading-aliases

Conversation

@lollipopman
Copy link
Copy Markdown
Contributor

Ruby 3.1 includes Psych 4.0 which no longer loads aliases by default. Since aliases are part of the yaml spec, it seems sensible to re-add support.

@puppet-community-rangefinder
Copy link
Copy Markdown

loadyaml is a function

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

This module is declared in 318 of 580 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.

Copy link
Copy Markdown
Collaborator

@smortex smortex left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Can you please fix the style issues spotted by rubocop and visible on the "Files changed" tab?

Copy link
Copy Markdown
Collaborator

@b4ldr b4ldr left a comment

Choose a reason for hiding this comment

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

+1 lgtm once rubocop fixed

@lollipopman lollipopman force-pushed the readd-support-for-loading-aliases branch from 484e386 to e8acae9 Compare May 31, 2023 14:16
@lollipopman
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing @smortex & @b4ldr bundle exec rake rubocop now passes clean on my pushed branch.

@b4ldr b4ldr force-pushed the readd-support-for-loading-aliases branch from e8acae9 to 783a5ef Compare May 31, 2023 16:29
Comment thread lib/puppet/parser/functions/loadyaml.rb Outdated
Ruby 3.1 includes Psych 4.0 which no longer loads aliases by default.
Since aliases are part of the yaml spec, it seems sensible to re-add
support.

We need to read the file first to be compatible with ruby2.7 which does
not support the aliases option on YAML.load_file. Use temp files in
rspec tests to avoid needing to mock read.
@lollipopman lollipopman force-pushed the readd-support-for-loading-aliases branch from 783a5ef to c118a50 Compare May 31, 2023 19:15
@b4ldr b4ldr merged commit 2c816ed into puppetlabs:main Jun 1, 2023
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.

5 participants