-
-
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(feedback): ignore feedbacks in issue search #57528
Changes from all commits
dfd94d7
da29ba1
32ef7fd
4f42cca
42e519c
79ceb6f
42ea00f
9e1e886
3c1c023
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,6 +211,7 @@ def _query_params_for_generic( | |
conditions: Sequence[Any], | ||
actor: Optional[Any] = None, | ||
categories: Optional[Sequence[GroupCategory]] = None, | ||
referrer: str = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: |
||
) -> Optional[SnubaQueryParams]: | ||
organization = Organization.objects.filter(id=organization_id).first() | ||
if organization and features.has( | ||
|
@@ -219,8 +220,9 @@ def _query_params_for_generic( | |
if categories is None: | ||
logging.error("Category is required in _query_params_for_generic") | ||
return None | ||
|
||
category_ids = {gc.value for gc in categories} | ||
if referrer != "api.feedback_index": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there other places in the codebase where we change behavior based on the referrer? To me it's a bit unexpected and I think I'd prefer a more explicit way of telling this code path you either do or don't want feedbacks. But if this is something we do elsewhere then this is fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think ideally we'd have a separate endpoint that only queried feedbacks, and feedbacks by default are hidden in this endpoint. This would allow us to remove all of the referrer based behavior here. I'm not sure if we modify behavior by referrer elsewhere. I agree that it is a bit weird -- I can attempt some refactors and making a separate endpoint as a follow up and then remove the referrer logic here -- what do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The followup with separate endpoints sounds like a great solution to me! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay sounds good! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on this feeling awkward, I'd rather see that as a specific param or different endpoint path. |
||
category_ids.discard(GroupCategory.FEEDBACK.value) | ||
Comment on lines
+224
to
+225
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we are here can we also apply the inverse: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can follow up with this -- probably want to slightly reorganize how we're doing this. |
||
group_types = { | ||
gt.type_id | ||
for gt in grouptype.registry.get_visible(organization, actor) | ||
|
@@ -248,13 +250,15 @@ def _query_params_for_generic( | |
return None | ||
|
||
|
||
def get_search_strategies() -> Mapping[int, GroupSearchStrategy]: | ||
def get_search_strategies(referrer: str) -> Mapping[int, GroupSearchStrategy]: | ||
strategies = {} | ||
for group_category in GroupCategory: | ||
if group_category == GroupCategory.ERROR: | ||
strategy = _query_params_for_error | ||
else: | ||
strategy = functools.partial(_query_params_for_generic, categories=[group_category]) | ||
strategy = functools.partial( | ||
_query_params_for_generic, categories=[group_category], referrer=referrer | ||
) | ||
strategies[group_category.value] = strategy | ||
return strategies | ||
|
||
|
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.
Should we default to
DEFAULT_REFERRER
here too?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.
referrer will always be passed in and defined here -- the default is set in the callers