Skip to content

Add change-detection and trigger registry (#8) - #9

Merged
zewelor merged 2 commits into
mainfrom
networking-guard
Mar 20, 2026
Merged

Add change-detection and trigger registry (#8)#9
zewelor merged 2 commits into
mainfrom
networking-guard

Conversation

@zewelor

@zewelor zewelor commented Mar 20, 2026

Copy link
Copy Markdown
Contributor
  • Add change-detection and trigger registry
  • Add ChangeDetectionJob and TriggerState model with migration
  • Introduce TriggerCollection and stable trigger unique_key values
  • Add ChangeDetecting concern for detector triggers and scheduler support
  • Have RecurringTasksConfig schedule ChangeDetectionJob for detectors
  • Make RunWorkflowJob accept trigger_key and payload; pass payload to workflow
  • Add tests and fake trigger; update schema, docs, HTTP client, and add pg gem
  • Update app/models/r3x/trigger_state.rb

  • Remove HTTP/Discord helpers from WorkflowContext

  • Remove fetch_body, discord_output, and http_client methods.
  • Change made in lib/r3x/workflow_context.rb.
  • Reduce hidden dependencies and side effects in the context.
  • Encourage injection of HTTP clients/outputs for testability.
  • Make enqueueing atomic for change detection
  • Make trigger state update and job enqueue atomic in ChangeDetectionJob
  • Add argument normalization to RunWorkflowJob and ChangeDetectionJob
  • Add test that simulates enqueue failure and preserves trigger state
  • Adjust test payload expectation to use symbolized keys
  • Update AGENTS.md to document Solid Queue transactional behavior

* Add change-detection and trigger registry

- Add ChangeDetectionJob and TriggerState model with migration
- Introduce TriggerCollection and stable trigger `unique_key` values
- Add ChangeDetecting concern for detector triggers and scheduler support
- Have RecurringTasksConfig schedule ChangeDetectionJob for detectors
- Make RunWorkflowJob accept `trigger_key` and payload; pass payload to workflow
- Add tests and fake trigger; update schema, docs, HTTP client, and add pg gem

* Update app/models/r3x/trigger_state.rb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove HTTP/Discord helpers from WorkflowContext

- Remove fetch_body, discord_output, and http_client methods.
- Change made in `lib/r3x/workflow_context.rb`.
- Reduce hidden dependencies and side effects in the context.
- Encourage injection of HTTP clients/outputs for testability.

* Make enqueueing atomic for change detection

- Make trigger state update and job enqueue atomic in ChangeDetectionJob
- Add argument normalization to RunWorkflowJob and ChangeDetectionJob
- Add test that simulates enqueue failure and preserves trigger state
- Adjust test payload expectation to use symbolized keys
- Update AGENTS.md to document Solid Queue transactional behavior

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@zewelor
zewelor merged commit 8b2c276 into main Mar 20, 2026
3 checks passed
@zewelor
zewelor deleted the networking-guard branch March 20, 2026 10:28
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