-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(issue-search): support IN for semver release search #76313
base: master
Are you sure you want to change the base?
Conversation
❌ 13 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
src/sentry/search/events/filter.py
Outdated
else: | ||
semver_filters = [] | ||
for v in version: | ||
_, versions = get_versions(v, operator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure get_versions
is necessary for IN
. Since in will just be doing exact matches, all the sorting junk that we do isn't really relevant.
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
82f152f
to
a6e3bef
Compare
support `in` for for release package for issues search. related (but this one is much easier): #76313
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
will be working on this, came up in triage duty again |
486f3a2
to
99fd141
Compare
# do our best. | ||
operator = constants.OPERATOR_NEGATION_MAP[operator] | ||
# Note that the `order_by` here is important for index usage. Postgres seems | ||
# to seq scan with this query if the `order_by` isn't included, so we | ||
# include it even though we don't really care about order for this query | ||
qs_flipped = ( | ||
Release.objects.filter_by_semver(organization_id, parse_semver(version, operator)) | ||
.order_by(*map(_flip_field_sort, order_by)) | ||
.values_list("version", flat=True)[: constants.MAX_SEARCH_RELEASES] | ||
) | ||
|
||
exclude_versions = list(qs_flipped) | ||
if exclude_versions and len(exclude_versions) < len(versions): | ||
# Do a negative search instead | ||
final_operator = Op.NOT_IN | ||
versions = exclude_versions | ||
exclude_versions = list(qs_flipped) | ||
if exclude_versions and len(exclude_versions) < len(versions): | ||
# Do a negative search instead | ||
final_operator = Op.NOT_IN | ||
versions = exclude_versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these lines are a codepath which i haven't changed, just the indentation makes it a diff, and codecov reports no coverage on these which causes the codecov to be low
@@ -80,16 +80,49 @@ def filter_by_semver_build( | |||
"release_id", flat=True | |||
) | |||
) | |||
if isinstance(build, str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if it would make sense to just do
if isinstance(build, str):
build = [build]
Then go down the IN path
Release.objects.filter_by_semver( | ||
organization_id, | ||
parse_semver(v, operator), | ||
project_ids=builder.params.project_ids, | ||
) | ||
.values_list("version", flat=True) | ||
.order_by(*order_by)[: constants.MAX_SEARCH_RELEASES] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're doing exact match here I guess we don't care about extra filtering logic in the single version branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i don't think its super necessary. i'll add a comment and monitor as we release, but i think because we're only doing matches, the extra filtering logic isn't as important.
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Don't close this PR while remaining unmerged! We are eagerly awaiting this improvement! 😊 |
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Another comment to keep this open. We are eagerly waiting for this feature! :) |
Fixes #76286
Fixes SENTRY-3HAA