-
-
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
Conversation
@@ -168,6 +168,8 @@ class OrganizationGroupIndexEndpoint(OrganizationEventsEndpointBase): | |||
}, |
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.
need to figure out where to add tests
This issue 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 remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
2494d96
to
dfd94d7
Compare
Codecov Report
@@ Coverage Diff @@
## master #57528 +/- ##
==========================================
- Coverage 81.03% 80.76% -0.28%
==========================================
Files 5492 5164 -328
Lines 234889 226125 -8764
Branches 38019 38056 +37
==========================================
- Hits 190348 182626 -7722
+ Misses 42503 37958 -4545
- Partials 2038 5541 +3503
|
if referrer != "api.feedback_index": | ||
category_ids.discard(GroupCategory.FEEDBACK.value) |
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.
While we are here can we also apply the inverse:
If the referrer is feedback, replace any categories and ensure GroupCategory.FEEDBACK
is present and the only value set.
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 can follow up with this -- probably want to slightly reorganize how we're doing this.
@@ -182,7 +189,7 @@ def _search( | |||
query_kwargs.pop("sort_by") | |||
result = inbox_search(**query_kwargs) | |||
else: | |||
query_kwargs["referrer"] = "search.group_index" | |||
query_kwargs["referrer"] = referrer |
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
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.
Overall looks good, left one comment/question about the referrer approach
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 comment
The 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 comment
The 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 comment
The 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 comment
The 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 comment
The 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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Optional
if it's to accept None
as a default value
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 comment
The 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.
I'll go ahead and close this, not happy w/ how hacky it feels. thanks for reviews folks. will follow up with something better. |
…59505) Previously: #57528 Instead of trying to control the display of feedbacks, lets just hide them by default unless they are filtered on. Aspirationally, we'd like to eventually have our own feedbacks endpoint that only displays feedbacks, and have feedbacks hidden from issues search entirely, but I do not see a good way of doing this without it being either extremely hacky, or a lot of work.
ref: https://github.com/getsentry/team-replay/issues/227
referrer
to organization_issues_search endpoint