-
Notifications
You must be signed in to change notification settings - Fork 12
add FlareCleanupTask #947
Conversation
|
This PR includes changes to |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #947 +/- ##
==========================================
- Coverage 97.96% 90.63% -7.33%
==========================================
Files 444 446 +2
Lines 35879 36045 +166
==========================================
- Hits 35148 32671 -2477
- Misses 731 3374 +2643
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
|
✅ All tests successful. No failed tests were found. 📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
Swatinem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of suggestions:
- We should definitely limit / batch the query. This could yield millions of entries on the first run for all we know 🤷🏻♂️
- Using the
mock_storagefixture, you could assert the actual side effect of files being removed from the storage backend, instead of manually mocking very specificArchiveServicemethods
Otherwise this looks good, and the following are just "personal preference" suggestions:
- IMO, we should move core business logic out of the celery framework code. In this case this would mean having some free functions instead of all the logic being in
FlareCleanupTask.run_cron_task. This means you don’t even need thedb_sessionargument, as the code does not use sqlalchemy models, and it should make testing less awkward. - I’m personally not a fan of asserting log calls, but rather just the side effects we are aiming for: files being removed from storage, fields being cleared from the DB.
|
This PR includes changes to |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| # "kwargs": { | ||
| # "cron_task_generation_time_iso": BeatLazyFunc(get_utc_now_as_iso_format) | ||
| # }, | ||
| # }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to test manually before I add this to the nightly cron jobs
michelletran-sentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM
|
This PR includes changes to |
New strategy for managing
flarestoragedepends on codecov/shared#450
When a
pullis no longerOPEN, leave theflarein order to reduce locks and wait time.During low traffic hours (4am UTC?), run this task to clear it out of our database and Archive storage.
So we won't pay for maintaining the
flarefield but also won't slow down otherpullactions by checking or clearing the field 🎉