Skip to content

Conversation

@cfsmp3
Copy link
Contributor

@cfsmp3 cfsmp3 commented Dec 28, 2025

Summary

  • Adds Celery task queue infrastructure for event-driven test processing
  • Replaces polling-based approach with async task execution
  • Fixes isort import ordering

Note: This is a clean re-submission of #963, which was merged and then reverted because it included unrelated commits. This PR contains only the Celery-related changes.

Test plan

  • Verify Celery worker starts correctly
  • Test that tasks are queued and processed
  • Confirm no regressions in existing test flow

🤖 Generated with Claude Code

cfsmp3 and others added 2 commits December 28, 2025 15:03
Replace cron-based polling with an optional Celery task queue system
for faster, more reliable test execution. This architectural improvement
enables event-driven processing, parallel test execution, and better
retry handling.

New files:
- celery_app.py: Celery application factory with Flask context
- mod_ci/tasks.py: Task definitions (start_test, cleanup, pending check)
- install/celery-worker.service: Systemd service for Celery worker
- install/celery-beat.service: Systemd service for Celery beat scheduler
- tests/test_ci/test_tasks.py: Unit tests for Celery functionality

Modified files:
- requirements.txt: Added celery[redis] and redis packages
- config_sample.py: Added Celery configuration options
- mod_ci/controllers.py: Added trigger_test_tasks(), updated add_test_entry()
- install/installation.md: Added Celery setup documentation

Key features:
- USE_CELERY_TASKS feature flag for gradual migration (default: False)
- Parallel mode: cron continues as fallback during transition
- Three task queues: default, test_execution, maintenance
- Periodic tasks via Celery Beat for cleanup and pending test discovery
- Graceful degradation if Celery unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused 'shared_task' import from celery
- Fix import ordering to satisfy isort checks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link

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