Fix stall upgrade logic and test stability - #114
Conversation
- Centralized stall upgrade logic to ensure UI descriptions match gameplay scaling. - Added missing "Boost" category to the legendary naming system for Bak Kut Teh stalls. - Improved unit test stability and performance by explicitly managing the ViewModel's game loop. - Resolved logical errors and timeouts in KitchelinBonusTest and BossWaveLogicTest. - Updated MilestoneBoostTest to reflect corrected additive and multiplicative scaling rules. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughStall upgrade logic was extracted into a new StallUpgradeManager that centralizes cost calculation, available-stat selection, upgrade application (including milestone scaling and special-case rules), and benefit-string formatting. MainViewModel and Registry delegate to it; tests and LegendaryNames were updated; MainViewModel.gameJob visibility changed to internal. ChangesStall Upgrade Manager Extraction
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6f11c911-d714-4fa1-91ae-12e535820e0e
📒 Files selected for processing (8)
app/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/main/java/com/messark/hawker/registry/Registry.ktapp/src/main/java/com/messark/hawker/utils/LegendaryNames.ktapp/src/main/java/com/messark/hawker/utils/StallUpgradeManager.ktapp/src/test/java/com/messark/hawker/BossWaveLogicTest.ktapp/src/test/java/com/messark/hawker/KitchelinBonusTest.ktapp/src/test/java/com/messark/hawker/LegendaryNamingTest.ktapp/src/test/java/com/messark/hawker/MilestoneBoostTest.kt
- Centralized stall upgrade logic to ensure UI descriptions match gameplay scaling. - Added missing "Boost" category to the legendary naming system for Bak Kut Teh stalls. - Improved unit test stability and performance by explicitly managing the ViewModel's game loop. - Resolved logical errors and timeouts in KitchelinBonusTest and BossWaveLogicTest. - Updated MilestoneBoostTest to reflect corrected additive and multiplicative scaling rules. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
- Validate specificStat in MainViewModel.kt before applying upgrades to prevent invalid state changes. - Add "Boost" category to LegendaryNames.kt for Bak Kut Teh legendary titles. - Improve unit test reliability by explicitly managing the ViewModel's game loop (cancelling gameJob). - Synchronize MilestoneBoostTest with current scaling logic and deterministic upgrade methods. - Fix KitchelinBonusTest failures by ensuring projectile hits are correctly processed in virtual time. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
- Ported upgrade logic synchronization and legendary naming from PR #114. - Made RNG injectable in MainViewModel constructor with a default value. - Updated all unit tests to inject a fixed-seed Random(42) for determinism. - Changed gameJob visibility to internal and cancelled it in test setups. - Validated specificStat in applyUpgrade. - Verified all unit tests pass. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
…115) - Centralized stall upgrade logic to ensure UI descriptions match gameplay scaling. - Added "Boost" category to the legendary naming system for Bak Kut Teh stalls. - Improved unit test stability by explicitly managing the ViewModel's game loop (cancelling gameJob). - Resolved logical errors and timeouts in KitchelinBonusTest and BossWaveLogicTest. - Updated MilestoneBoostTest and LegendaryNamingTest to reflect current scaling rules and use deterministic upgrade methods. - Validated specificStat in MainViewModel.kt to prevent invalid state changes. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Pull request was closed
This PR addresses several desynchronization bugs between the game's upgrade logic and its UI representation. It also fixes all existing unit test failures and performance issues (timeouts).
Key Changes:
LegendaryNames.kt. Bak Kut Teh stalls can now reach legendary status at level 10.gameJobinterference in unit tests by making it internal and cancelling it during test setup. This stops the background loop from causing nondeterministic state changes and timeouts.upgradeStallRandomly()to bypass UI-only overlay logic.KitchelinBonusTestwhere enemies were moving out of range before projectiles could land in virtual time.MainViewModelto use its seeded random instance for stall upgrades, ensuring consistent results during testing.All unit tests now pass in under 20 seconds.
PR created automatically by Jules for task 2852423425195058954 started by @candour
Summary by CodeRabbit
New Features
Core Systems
Tests