Repository navigation
fix(sunset): pause hosted recurring user work - #2020
Conversation
|
@sb123sb123 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
What
Why
The HTTP write-block middleware does not stop Celery Beat from starting recurring user work during the hosted export-only period.
Fixes #2005
How to test
ruff checkon the five changed Python files - passed.python -m py_compileon the five changed Python files - passed.python scripts/check_docs.py docs/architecture/sunset.md- passed.python -m pytest tests/unit/test_sunset_scheduled_tasks.py -q- attempted locally, but collection stops becausefastapi_usersis not installed in the remote environment; please let CI run the test with project dependencies.High-level PR Summary
This PR pauses recurring user-facing scheduled tasks during the hosted sunset mode (export-only period) by adding sunset-mode checks to four Celery Beat tasks: connector schedule checks, scheduled automation selection, knowledge-store reindex sweeps, and drift checks. The Beat entries remain registered to preserve behavior when sunset mode is off or on self-hosted deployments. The changes include comprehensive parameterized tests covering sunset-on, sunset-off, and self-hosted configurations, plus documentation updates explaining which maintenance tasks continue during wind-down.
⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
docs/architecture/sunset.mdsurfsense_backend/app/sunset.pysurfsense_backend/app/tasks/celery_tasks/schedule_checker_task.pysurfsense_backend/app/automations/triggers/builtin/schedule/selector.pysurfsense_backend/app/tasks/celery_tasks/knowledge_store/index_tasks.pysurfsense_backend/app/tasks/celery_tasks/knowledge_store/drift_monitor_task.pysurfsense_backend/tests/unit/test_sunset_scheduled_tasks.py