Repository navigation
Conversation
87e8566 to
b255042
Compare
4a78323 to
d5fc207
Compare
Sentry Snapshot Testing
|
d5fc207 to
8c2ff58
Compare
73db373 to
e48baa7
Compare
|
No findings on the latest commit. |
09c4af6 to
3355be7
Compare
d7bbafc to
d074324
Compare
saponifi3d
left a comment
There was a problem hiding this comment.
I think we could probably reduce the number of queries / lookups dicts being built between get_eligible_action_workflows and filter_recently_fired_workflow_actions.
as a follow-up we'll probably want to introduce some caching layers here as well, so we don't have to do these queries for each time we want to trigger an action.
| action_to_workflows_ids = get_eligible_action_workflows(filtered_action_groups, event_data) | ||
|
|
||
| actions_queryset = Action.objects.filter(id__in=list(action_to_workflows_ids.keys())) |
There was a problem hiding this comment.
It looks like this is querying into the actions table twice, once in get_eligible_action_workflows and then again on the Action.objects.filter -- is that needed? could we do this with a single query?
There was a problem hiding this comment.
yeah, good catch. changed this to be a single query in get_eligible_actions and then reused
| active_actions = Action.objects.filter( | ||
| id__in={action_id for action_id, _, _ in associations}, status=ObjectStatus.ACTIVE | ||
| ) | ||
| # Inactive actions count towards frequency and history, but may have retired handler types. | ||
| unsupported_action_ids = {action.id for action in active_actions} - { | ||
| action.id for action in get_supported_actions(active_actions, event_data) | ||
| } |
There was a problem hiding this comment.
🤔 could get_supported_actions return the supported / unsupported actions in a tuple or something for us? that way it could all be handled within that helper (in the future, it'd be easier to add any caching etc that might be needed)
There was a problem hiding this comment.
i ended up making a separate _action_supports_event helper which i think adding caching to later should be easy
| "condition_group__workflowdataconditiongroup__workflow_id", | ||
| "condition_group__workflowdataconditiongroup__workflow__config", | ||
| ) | ||
| active_actions = Action.objects.filter( |
There was a problem hiding this comment.
should there be a cache for these actions? it is pretty unlikely to change the configuration on the workflow would change (relative to the number of evaluations), and when it does we can bust the cache and have it be a read-through.
there's already a cache directory in workflow engine that should make that a lot easier to implement (probably should be a separate PR after this one though).
There was a problem hiding this comment.
yeah, agreed this makes sense to cache. will do this as a follow-up: https://linear.app/getsentry/issue/ISWF-3860/cache-action-eligibility-lookups-in-workflow-action-processing
| WorkflowActionGroupStatus objects. | ||
| """ | ||
|
|
||
| action_to_workflows_ids = get_eligible_action_workflows(filtered_action_groups, event_data) |
There was a problem hiding this comment.
maybe instead of get_eligible_action_workflows, it could be get_eligible_actions and then have this return the actions (since it has to query for them already)? The name starting with get_ gives me the initial expectation that there will be an Action as a result of this method.
it also looks like this is re-building the same dict in the result here for action_to_workflow_id.
There was a problem hiding this comment.
good point. made get_eligible_actions the entrypoint (replacing filter_recently_fired_workflow_actions) returning the loaded actions + their workflow attributions
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Keep alert throttling per workflow/action association and record history only for eligible workflows. Refs ISWF-3705
Refs ISWF-3705
Exercise group-less eligibility with an unrestricted handler instead of setting the removed capability flag. Refs ISWF-3705
Keep the frequency and history contracts concise and remove unused fixture state. Refs ISWF-3705
Reject unsupported actions before writing group frequency state so a later supported event can still fire. Refs ISWF-3705
Reuse the alert scenarios for Seer suppression and exclusion from group-less evaluations. Refs ISWF-3705
Require callers to provide evaluated workflow eligibility while retaining organization-scoped history filtering. Refs ISWF-3705
Describe event validation before frequency and history, and Inbox-only eligibility without a group. Refs ISWF-3705
Skip per-group status for zero and omitted intervals, validate actions before throttling, and select group-less activity workflows by source. Move shared-action fire-history attribution into its independent fix.
Activity processing requires a group before workflow selection. Keep the group-less frequency rule in action eligibility and document when it uses group status. Refs ISWF-3705
…ions Keep inactive actions eligible for history and throttling while skipping their handlers. Validate active actions before throttling and again at dispatch if their status has changed. Treat a stored null frequency as zero and cover eligibility with frequency-based fixtures. Refs ISWF-3705
Read action type and status alongside workflow associations, then load eligible actions once. Deduplicate the loaded actions in memory and keep the last action for each key. Refs ISWF-3705
ccdf440 to
89b03ef
Compare
Refs https://linear.app/getsentry/issue/ISWF-3705/support-group-less-action-invocation-and-inbox-frequency-semantics.
Apply each workflow’s configured repeat interval to each eligible workflow/action pair. An explicit zero or omitted frequency skips per-group status reads and writes for all workflow types, including Inbox, alert, and Seer workflows. This prevents an insert conflict on the first status row from suppressing one of two concurrent evaluations when no interval is configured. If a workflow later enables a positive interval, its throttle uses any status left over from an earlier positive interval.
Positive intervals retain existing per-group suppression and insert-conflict handling. An eligible action without a group skips per-group state. Handler validation precedes throttling, and equivalent actions still dispatch once per evaluation.
https://app.notion.com/p/sentry/Investigation-Events-Workflow-Engine-40c8b10e4b5d80d18c4ed6c802d55d64