Skip to content

bug(search): multi-value release.package filter fails on Project Details #118568

Description

@gywright

Multi-value release.package filters on the Project Details page fail with an InvalidSearchQuery error. Single-value filters work correctly. This regressed in Oct 2024 when the SearchQueryBuilder was rolled out to all users on the Projects page.

Root cause

semver_package_filter_converter in src/sentry/search/events/datasets/filter_aliases.py (used by the Project Details query builder path) only handles a single string value:

raw_value = search_filter.value.raw_value
if not isinstance(raw_value, str):
    raise InvalidSearchQuery("Invalid value for semver package filter")

When the user selects multiple values, SearchQueryBuilder emits bracket notation (release.package:[foo,bar]), making raw_value a list — which hits the isinstance guard and raises. The same gap exists in src/sentry/search/eap/spans/filter_aliases.py.

Why the fix is incomplete

PR #77318 (Sep 11, 2024) fixed multi-value release.package for the Issues search path (src/sentry/search/events/filter.py) but did not update the equivalent converter in filter_aliases.py used by the Project Details page.

Regression timeline

Suggested fix

Update semver_package_filter_converter in both filter_aliases.py files to handle list values — iterate over each package, union the resulting release version sets, and return a single Op.IN condition. The filter_by_semver ORM helper already supports package__in (added in #77318).

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Support

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions