Skip to content

[dev] Hide Hashie Mash key-conflict warnings#2330

Merged
StephenHulme merged 3 commits intodevelopfrom
sh51/hide-mashie-key-conflict-warnings
Apr 14, 2026
Merged

[dev] Hide Hashie Mash key-conflict warnings#2330
StephenHulme merged 3 commits intodevelopfrom
sh51/hide-mashie-key-conflict-warnings

Conversation

@StephenHulme
Copy link
Copy Markdown
Contributor

@StephenHulme StephenHulme commented Apr 16, 2025

Reduces log length and developer frustration.

Changes proposed in this pull request

Implements: https://www.rubydoc.info/gems/hashie/Hashie%2FMash.quiet

  • Hide warning conflicts for keys: min, max, size, class in developer logs.
    2025-04-16 10:40:43 W, [2025-04-16T09:40:43.446142 #1]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#size defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
    2025-04-16 10:40:43 W, [2025-04-16T09:40:43.446582 #1]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#size defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
    2025-04-16 10:40:43 W, [2025-04-16T09:40:43.446950 #1]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#size defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
    2025-04-16 10:40:43 W, [2025-04-16T09:40:43.453127 #1]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#size defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
    2025-04-16 10:40:43 W, [2025-04-16T09:40:43.453510 #1]  WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#size defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.99%. Comparing base (7bdd71d) to head (0028c02).
⚠️ Report is 23 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2330   +/-   ##
========================================
  Coverage    84.98%   84.99%           
========================================
  Files          504      504           
  Lines        20668    20668           
  Branches       377      377           
========================================
+ Hits         17565    17566    +1     
+ Misses        3100     3099    -1     
  Partials         3        3           
Flag Coverage Δ
javascript 80.25% <ø> (ø)
pull_request 84.99% <ø> (+<0.01%) ⬆️
push 84.98% <ø> (+<0.01%) ⬆️
ruby 92.62% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@BenTopping BenTopping left a comment

Choose a reason for hiding this comment

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

Looks like we are only using Hashie::Mash here. Wondering if there is a replacement for it in vanilla ruby / rails and we can remove it entirely?

@StephenHulme
Copy link
Copy Markdown
Contributor Author

Looks like we are only using Hashie::Mash here. Wondering if there is a replacement for it in vanilla ruby / rails and we can remove it entirely?

That would be lovely. Unfortunately there doesn't seem to be a drop-in replacement, but I think we should be using strongly-typed config, rather than a very lenient hash structure. https://dry-rb.org/gems/dry-struct/1.6/ looks like a promising direction to go, unless there is something more Railsy.

@StephenHulme
Copy link
Copy Markdown
Contributor Author

Given that progress on related issues and fixes appears stalled, would muting the warnings as specifically as possible (as in this PR) seems like a workable solution for now?

@StephenHulme StephenHulme self-assigned this Apr 8, 2026
@StephenHulme StephenHulme requested review from BenTopping and dasunpubudumal and removed request for dasunpubudumal April 8, 2026 11:46
Copy link
Copy Markdown
Contributor

@BenTopping BenTopping 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 fine as a temporary solution. It would be useful to add a TODO / comment about why we are dong it.

@StephenHulme
Copy link
Copy Markdown
Contributor Author

I think this is fine as a temporary solution. It would be useful to add a TODO / comment about why we are dong it.

Thanks, comment added in 0028c02fbc4932fd6886e4eafd9db39a83572fc8

@StephenHulme StephenHulme merged commit 58e4751 into develop Apr 14, 2026
16 checks passed
@StephenHulme StephenHulme deleted the sh51/hide-mashie-key-conflict-warnings branch April 14, 2026 13:17
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