Feature: Move Tome schedule configuration to new ScheduledTask ent#2072
Feature: Move Tome schedule configuration to new ScheduledTask ent#2072
Conversation
- Added `ScheduledTask` Ent schema with `run_on_new_beacon_callback`, `run_on_first_host_callback`, and `run_on_schedule` fields, linking to `Tome` and `Host` (`scheduled_hosts`). - Removed scheduling fields and edges from `Tome`. - Auto-generated corresponding GraphQL mutation and queries via Ent hooks. - Updated `handleTomeAutomation` logic to iterate over `ScheduledTask`s instead of `Tome`s directly during agent check-ins. - Refactored C2 tests to accurately use the new `ScheduledTask` relationships. Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
Previous Results
Insights
Slowest Tests
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
- Added `ScheduledTask` Ent schema with `run_on_new_beacon_callback`, `run_on_first_host_callback`, and `run_on_schedule` fields, linking to `Tome` and `Host` (`scheduled_hosts`). - Removed scheduling fields and edges from `Tome`. - Auto-generated corresponding GraphQL mutation and queries via Ent hooks. - Updated `handleTomeAutomation` logic to iterate over `ScheduledTask`s instead of `Tome`s directly during agent check-ins. - Refactored C2 tests to accurately use the new `ScheduledTask` relationships. Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
Following up on PR feedback to improve efficiency, the check to match `ScheduledTask`s to `scheduled_hosts` (if specified) has been pushed down into the initial SQL query rather than fetching all potential tasks and checking the DB manually inside a loop. Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
This implements the requested feature to decouple scheduled execution and automation triggers from the
Tomeitself by moving them into a dedicatedScheduledTaskentity.This update enhances the accessibility of the scheduling features via GraphQL, simplifying automation management for end users. The C2 check-in logic (
handleTomeAutomation) has been successfully ported over to look atScheduledTasks, and the automated tests have been updated accordingly.PR created automatically by Jules for task 12776578495355315753 started by @hulto