fix: emit workflow.submitted on run submission - #536
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesWorkflow submission events
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant QueueWorkflowMixin
participant EventBus
participant SubWorkflowTracker
Caller->>QueueWorkflowMixin: submit_workflow()
QueueWorkflowMixin->>EventBus: emit WORKFLOW_SUBMITTED with run_id and workflow_name
SubWorkflowTracker->>EventBus: emit WORKFLOW_SUBMITTED with child_run_id and parent_run_id
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sdks/python/taskito/workflows/mixins.py`:
- Around line 94-98: Guard the _emit_event call in _inner.submit_workflow with
the same exception-handling pattern used by submit_sub_workflow, logging
delivery failures while allowing tracker.register_run() and the run-handle
return to proceed unchanged.
In `@sdks/python/tests/workflows/test_workflows_subworkflow.py`:
- Around line 75-87: Update the subworkflow event test around the
WORKFLOW_SUBMITTED listener to use a threading.Event that the callback sets
after appending the payload, then wait for that event after run.wait() and
before filtering or asserting child_events. Preserve the existing event
filtering and assertions, following the synchronization pattern used by the
linear submission-event test.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f99e0469-721d-4cef-b316-1385962cc56d
📒 Files selected for processing (5)
docs/content/docs/python/guides/extensibility/events-webhooks.mdxsdks/python/taskito/workflows/mixins.pysdks/python/taskito/workflows/tracker/sub_workflows.pysdks/python/tests/workflows/test_workflows_linear.pysdks/python/tests/workflows/test_workflows_subworkflow.py
EventType.WORKFLOW_SUBMITTEDwas defined but never emitted. It now fires fromsubmit_workflowwith{run_id, workflow_name}, and from sub-workflow submission withparent_run_idadded.Also fixes the events guide: worker event payload fields corrected (
worker_id/queues, nothostname) and the workflow/saga/predicate events added to the payload table.Regression tests: submit emits the event without a worker; child submission carries
parent_run_id.Part of #535.
Summary by CodeRabbit
New Features
WORKFLOW_SUBMITTEDevents for queued workflows and child workflows.Documentation