feat(async): Add django-q2 with ORM broker and demo job#161
feat(async): Add django-q2 with ORM broker and demo job#161taylor-osler-sentry wants to merge 4 commits intomainfrom
Conversation
fd2ee83 to
4b2ca8e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit eca2c31. Configure here.
| @@ -0,0 +1,28 @@ | |||
| from django.db import migrations | |||
|
|
|||
| from firetower.incidents.tasks import SCHEDULES | |||
There was a problem hiding this comment.
Migration imports mutable runtime code from tasks module
Medium Severity
The migration imports SCHEDULES from firetower.incidents.tasks at module level, coupling it to mutable runtime code. If SCHEDULES is ever renamed, restructured, or the "schedule_demo" key is removed, this migration will break on any fresh database. Additionally, importing tasks.py triggers from firetower.incidents.models import Incident, pulling in the live model class rather than the historical version — and any future import-time side effects in tasks.py will also fire during migration. The schedule data (func, schedule_type, minutes, repeats) can be inlined directly in the migration to keep it self-contained.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit eca2c31. Configure here.


Summary
django-q2as a dependency and configures it with the ORM broker (backed by the existing PostgreSQLdefaultdatabase)firetower.incidents.tasks.schedule_demoas the first queue task (stub that prints "hello world"), registered via a data migrationdocker/entrypoint.shwith aworkercommand that startsqcluster, and refactors all branches to useexecfor proper signal handling in DockerTest plan
python manage.py migrate— confirm0015_schedule_demoapplies cleanly and aschedule_slo_nagrow appears indjango_q_schedulepython manage.py qcluster— confirm the worker starts and picks up the scheduled taskdocker/entrypoint.sh worker— confirm the container starts the qcluster processmigrate incidents 0014) — confirm the schedule row is removed🤖 Generated with Claude Code