Conversation
db283e9 to
9f87568
Compare
kaapstorm
commented
Apr 13, 2026
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ('exports', '0024_exportconfig_days_of_week_and_more'), | ||
| ('django_celery_beat', '__latest__'), |
Contributor
Author
There was a problem hiding this comment.
This line ensures that all django-celery-beat migrations have run. This migration creates IntervalSchedule and PeriodicTask objects, so django-celery-beat's tables need to exist already.
kaapstorm
commented
Apr 14, 2026
jingcheng16
reviewed
Apr 14, 2026
9f87568 to
7664e81
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
exports.0025 is a data migration that calls apps.get_model(), which triggers StateApps.__init__ -> _check_lazy_references(). Without explicit dependencies on forwarding.0002_update_database_fk and refreshes.0002_update_database_fk, the migration plan could apply exports.0025 before those fixup migrations. At that point the state still has the old 'exports.exportdatabase' FK targets (from the 0001_initial migrations) while exports.0021 has already removed ExportDatabase, causing a lazy-reference validation error in CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also removes these fields from export forms and admin list_filter since they are no longer database columns (is_paused is now a property from ScheduleMixin). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the run_all_exports polling pattern from celery.py and scheduling.py. Each ExportConfig and MultiProjectExportConfig now gets its own celery-beat PeriodicTask via ScheduleMixin signals. The run_export_task and run_multi_project_export_task no longer accept ignore_schedule_checks since scheduling is handled by celery-beat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tests verifying: - Interval schedule creates PeriodicTask on save (via signals) - Export without schedule has is_paused == True - has_queued_runs() detects QUEUED status correctly - Deleting export cleans up its PeriodicTask Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove bind=True from run_scheduled_export_task and run_scheduled_multi_export_task — self was never used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If an export is deleted between beat scheduling the task and a worker picking it up, the task now logs a warning and returns cleanly rather than crashing with an unhandled exception. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eliminate the duplicated has_queued_runs / ExportRun.create / next_task.delay logic shared by both celery-beat entry points. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ExportConfigBase.details_url used isinstance() to dispatch on its own concrete subclasses, coupling the base class to all its descendants. Replace with an abstract property on the base and concrete overrides on ExportConfig and MultiProjectExportConfig. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7664e81 to
19abec7
Compare
Contributor
Author
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.
Exports allow users to schedule export runs every N minutes.
Data forwarding and scheduled refreshes use
ScheduleMixinto schedule runs. They can do what export schedules can, and a lot more.This PR migrates exports to use the same scheduling as data forwarding and scheduled refreshes.