Skip to content

Remove parse_yaml_old from web helpers#7001

Merged
mperham merged 3 commits into
sidekiq:mainfrom
hammadxcm:cleanup-remove-parse-yaml-old
May 25, 2026
Merged

Remove parse_yaml_old from web helpers#7001
mperham merged 3 commits into
sidekiq:mainfrom
hammadxcm:cleanup-remove-parse-yaml-old

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

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_old behind — marked # TODO Remove and used only as a test oracle. It still pulled require "yaml" + YAML.safe_load_file into web/helpers.rb.

  • Remove parse_yaml_old (and its # TODO Remove); parse_yaml_new is already the sole production parser via strings.
  • The "can parse locale files" test keeps its exact oracle cross-check by calling 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_old is now empty.

Testing

bundle exec rake is green (standard + lint:herb + full suite).

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.
@mperham

mperham commented May 25, 2026

Copy link
Copy Markdown
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).
@hammadxcm

Copy link
Copy Markdown
Contributor Author

Good call — renamed parse_yaml_new to parse_yaml now that the old method is gone. The locale test keeps the identical cross-check by loading the YAML oracle directly with YAML.safe_load_file. Pushed.

@mperham mperham merged commit a85eda2 into sidekiq:main May 25, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants