Add workflow DSL, triggers, validators, and scheduling - #1
Conversation
- Introduce `R3x::Workflow` DSL and trigger system (schedule, rss) - Add trigger base, `TriggeredBy`, and validators for cron & URL - Generate recurring tasks from workflows via `RecurringTasksConfig` - Pass `triggered_by` into `RunWorkflowJob` and `WorkflowContext` - Add `mission_control-jobs`, mount `/jobs`, and update `config/recurring.yml` - Add tests for workflows, triggers, validators, recurring tasks, and job
|
@codex please reveiw this. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d903129253
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| end | ||
|
|
||
| def validate! | ||
| unless cron |
There was a problem hiding this comment.
Reject blank cron strings for schedule triggers
Schedule#validate! only checks unless cron, so an empty string passes as “present”, and Validators::Cron.validate! then returns early for empty values. This allows trigger :schedule, cron: "" to be registered and emitted into recurring task config with an invalid schedule, which can prevent scheduled execution once Solid Queue parses it. Treat blank cron values as invalid at validation time.
Useful? React with 👍 / 👎.
- Add `R3x::Triggers` (lib/r3x/triggers.rb) for trigger lookup - Use `Triggers.resolve` in `Workflow` to remove duplicated logic - Remove Workflow's trigger listing and resolution methods - Update tests to use `R3x::Triggers.supported_types` and rename test - Centralize trigger loading for clearer autoloading and errors
- Modify `lib/r3x/triggers/rss.rb` to reject nil or empty `url` - Modify `lib/r3x/triggers/schedule.rb` to reject nil or empty `cron` - Add tests in `test/lib/r3x/workflow_test.rb` for blank url/cron - Prevent workflows from accepting `''` values that previously bypassed checks
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d554dbec92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| schedule = workflow_class.schedule_trigger | ||
| next unless schedule |
There was a problem hiding this comment.
Include RSS triggers when building recurring tasks
to_h currently gates every workflow on schedule_trigger and skips it otherwise, so workflows configured with trigger :rss never get a recurring task entry at all. In this commit, rss_triggers is defined and validated but not consumed by any scheduler path, so RSS-triggered workflows will not execute automatically in production despite being accepted by the DSL.
Useful? React with 👍 / 👎.
R3x::WorkflowDSL and trigger system (schedule, rss)TriggeredBy, and validators for cron & URLRecurringTasksConfigtriggered_byintoRunWorkflowJobandWorkflowContextmission_control-jobs, mount/jobs, and updateconfig/recurring.yml