Skip to content

ref(shared-views): Remove starred view logic from get /groupsearchviews/ endpoint #89239

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

Merged
merged 3 commits into from
Apr 11, 2025

Conversation

MichaelSun48
Copy link
Member

@MichaelSun48 MichaelSun48 commented Apr 9, 2025

depends on #89235 being deployed

This PR refactors the GET /group-search-views/ endpoint. Previously, it used to return a user's starred views if no query params were provided. That logic has now been removed in this PR, and it has been relocated to GET /group-search-views/starred to reduce overloading of this endpoint.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 9, 2025
@MichaelSun48 MichaelSun48 force-pushed the msun/sharedViews/removeStarredViewLogicFromGET branch from 3b5a823 to ce8c107 Compare April 9, 2025 23:15
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously, if no query params were passed into this endpoint, it would return the user's starred views.

That default behavior has now been removed, and it defaults the query params to createdBy = "me" and sort = "-visited" if none are passed in.

Copy link
Member Author

@MichaelSun48 MichaelSun48 Apr 9, 2025

Choose a reason for hiding this comment

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

Besides removing tests that accounted for the old logic, the other changes in this file are mostly reducing boilerplate code.

For example, the BaseGSVTestCase (which creates a fixed set of test data) has been removed in favor of GroupSearchViewAPITestCase, which instead provides handy functions like create_view and star_view. This helps reduce all of those GroupSearchView.objects.create(...) calls that took up too much space.

Copy link
Member Author

Choose a reason for hiding this comment

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

This test class depended on the BaseGSVTestCase, and refactoring it out of this file in favor of GroupSearchViewAPITestCase turned out to be a bit more work than I expected. I will do this in a separate PR.

@MichaelSun48 MichaelSun48 marked this pull request as ready for review April 9, 2025 23:32
@MichaelSun48 MichaelSun48 requested a review from a team as a code owner April 9, 2025 23:32
@MichaelSun48 MichaelSun48 merged commit 9d407bf into master Apr 11, 2025
61 checks passed
@MichaelSun48 MichaelSun48 deleted the msun/sharedViews/removeStarredViewLogicFromGET branch April 11, 2025 19:37
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #89239      +/-   ##
==========================================
- Coverage   87.70%   85.30%   -2.41%     
==========================================
  Files       10107    10107              
  Lines      571941   571803     -138     
  Branches    22474    22474              
==========================================
- Hits       501613   487762   -13851     
- Misses      69891    83604   +13713     
  Partials      437      437              

billyvg pushed a commit that referenced this pull request Apr 14, 2025
…ws/ endpoint (#89239)

depends on #89235 being deployed

This PR refactors the `GET` `/group-search-views/` endpoint. Previously,
it used to return a user's starred views if no query params were
provided. That logic has now been removed in this PR, and it has been
relocated to `GET` `/group-search-views/starred` to reduce overloading
of this endpoint.
MichaelSun48 added a commit that referenced this pull request Apr 14, 2025
…89252)

Depends on #89239

Adds the `query` filter param to the `GET` /group-search-views`
endpoint, which filters the returned views via substring search on their
name and query.

Also adds the "owner_id" and "stars" attributes to the GET response.
andrewshie-sentry pushed a commit that referenced this pull request Apr 22, 2025
…ws/ endpoint (#89239)

depends on #89235 being deployed

This PR refactors the `GET` `/group-search-views/` endpoint. Previously,
it used to return a user's starred views if no query params were
provided. That logic has now been removed in this PR, and it has been
relocated to `GET` `/group-search-views/starred` to reduce overloading
of this endpoint.
andrewshie-sentry pushed a commit that referenced this pull request Apr 22, 2025
…89252)

Depends on #89239

Adds the `query` filter param to the `GET` /group-search-views`
endpoint, which filters the returned views via substring search on their
name and query.

Also adds the "owner_id" and "stars" attributes to the GET response.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2025
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.

2 participants