-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add FlareCleanupTask #947
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 |
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_storage
fixture, you could assert the actual side effect of files being removed from the storage backend, instead of manually mocking very specificArchiveService
methods
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_session
argument, 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.
8b57acf
to
5ac629e
Compare
This PR includes changes to |
5ac629e
to
044d770
Compare
❌ 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 |
044d770
to
dd60b72
Compare
# "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
1411c2a
to
65e6b35
Compare
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
65e6b35
to
20ccfb7
Compare
This PR includes changes to |
New strategy for managing
flare
storagedepends on codecov/shared#450
When a
pull
is no longerOPEN
, leave theflare
in 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
flare
field but also won't slow down otherpull
actions by checking or clearing the field 🎉