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

Move handlers parameters to common #2529

Merged
merged 22 commits into from
May 4, 2023

Conversation

w84thesun
Copy link
Contributor

@w84thesun w84thesun commented Apr 28, 2023

Description

In this PR I tried to get handlers parameters in the same way we do with FindParams.

Handlers moved:

  • count
  • delete
  • explain
  • insert
  • update

Closes #2465.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@w84thesun w84thesun added code/chore Code maintenance improvements no ci labels Apr 28, 2023
@w84thesun w84thesun self-assigned this Apr 28, 2023
@w84thesun w84thesun marked this pull request as ready for review April 28, 2023 16:17
@w84thesun w84thesun requested a review from a team as a code owner April 28, 2023 16:17
@w84thesun w84thesun requested review from AlekSi and rumyantseva April 28, 2023 16:17
@w84thesun w84thesun enabled auto-merge (squash) April 28, 2023 16:17
@w84thesun w84thesun removed the no ci label Apr 28, 2023
@w84thesun w84thesun requested review from a team, chilagrow and noisersup April 28, 2023 16:19
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

Oh, that's the exact thing I tried before, and Alexey didn't approve because there are not enough params in count and delete to move them to a common package...

@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Merging #2529 (0654f73) into main (03575a7) will decrease coverage by 37.32%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2529       +/-   ##
===========================================
- Coverage   64.35%   27.04%   -37.32%     
===========================================
  Files         405      410        +5     
  Lines       20119    20058       -61     
===========================================
- Hits        12948     5424     -7524     
- Misses       6234    14063     +7829     
+ Partials      937      571      -366     
Impacted Files Coverage Δ
internal/handlers/common/count.go 0.00% <0.00%> (ø)
internal/handlers/common/delete.go 0.00% <0.00%> (ø)
internal/handlers/common/explain.go 0.00% <0.00%> (ø)
internal/handlers/common/findandmodify.go 0.00% <ø> (-87.20%) ⬇️
internal/handlers/common/insert.go 0.00% <0.00%> (ø)
internal/handlers/common/msg_listcommands.go 0.00% <ø> (-100.00%) ⬇️
internal/handlers/common/update_params.go 0.00% <0.00%> (ø)
internal/handlers/pg/msg_count.go 0.00% <0.00%> (-61.54%) ⬇️
internal/handlers/pg/msg_delete.go 0.00% <0.00%> (-68.34%) ⬇️
internal/handlers/pg/msg_explain.go 0.00% <0.00%> (-67.97%) ⬇️
... and 7 more

... and 122 files with indirect coverage changes

Flag Coverage Δ
integration 5.04% <0.00%> (-52.06%) ⬇️
mongodb 5.04% <0.00%> (+0.01%) ⬆️
pg ?
unit 25.67% <0.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@w84thesun
Copy link
Contributor Author

Oh, that's the exact thing I tried before, and Alexey didn't approve because there are not enough params in count and delete to move them to a common package...

Well, I guess we have to wait until Monday then...

chilagrow
chilagrow previously approved these changes May 1, 2023
Copy link
Member

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

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

Great!

@AlekSi
Copy link
Member

AlekSi commented May 2, 2023

and Alexey didn't approve because

Because it wasn't the task your were working on. This issue is literally about moving things to the common code.

@AlekSi AlekSi added this to the v1.1.0 milestone May 2, 2023
@AlekSi AlekSi removed the no ci label May 2, 2023
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

Why we updated msg_count but not msg_delete and msg_explain for Tigris?

@w84thesun
Copy link
Contributor Author

Why we updated msg_count but not msg_delete and msg_explain for Tigris?

I'm on it.

@w84thesun w84thesun changed the title Refactor handlers params Move handlers parameters to common May 2, 2023
rumyantseva
rumyantseva previously approved these changes May 3, 2023
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

The code looks consistent to me! Thanks for moving all these params!

@mergify
Copy link
Contributor

mergify bot commented May 3, 2023

@w84thesun this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label May 3, 2023
@w84thesun w84thesun requested a review from rumyantseva May 3, 2023 12:13
@mergify mergify bot removed the conflict PRs that have merge conflicts label May 3, 2023
@w84thesun w84thesun merged commit 4141270 into FerretDB:main May 4, 2023
@w84thesun w84thesun deleted the refactor-handlers-params branch May 4, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Refactor how we process handlers params
4 participants