Skip to content

feat(async): Add django-q2 with ORM broker and demo job#161

Merged
taylor-osler-sentry merged 18 commits into
mainfrom
feat/async
May 13, 2026
Merged

feat(async): Add django-q2 with ORM broker and demo job#161
taylor-osler-sentry merged 18 commits into
mainfrom
feat/async

Conversation

@taylor-osler-sentry
Copy link
Copy Markdown
Contributor

@taylor-osler-sentry taylor-osler-sentry commented Apr 30, 2026

Summary

  • Adds django-q2 as a dependency and configures it with the ORM broker (backed by the existing PostgreSQL default database)
  • Introduces firetower.incidents.tasks.schedule_demo as the first queue task
  • Introduces a wrapped_worker command that starts the cluster worker with health checking
    • Note: this requires django-cache, which is also set up in this PR
  • Includes datadog function wrapper for metrics

Test plan

  • Run python manage.py migrate — confirm 0016_schedule_demo applies cleanly and a schedule_demo row appears in django_q_schedule
  • Run python manage.py wrapped_worker — confirm the worker starts and picks up the scheduled task
  • Run docker/entrypoint.sh migrate — confirm the container runs the cache table migration as well
  • Run docker/entrypoint.sh worker — confirm the container starts the qcluster process

🤖 Generated with Claude Code

@taylor-osler-sentry taylor-osler-sentry requested a review from a team as a code owner April 30, 2026 21:53
@taylor-osler-sentry taylor-osler-sentry marked this pull request as draft April 30, 2026 21:53
Comment thread src/firetower/settings.py Outdated
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 30, 2026

Comment thread src/firetower/incidents/apps.py Outdated
Comment thread src/firetower/incidents/tasks.py Outdated
Comment thread src/firetower/incidents/tasks.py Outdated
Comment thread src/firetower/settings.py
Comment thread src/firetower/settings.py Outdated
@taylor-osler-sentry taylor-osler-sentry changed the title feat(async): Add django-q2 with ORM broker and schedule_slo_nag job feat(async): Add django-q2 with ORM broker and demo job May 5, 2026
@taylor-osler-sentry taylor-osler-sentry marked this pull request as ready for review May 5, 2026 21:43
Comment thread src/firetower/incidents/migrations/0016_schedule_demo.py
Comment thread docker/entrypoint.sh
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py Outdated
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py Outdated
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py Outdated
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/tasks.py Outdated
Comment thread src/firetower/incidents/migrations/0016_schedule_demo.py
Comment thread src/firetower/incidents/tasks.py
Comment thread src/firetower/incidents/tasks.py
Comment thread src/firetower/incidents/tasks.py
Comment thread src/firetower/incidents/tasks.py
Comment thread src/firetower/incidents/tasks.py Outdated
Comment thread src/firetower/incidents/tasks.py
Comment thread src/firetower/incidents/management/commands/wrapped_worker.py
Comment thread src/firetower/incidents/tests/test_tasks.py Outdated
Comment thread src/firetower/incidents/tasks.py
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1cca0d2. Configure here.

logger.error(
f"Error while executing task '{task_name}': {e}", exc_info=True
)
raise e
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise e corrupts traceback in decorator wrapper

Low Severity

Using raise e instead of bare raise in the datadog_log exception handler adds an extra frame to the traceback, making it appear the exception originated from the decorator wrapper rather than the actual task function. This makes debugging task failures harder since the traceback points to the wrong location.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1cca0d2. Configure here.

@taylor-osler-sentry taylor-osler-sentry merged commit 2b578da into main May 13, 2026
30 checks passed
@taylor-osler-sentry taylor-osler-sentry deleted the feat/async branch May 13, 2026 19:34
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