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 validating max nested document/array depth #2882

Merged
merged 33 commits into from Jul 24, 2023

Conversation

kropidlowsky
Copy link
Contributor

@kropidlowsky kropidlowsky commented Jun 21, 2023

Description

Closes #1639.

Add validating max nested document/array depth to align it with MongoDB requirement.

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.

@kropidlowsky kropidlowsky requested a review from a team as a code owner June 21, 2023 23:21
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #2882 (10640d5) into main (bb934e0) will decrease coverage by 2.35%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2882      +/-   ##
==========================================
- Coverage   76.40%   74.06%   -2.35%     
==========================================
  Files         390      390              
  Lines       21312    21330      +18     
==========================================
- Hits        16284    15797     -487     
- Misses       4099     4559     +460     
- Partials      929      974      +45     
Impacted Files Coverage Δ
internal/bson/regex.go 56.75% <ø> (ø)
integration/helpers.go 86.78% <100.00%> (-0.53%) ⬇️
internal/bson/array.go 73.68% <100.00%> (+2.53%) ⬆️
internal/bson/document.go 51.39% <100.00%> (+2.01%) ⬆️

... and 39 files with indirect coverage changes

Flag Coverage Δ
integration 70.37% <96.00%> (-2.54%) ⬇️
mongodb 5.53% <48.00%> (+0.05%) ⬆️
pg 60.74% <60.00%> (-5.63%) ⬇️
shard-1 36.55% <96.00%> (-20.23%) ⬇️
shard-2 48.05% <12.00%> (-6.90%) ⬇️
shard-3 58.99% <60.00%> (+1.98%) ⬆️
sqlite 42.95% <96.00%> (-3.47%) ⬇️
unit 24.24% <38.46%> (-0.01%) ⬇️

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

@AlekSi AlekSi added this to the Next milestone Jun 22, 2023
@AlekSi AlekSi added the code/enhancement Some user-visible feature could work better label Jun 22, 2023
@AlekSi AlekSi requested review from a team, w84thesun, rumyantseva and noisersup June 22, 2023 03:45
integration/helpers.go Outdated Show resolved Hide resolved
@AlekSi AlekSi modified the milestones: v1.5.0, Next Jul 3, 2023
@noisersup
Copy link
Member

@kropidlowsky Please let me know if there's anything I can help with

@mergify
Copy link
Contributor

mergify bot commented Jul 7, 2023

@kropidlowsky this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jul 7, 2023
@AlekSi AlekSi modified the milestones: v1.6.0, Next Jul 17, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jul 17, 2023
Copy link
Member

@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 understand why the interface changed this way, but I suggest keeping it as is and introducing a new, more internal, interface. This way, we can hide implementation details.

Let me know if it's unclear, or you disagree or something :)

integration/nested_document_test.go Show resolved Hide resolved
internal/bson/array.go Outdated Show resolved Hide resolved
internal/bson/bson.go Outdated Show resolved Hide resolved
internal/bson/document.go Outdated Show resolved Hide resolved
internal/bson/document.go Outdated Show resolved Hide resolved
integration/basic_test.go Show resolved Hide resolved
internal/bson/array.go Outdated Show resolved Hide resolved
rumyantseva
rumyantseva previously approved these changes Jul 21, 2023
Copy link
Member

@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 like the new approach: it's much simpler and we didn't modify the common interface.

Co-authored-by: Elena Grahovac <elena@grahovac.me>
Copy link
Contributor

@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.

🚀

Copy link
Member

@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

@AlekSi
Copy link
Member

AlekSi commented Jul 24, 2023

@rumyantseva please resolve your conversations

@AlekSi
Copy link
Member

AlekSi commented Jul 24, 2023

@noisersup that PR requires your approval 😁

@noisersup noisersup merged commit c4b09c3 into FerretDB:main Jul 24, 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/enhancement Some user-visible feature could work better
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Validate maximum nested document/array depth
5 participants