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).
Multi-value
release.packagefilters on the Project Details page fail with anInvalidSearchQueryerror. Single-value filters work correctly. This regressed in Oct 2024 when theSearchQueryBuilderwas rolled out to all users on the Projects page.Root cause
semver_package_filter_converterinsrc/sentry/search/events/datasets/filter_aliases.py(used by the Project Details query builder path) only handles a single string value:When the user selects multiple values,
SearchQueryBuilderemits bracket notation (release.package:[foo,bar]), makingraw_valuea list — which hits theisinstanceguard and raises. The same gap exists insrc/sentry/search/eap/spans/filter_aliases.py.Why the fix is incomplete
PR #77318 (Sep 11, 2024) fixed multi-value
release.packagefor the Issues search path (src/sentry/search/events/filter.py) but did not update the equivalent converter infilter_aliases.pyused by the Project Details page.Regression timeline
SmartSearchBar→SearchQueryBuilderbehind a feature flag. New component enables bracket multi-value selection; backend not updated.release.packagein Issues search (filter.py) — Projects page path missed.SearchQueryBuilderon Project Details, exposing the error for everyone.Suggested fix
Update
semver_package_filter_converterin bothfilter_aliases.pyfiles to handle list values — iterate over each package, union the resulting release version sets, and return a singleOp.INcondition. Thefilter_by_semverORM helper already supportspackage__in(added in #77318).