fix(ledger.lic): v1.4.1 change lootcap estimate from monthly to weekly#2313
fix(ledger.lic): v1.4.1 change lootcap estimate from monthly to weekly#2313
Conversation
📝 WalkthroughWalkthroughThe PR updates ChangesLedger Weekly Loot Cap
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/ledger.lic`:
- Around line 334-341: The method estimate_loot_cap currently accepts year and
month kwargs but silently ignores them which can mislead callers; update
estimate_loot_cap to detect non-default year or month inputs and fail loudly
(e.g., raise ArgumentError) when callers pass explicit year/month values, or
alternatively implement proper historical-week handling if desired; modify the
start of estimate_loot_cap (the method signature and the initial lines that set
_ = year; _ = month) to either validate and raise when year/month !=
Time.now.year/Time.now.month or to compute the correct historical window and use
those values instead, and add a clear error message explaining that historical
queries are unsupported and suggesting the new API if applicable.
- Line 69: The script fails on systems without system zoneinfo because it only
loads "tzinfo"; update the gems_to_load array (where gems_to_load = ["sequel",
"terminal-table", "tzinfo"]) to also include "tzinfo-data" so
TZInfo::Timezone.get calls (referenced around the TZInfo::Timezone.get usage)
will have timezone data available at runtime, and ensure the require/load
happens before any TZInfo usage to avoid TZInfo::DataSourceNotFound.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Summary by CodeRabbit