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

Extend list of permitted classes for YAML safe load and allow aliases #1758

Merged

Conversation

nmburgan
Copy link
Contributor

@nmburgan nmburgan commented Nov 14, 2022

When trying to load hosts_preserved.yml, all of these classes need to be able to be loaded. We should probably serialize fewer things to this file, but in the meantime, this allows things to work. This also uses strings for the list, since not all the classes are loaded and available at the time we are declaring this array. This also allows aliases, since we are using those in the hosts_preserved.yml file.

@codecov
Copy link

codecov bot commented Nov 14, 2022

Codecov Report

Base: 74.93% // Head: 74.93% // No change to project coverage 👍

Coverage data is based on head (1b4bfbd) compared to base (f60ac94).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 1b4bfbd differs from pull request most recent head 4335485. Consider uploading reports for the commit 4335485 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1758   +/-   ##
=======================================
  Coverage   74.93%   74.93%           
=======================================
  Files          82       82           
  Lines        4876     4876           
=======================================
  Hits         3654     3654           
  Misses       1222     1222           
Impacted Files Coverage Δ
lib/beaker/options/hosts_file_parser.rb 95.45% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nmburgan nmburgan force-pushed the maint/master/fix_hosts_preserved_loading branch from d9f2fda to 0e108d6 Compare November 14, 2022 21:06
Copy link
Contributor

@donoghuc donoghuc left a comment

Choose a reason for hiding this comment

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

I think this is a good thing to get released. If someone can eventually look in to paring down what we persist for known hosts in the first place that would also be good.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Is there some test that exercises the code that requires the serialization? As you can see, we already had tests for 3.1 but since they passed, clearly there's a gap in coverage.

@nmburgan nmburgan force-pushed the maint/master/fix_hosts_preserved_loading branch from 0e108d6 to ab71ae5 Compare November 18, 2022 21:06
@nmburgan
Copy link
Contributor Author

Good call. I added a hosts_preserved.yml to try to load in the spec. It's not testing the specific permitted classes or anything, just verifying it can load the file. We can get fancier with it if you think it's important.

@nmburgan nmburgan force-pushed the maint/master/fix_hosts_preserved_loading branch 2 times, most recently from 2c4653b to 56565ae Compare November 18, 2022 21:11
When trying to load hosts_preserved.yml, all of these classes need to be able to be loaded. We should probably serialize fewer things to this file, but in the meantime, this allows things to work. This also uses strings for the list, since not all the classes are loaded and available at the time we are declaring the array. This also allows aliases, since we are using those in the hosts_preserved.yml file.

This also adds a test to the spec to verify we can load a representative hosts_preserved.yml.
@nmburgan nmburgan force-pushed the maint/master/fix_hosts_preserved_loading branch from 56565ae to 4335485 Compare November 18, 2022 21:12
@ekohl ekohl merged commit 1fc6295 into voxpupuli:master Nov 23, 2022
@ekohl ekohl linked an issue Nov 23, 2022 that may be closed by this pull request
@ekohl ekohl added the bug label Nov 23, 2022
@ekohl ekohl mentioned this pull request Nov 23, 2022
@bastelfreak bastelfreak changed the title Add to list of permitted classes and allow aliases Extend list of permitted classes for YAML safe load and allow aliases Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ruby 3.1/Psych 4 compatibility issues
4 participants