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 ability to freeze *types.Document and *types.Array #3253

Merged
merged 8 commits into from
Aug 30, 2023

Conversation

KrishnaSindhur
Copy link
Contributor

@KrishnaSindhur KrishnaSindhur commented Aug 27, 2023

Description

Closes #3112.

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.

@codecov
Copy link

codecov bot commented Aug 27, 2023

Codecov Report

Merging #3253 (c2d2fcf) into main (a71936d) will decrease coverage by 0.35%.
Report is 10 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3253      +/-   ##
==========================================
- Coverage   75.26%   74.92%   -0.35%     
==========================================
  Files         400      400              
  Lines       22386    22819     +433     
==========================================
+ Hits        16849    17096     +247     
- Misses       4563     4736     +173     
- Partials      974      987      +13     
Files Changed Coverage
internal/types/array.go 100.00%
internal/types/document.go 100.00%
internal/types/types.go 100.00%
Flag Coverage Δ
hana ?
integration 71.36% <59.09%> (-0.34%) ⬇️
mongodb 5.18% <27.27%> (-0.08%) ⬇️
pg 63.44% <59.09%> (-1.31%) ⬇️
shard-1 55.78% <59.09%> (-0.97%) ⬇️
shard-2 54.36% <54.54%> (-1.91%) ⬇️
shard-3 55.54% <59.09%> (+0.61%) ⬆️
sqlite 54.03% <59.09%> (+6.99%) ⬆️
unit 24.09% <90.90%> (-0.41%) ⬇️

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

@KrishnaSindhur KrishnaSindhur marked this pull request as draft August 27, 2023 08:03
@KrishnaSindhur
Copy link
Contributor Author

@AlekSi its just a draft pr added freeze() function for document type, just to check am I in proper path or should i change the approach I used currently?

@AlekSi
Copy link
Member

AlekSi commented Aug 27, 2023

@KrishnaSindhur you are on the right track, I would do it the same way 👍

@AlekSi AlekSi added the code/chore Code maintenance improvements label Aug 27, 2023
@KrishnaSindhur KrishnaSindhur marked this pull request as ready for review August 28, 2023 17:46
@AlekSi AlekSi added this to the Next milestone Aug 28, 2023
@AlekSi AlekSi requested review from a team, chilagrow and noisersup August 28, 2023 17:53
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.

There are more methods where we should panic. For example, Array.Remove

@AlekSi AlekSi removed request for a team, rumyantseva, chilagrow and noisersup August 28, 2023 17:58
@KrishnaSindhur KrishnaSindhur requested a review from AlekSi August 28, 2023 18:00
@KrishnaSindhur
Copy link
Contributor Author

should i check the all the methods of array and document which are modifying the values?

@AlekSi
Copy link
Member

AlekSi commented Aug 28, 2023

Well, I think it should be somewhat obvious from existing documentation. If it is not – sure, let's update it

@KrishnaSindhur
Copy link
Contributor Author

KrishnaSindhur commented Aug 28, 2023

I can add few more test if its required for array and document method!! I have just updated existing test for given methods

internal/types/array.go Outdated Show resolved Hide resolved
@AlekSi AlekSi changed the title add: freeze metod for documant type Add ability to freeze *types.Document and *types.Array Aug 29, 2023
@KrishnaSindhur KrishnaSindhur requested a review from AlekSi August 29, 2023 05:38
AlekSi
AlekSi previously approved these changes Aug 30, 2023
@AlekSi AlekSi requested review from a team, rumyantseva, chilagrow and noisersup August 30, 2023 05:07
@AlekSi AlekSi enabled auto-merge (squash) August 30, 2023 05:07
chilagrow
chilagrow previously approved these changes Aug 30, 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.

Thanks for your contribution! Great work 🚀

@chilagrow chilagrow requested a review from AlekSi August 30, 2023 06:03
@AlekSi AlekSi disabled auto-merge August 30, 2023 09:26
@AlekSi AlekSi merged commit c8681a7 into FerretDB:main Aug 30, 2023
@KrishnaSindhur KrishnaSindhur deleted the freeze-to-types branch August 30, 2023 10:33
yonarw pushed a commit to yonarw/FerretDB that referenced this pull request Aug 31, 2023
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.

Add ability to freeze *types.Document and *types.Array
3 participants