Skip to content

fix(sunset): pause hosted recurring user work - #2020

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
sb123sb123:fix/2005-sunset-scheduled-work
Sep 29, 2026
Merged

MODSetter merged 1 commit into
MODSetter:devfrom
sb123sb123:fix/2005-sunset-scheduled-work

Conversation

@sb123sb123

@sb123sb123 sb123sb123 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Skip connector schedule checks, scheduled automation selection, knowledge-store reindex sweeps and drift checks while hosted sunset mode is active.
  • Keep the Beat entries registered so sunset-off and self-hosted behavior stays unchanged; document the maintenance tasks that continue through the wind-down.
  • Add parameterized tests for sunset-on, sunset-off and self-hosted configurations.

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 check on the five changed Python files - passed.
  • python -m py_compile on 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 because fastapi_users is 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
Order File Path
1 docs/architecture/sunset.md
2 surfsense_backend/app/sunset.py
3 surfsense_backend/app/tasks/celery_tasks/schedule_checker_task.py
4 surfsense_backend/app/automations/triggers/builtin/schedule/selector.py
5 surfsense_backend/app/tasks/celery_tasks/knowledge_store/index_tasks.py
6 surfsense_backend/app/tasks/celery_tasks/knowledge_store/drift_monitor_task.py
7 surfsense_backend/tests/unit/test_sunset_scheduled_tasks.py

Need help? Join our Discord

@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e5b227ed-615b-448c-8ab9-2baa86433816

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MODSetter
MODSetter merged commit d991279 into MODSetter:dev Sep 29, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants