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 backend decorators and OpLog stub #3303

Merged
merged 29 commits into from
Sep 7, 2023
Merged

Conversation

AlekSi
Copy link
Member

@AlekSi AlekSi commented Sep 4, 2023

Description

This PR introduces the concept of backend decorators/middlewares. Existing xxxContract types will be refactored into decorators once interfaces are a bit more stable and not a subject of merge conflicts.

This PR also adds a stub for the OpLog decorator for demonstration purposes.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • 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), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@AlekSi AlekSi added the not ready Issues that are not ready to be worked on; PRs that should skip CI label Sep 4, 2023
@AlekSi AlekSi self-assigned this Sep 4, 2023
@AlekSi AlekSi changed the title Add dummy decorator Add decorators Sep 4, 2023
@AlekSi AlekSi removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Sep 6, 2023
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #3303 (d227373) into main (9669f0f) will decrease coverage by 0.64%.
The diff coverage is 2.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3303      +/-   ##
==========================================
- Coverage   75.15%   74.51%   -0.64%     
==========================================
  Files         400      406       +6     
  Lines       23970    24189     +219     
==========================================
+ Hits        18014    18024      +10     
- Misses       4897     5107     +210     
+ Partials     1059     1058       -1     
Files Changed Coverage
integration/setup/setup.go ø
internal/backends/decorators/dummy/backend.go 0.00%
internal/backends/decorators/dummy/collection.go 0.00%
internal/backends/decorators/dummy/database.go 0.00%
internal/backends/decorators/oplog/backend.go 0.00%
internal/backends/decorators/oplog/collection.go 0.00%
internal/backends/decorators/oplog/database.go 0.00%
internal/handlers/registry/registry.go ø
internal/handlers/sqlite/sqlite.go 25.00%
integration/setup/listener.go 100.00%
... and 2 more
Flag Coverage Δ
hana ?
integration 71.38% <3.68%> (-0.45%) ⬇️
mongodb 4.89% <0.00%> (-0.04%) ⬇️
pg 60.63% <1.84%> (-0.39%) ⬇️
shard-1 55.39% <3.68%> (-0.33%) ⬇️
shard-2 54.43% <3.68%> (-0.36%) ⬇️
shard-3 54.06% <3.68%> (-0.36%) ⬇️
sqlite 55.86% <3.68%> (-0.37%) ⬇️
unit 23.89% <0.90%> (-0.26%) ⬇️

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

@AlekSi AlekSi changed the title Add decorators Add backend decorators and OpLog stub Sep 6, 2023
@AlekSi AlekSi marked this pull request as ready for review September 6, 2023 11:52
@AlekSi AlekSi requested a review from a team as a code owner September 6, 2023 11:52
@AlekSi AlekSi enabled auto-merge (squash) September 6, 2023 11:52
@AlekSi AlekSi added this to the Next milestone Sep 6, 2023
@AlekSi AlekSi added the code/chore Code maintenance improvements label Sep 6, 2023
@AlekSi AlekSi requested review from a team and noisersup September 6, 2023 11:52
rumyantseva
rumyantseva previously approved these changes Sep 6, 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.

Looks good! The linters fail, but the idea with decorators looks good to me.

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.

I think, linters/compilation/tests still fail...

@AlekSi AlekSi requested review from rumyantseva and a team September 6, 2023 16:52
chilagrow
chilagrow previously approved these changes Sep 7, 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.

Looks great!

rumyantseva
rumyantseva previously approved these changes Sep 7, 2023
@AlekSi AlekSi dismissed stale reviews from chilagrow and rumyantseva via d227373 September 7, 2023 11:12
@AlekSi AlekSi disabled auto-merge September 7, 2023 11:30
@AlekSi AlekSi merged commit 82bca28 into FerretDB:main Sep 7, 2023
@AlekSi AlekSi deleted the decorators branch September 7, 2023 11:30
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.

3 participants