Skip to content
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

Closed
wants to merge 9 commits into from

Conversation

JoshFerge
Copy link
Member

@JoshFerge JoshFerge commented Oct 4, 2023

  • We want to display feedbacks within the "Feedbacks" UI section, and have them be hidden in Issues. This PR makes it so issue search does not show them.

ref: https://github.com/getsentry/team-replay/issues/227

  • Adds a new query param referrer to organization_issues_search endpoint
  • We pass this referrer through search logic, and if the referrer is not feedback, then hide the feedbacks.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 4, 2023
@@ -168,6 +168,8 @@ class OrganizationGroupIndexEndpoint(OrganizationEventsEndpointBase):
},
Copy link
Member Author

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

Base automatically changed from jferg/feedback-issue-type to master October 5, 2023 17:40
@getsantry
Copy link
Contributor

getsantry bot commented Oct 27, 2023

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 Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Oct 27, 2023
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #57528 (3c1c023) into master (dd4fee4) will decrease coverage by 0.28%.
Report is 7 commits behind head on master.
The diff coverage is 100.00%.

@@            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     
Files Coverage Δ
...c/sentry/api/endpoints/organization_group_index.py 85.54% <100.00%> (+0.34%) ⬆️
src/sentry/issues/search.py 83.51% <100.00%> (+0.37%) ⬆️
src/sentry/search/snuba/executors.py 90.96% <100.00%> (-2.33%) ⬇️

... and 1660 files with indirect coverage changes

@JoshFerge JoshFerge marked this pull request as ready for review November 1, 2023 01:17
@JoshFerge JoshFerge requested a review from a team as a code owner November 1, 2023 01:17
@JoshFerge JoshFerge requested a review from a team November 1, 2023 01:17
Comment on lines +224 to +225
if referrer != "api.feedback_index":
category_ids.discard(GroupCategory.FEEDBACK.value)
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

@malwilley malwilley left a 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":
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sounds good!

Copy link
Contributor

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,
Copy link
Contributor

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":
Copy link
Contributor

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.

@JoshFerge
Copy link
Member Author

I'll go ahead and close this, not happy w/ how hacky it feels. thanks for reviews folks. will follow up with something better.

@JoshFerge JoshFerge closed this Nov 6, 2023
JoshFerge added a commit that referenced this pull request Nov 7, 2023
…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.
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants