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

Add base class for api/v1/trends/* controllers #27841

Closed
wants to merge 12 commits into from

Conversation

mjankowski
Copy link
Contributor

Similar to #27797 for api/v1/instances and #27794 for api/v1/statuses this pulls out some common setup within the api/v1/trends/* controllers.

Most of the shared behaviour here is around pagination of the api response. I think there might be opportunity here for further extraction of a shared controller concern for pagination across all the API controllers, but starting small here with a few base class extractions.

With #27837 merged, we are at 100% coverage for these. With changes, coverage stays at 100% across controllers, behavior should not change.

@renchap renchap added refactoring Improving code quality ruby Pull requests that update Ruby code labels Nov 13, 2023
@mjankowski mjankowski force-pushed the api-v1-trends-base-class branch 2 times, most recently from 508f1dc to 1185fb7 Compare November 21, 2023 18:04
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: Patch coverage is 91.48936% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 85.01%. Comparing base (86500e3) to head (fcd6740).
Report is 241 commits behind head on main.

❗ Current head fcd6740 differs from pull request most recent head a8fe66d. Consider uploading reports for the commit a8fe66d to get more accurate results

Files Patch % Lines
app/controllers/api/v1/trends/base_controller.rb 95.65% 1 Missing ⚠️
app/controllers/api/v1/trends/links_controller.rb 87.50% 0 Missing and 1 partial ⚠️
...p/controllers/api/v1/trends/statuses_controller.rb 87.50% 0 Missing and 1 partial ⚠️
app/controllers/api/v1/trends/tags_controller.rb 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27841      +/-   ##
==========================================
- Coverage   85.01%   85.01%   -0.01%     
==========================================
  Files        1059     1061       +2     
  Lines       28277    28308      +31     
  Branches     4538     4537       -1     
==========================================
+ Hits        24040    24065      +25     
- Misses       3074     3078       +4     
- Partials     1163     1165       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mjankowski
Copy link
Contributor Author

Much of the base class extraction here accomplishes some of what the 3 other recent api/pagination-related PRs do. Will rebase this after those are in and see what's left.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@mjankowski
Copy link
Contributor Author

Closing this in favor of the few remaining api pagination PRs that are open (which do almost all of this themselves).

@mjankowski mjankowski closed this Mar 13, 2024
@mjankowski mjankowski deleted the api-v1-trends-base-class branch March 13, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improving code quality ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants