feat: implement report caching — skip generation if a report already …#172
Merged
BigBen-7 merged 2 commits intoLead-Studios:mainfrom Mar 27, 2026
Merged
Conversation
|
@Kaylahray Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
BigBen-7
approved these changes
Mar 27, 2026
BigBen-7
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #156
What changed
src/config.py— addedREPORT_CACHE_MINUTES: int = 60env var with default.src/report_service.py— addedcreate_generated_reports_table,insert_report_metadata, andcheck_report_cachehelpers. Updatedgenerate_daily_report_csvsignature to acceptevent_id,force_regenerate, andcache_minutes; returns(path, cache_hit: bool)tuple.src/types_custom.py— addedevent_idandforce_regenerate: bool = FalsetoDailyReportRequest; addedcache_hit: booltoDailyReportResponse.src/main.py— startup now callscreate_generated_reports_table; endpoint unpacks the tuple and forwards all new params; response message differs on hit vs miss.tests/test_report_caching.py— full test suite: cache hit, cache miss (no engine), stale file fallback,force_regeneratebypasses cache,cache_hitflag in API response,REPORT_CACHE_MINUTESforwarded from settings.test_daily_report.pyandtest_standard_modules_unittest.pycallers to unpack the new return tuple.Checklist
check_report_cachequeriesgenerated_reportsby{report_date, event_id, format}withinREPORT_CACHE_MINUTEScache_hit: boolinDailyReportResponseforce_regenerate: boolskips cache check entirely