Remove parse_yaml_old from web helpers#7001
Merged
Merged
Conversation
Commit 25afb79 (sidekiq#6950) replaced YAML-based locale parsing with a custom parser for security, but left parse_yaml_old behind (marked `# TODO Remove`) as a test oracle. It still pulled `require "yaml"` / YAML.safe_load_file into the web request path. Remove it and have the locale test load the YAML oracle directly, preserving the cross-check against parse_yaml_new without carrying YAML in production web code.
Collaborator
|
The old and new methods were there so tests could verify they parsed identically. If you’re removing the old method, please rename the new method. |
With parse_yaml_old removed, the _new suffix no longer carries meaning, so rename the remaining parser to parse_yaml (per review feedback).
Contributor
Author
|
Good call — renamed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Commit 25afb79 (#6950) replaced YAML-based locale parsing with a custom parser to keep YAML off the web request path, but left
parse_yaml_oldbehind — marked# TODO Removeand used only as a test oracle. It still pulledrequire "yaml"+YAML.safe_load_fileintoweb/helpers.rb.parse_yaml_old(and its# TODO Remove);parse_yaml_newis already the sole production parser viastrings.YAML.safe_load_file(path)directly (tests may use YAML — the security boundary is production web code). Also drops two dead debug comments.git grep parse_yaml_oldis now empty.Testing
bundle exec rakeis green (standard + lint:herb + full suite).