Skip to content

Add workflow DSL, triggers, validators, and scheduling - #1

Merged
zewelor merged 3 commits into
mainfrom
trigger_dsl
Mar 16, 2026
Merged

Add workflow DSL, triggers, validators, and scheduling#1
zewelor merged 3 commits into
mainfrom
trigger_dsl

Conversation

@zewelor

@zewelor zewelor commented Mar 16, 2026

Copy link
Copy Markdown
Contributor
  • 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

- 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
@zewelor

zewelor commented Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

@codex please reveiw this.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread lib/r3x/triggers/schedule.rb Outdated
end

def validate!
unless cron

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread lib/r3x/triggers/rss.rb Outdated
zewelor added 2 commits March 16, 2026 10:38
- 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
@zewelor
zewelor merged commit b5f015b into main Mar 16, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +8 to +9
schedule = workflow_class.schedule_trigger
next unless schedule

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@zewelor
zewelor deleted the trigger_dsl branch April 2, 2026 06:57
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.

1 participant