Skip to content

fix(incidents): Handle None target_type in workflow engine action serializer#119479

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix-none-action-target-serializer
Open

fix(incidents): Handle None target_type in workflow engine action serializer#119479
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix-none-action-target-serializer

Conversation

@sentry

@sentry sentry Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor
This PR fixes a `ValueError: None is not a valid ActionTarget` that occurs when serializing `Action` objects within the workflow engine. The error happens because `obj.config.get("target_type")` can return `None` if the `target_type` key is missing from an Action's config. This `None` value is then passed directly to the `ActionTarget` enum constructor, which raises a `ValueError`.

The fix involves:

  1. Updating the type annotation for target_type to int | None to accurately reflect its possible value.
  2. Adding a None guard before calling ActionTarget(target_type) in the serializer. If target_type is None, the targetType field in the serialized output will also be None, preventing the ValueError.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes SENTRY-5NQG

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@sentry sentry Bot requested a review from a team as a code owner July 12, 2026 22:40
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants