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

Implement UpdateAll #3449

Merged
merged 8 commits into from
Sep 28, 2023
Merged

Conversation

chilagrow
Copy link
Member

@chilagrow chilagrow commented Sep 28, 2023

Description

Closes #3391.

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.

@chilagrow chilagrow added the code/feature Some user-visible feature is not implemented yet label Sep 28, 2023
@chilagrow chilagrow added this to the Next milestone Sep 28, 2023
@chilagrow chilagrow self-assigned this Sep 28, 2023
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #3449 (515d666) into main (490c8f6) will increase coverage by 5.13%.
The diff coverage is 12.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3449      +/-   ##
==========================================
+ Coverage   68.05%   73.18%   +5.13%     
==========================================
  Files         422      422              
  Lines       26296    26346      +50     
==========================================
+ Hits        17895    19282    +1387     
+ Misses       7177     5900    -1277     
+ Partials     1224     1164      -60     
Files Coverage Δ
internal/handlers/sqlite/msg_findandmodify.go 66.40% <100.00%> (+5.04%) ⬆️
internal/handlers/sqlite/msg_insert.go 75.00% <ø> (+17.30%) ⬆️
internal/backends/sqlite/collection.go 77.37% <50.00%> (+2.18%) ⬆️
internal/handlers/sqlite/msg_update.go 74.13% <40.00%> (+7.07%) ⬆️
internal/backends/postgresql/collection.go 12.42% <0.00%> (-3.99%) ⬇️

... and 89 files with indirect coverage changes

Flag Coverage Δ
filter-true 68.33% <12.28%> (+5.57%) ⬆️
hana-1 ?
integration 68.33% <12.28%> (+5.57%) ⬆️
mongodb-1 4.64% <0.00%> (-0.01%) ⬇️
pg-1 ?
pg-2 43.29% <0.00%> (+0.86%) ⬆️
pg-3 42.95% <0.00%> (?)
postgresql-1 ∅ <ø> (∅)
sort-false 68.33% <12.28%> (+5.57%) ⬆️
sqlite-1 39.79% <12.28%> (-0.51%) ⬇️
sqlite-2 42.52% <12.28%> (+0.89%) ⬆️
sqlite-3 42.45% <10.52%> (?)
unit 24.45% <0.00%> (-0.05%) ⬇️

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

@chilagrow chilagrow force-pushed the issue-3391-update-all branch from 817177e to bc2e326 Compare September 28, 2023 04:01
@chilagrow chilagrow force-pushed the issue-3391-update-all branch from bc2e326 to c5b3437 Compare September 28, 2023 04:03
@chilagrow
Copy link
Member Author

Out of update tests, one test case fail, I suspect it's due to indexes not implemented yet so it does not return duplicate key error. Which is expected until we have #3375.

$ task test-integration-postgresql TEST_RUN='TestUpdateCompat/ReplaceNonExistentUpsert'
...

=== RUN   TestUpdateCompat/ReplaceNonExistentUpsert/TestUpdateCompat-ReplaceNonExistentUpsert_Int64s/int64-1
    update_compat_test.go:624: 
        	Error Trace:	/home/chi/go/src/github.com/chilagrow/FerretDB/integration/update_compat_test.go:128
        	Error:      	Received unexpected error:
        	            	write exception: write errors: [E11000 duplicate key error collection: TestUpdateCompat-ReplaceNonExistentUpsert_pg.TestUpdateCompat-ReplaceNonExistentUpsert_Int64s index: _id_ dup key: { _id: "new" }]
        	Test:       	TestUpdateCompat/ReplaceNonExistentUpsert/TestUpdateCompat-ReplaceNonExistentUpsert_Int64s/int64-1
        	Messages:   	compat error; target returned no error
            --- FAIL: TestUpdateCompat/ReplaceNonExistentUpsert/TestUpdateCompat-ReplaceNonExistentUpsert_Int64s/int64-1 (0.01s)

@chilagrow chilagrow marked this pull request as ready for review September 28, 2023 04:31
@chilagrow chilagrow requested review from AlekSi and a team as code owners September 28, 2023 04:31
@chilagrow chilagrow requested review from rumyantseva, a team and noisersup September 28, 2023 04:31
@chilagrow chilagrow enabled auto-merge (squash) September 28, 2023 04:31
@chilagrow chilagrow marked this pull request as draft September 28, 2023 06:31
auto-merge was automatically disabled September 28, 2023 06:31

Pull request was converted to draft

@chilagrow chilagrow marked this pull request as ready for review September 28, 2023 08:26
@chilagrow chilagrow enabled auto-merge (squash) September 28, 2023 08:26
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.

@chilagrow chilagrow requested a review from AlekSi September 28, 2023 11:49
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.

LGTM!

@chilagrow chilagrow merged commit a29e4fb into FerretDB:main Sep 28, 2023
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement UpdateAll
3 participants