Final commit of scheduler module into openvair#302
Open
rustamhse wants to merge 7 commits intoAerodisk:mainfrom
Open
Final commit of scheduler module into openvair#302rustamhse wants to merge 7 commits intoAerodisk:mainfrom
rustamhse wants to merge 7 commits intoAerodisk:mainfrom
Conversation
fix secret references
…-workflow Feature/tg notifications workflow
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.
🚀 Description
This Merge Request introduces the Scheduler module to the OpenVair platform. It provides a centralized, robust, and safe mechanism for scheduling, managing, and monitoring periodic tasks (cron jobs) across the system.
By integrating directly with the host operating system's crontab, it allows users to automate background processes seamlessly via the OpenVair API/UI, while ensuring the database state always remains in sync with the actual OS.
✨ Key Features
Full CRUD Operations: Create, Read (List/Single), Update, and Delete scheduled jobs. It securely modifies the system crontab using the python-crontab library and includes a background monitoring task (@periodic_task) that periodically parses the OS crontab, synchronizes the last_run and next_run timestamps, and handles orphaned or manually tampered jobs.Strict Pydantic validation for cron expressions and commands are also presented.
🏗️ Architecture & Technical Details
The module strictly follows the project's Domain-Driven Design (DDD) standards:
🧪 Testing & QA
Extensive unit testing of the CronJobScheduler with fully mocked CronTab contexts to guarantee safe execution in CI/CD environments without altering the host OS. Complete coverage of FastAPI endpoints and Service Layer logic using pytest-mock. The entire module is strictly typed and fully compliant with project standards (mypy and strict ruff configurations, including ANN, BLE, and E501).