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

Fix bin/fill-locales when the key in en is a hash and not in other #4467

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

albertchae
Copy link
Contributor

@albertchae albertchae commented Feb 19, 2024

The script would fail if the current en was a hash but other wasn't
because we would try to call dig on a string. In this case, return
nil so that we can recursively copy the shape of en to other

I'm not sure if this is the best way to fix this, but I did use it to copy over the keys in #4466 and also tested that it works on #4462

The script would fail if the current `en` was a hash but `other` wasn't
because we would try to call `dig` on a string. In this case, return
`nil` so that we can recursively copy the shape of `en` to `other`
Copy link
Member

@simi simi left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the fix. This is much better than crash and the problematic case is IMHO rare, no need to do anything complex.

Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a166302) 97.13% compared to head (f342545) 97.15%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4467      +/-   ##
==========================================
+ Coverage   97.13%   97.15%   +0.02%     
==========================================
  Files         385      391       +6     
  Lines        8200     8259      +59     
==========================================
+ Hits         7965     8024      +59     
  Misses        235      235              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@simi simi enabled auto-merge (rebase) February 19, 2024 18:34
@simi simi merged commit b9fe2d7 into rubygems:master Feb 19, 2024
17 checks passed
@albertchae albertchae deleted the fix-fill-locales branch February 20, 2024 07:39
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