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 more validation and tests for $unset #2853

Merged
merged 10 commits into from Jun 19, 2023

Conversation

chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Jun 16, 2023

Description

Closes #1432.

  • Added validation of $unset input for invalid path.
  • Moved conflict path detection logic to types package, previously it was in update.go.

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.

@chilagrow chilagrow added the code/chore Code maintenance improvements label Jun 16, 2023
@chilagrow chilagrow self-assigned this Jun 16, 2023
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Merging #2853 (660dd23) into main (2b077d5) will decrease coverage by 4.87%.
The diff coverage is 93.16%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2853      +/-   ##
==========================================
- Coverage   63.77%   58.91%   -4.87%     
==========================================
  Files         448      448              
  Lines       22890    22970      +80     
==========================================
- Hits        14598    13532    -1066     
- Misses       7334     8458    +1124     
- Partials      958      980      +22     
Impacted Files Coverage Δ
internal/handlers/commonerrors/error.go 70.00% <ø> (-10.00%) ⬇️
internal/handlers/commonerrors/errorcode_string.go 80.00% <ø> (ø)
internal/types/documentpatherrorcode_string.go 0.00% <ø> (ø)
internal/handlers/common/update.go 79.95% <75.00%> (-9.75%) ⬇️
internal/types/path.go 95.07% <91.66%> (-0.35%) ⬇️
...ernal/handlers/common/aggregations/stages/unset.go 96.63% <96.29%> (+3.78%) ⬆️

... and 44 files with indirect coverage changes

Flag Coverage Δ
integration 51.73% <93.16%> (-5.11%) ⬇️
mongodb 4.24% <0.00%> (-0.02%) ⬇️
pg 51.56% <93.16%> (-5.20%) ⬇️
shard-1 4.24% <0.00%> (-39.18%) ⬇️
shard-2 42.29% <89.74%> (+1.06%) ⬆️
shard-3 44.30% <56.41%> (+1.74%) ⬆️
unit 24.73% <0.00%> (-0.10%) ⬇️

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

@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2023

@chilagrow this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 16, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 16, 2023
@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2023

@chilagrow this pull request has merge conflicts.

@mergify mergify bot added the conflict PRs that have merge conflicts label Jun 16, 2023
@mergify mergify bot removed the conflict PRs that have merge conflicts label Jun 19, 2023
@chilagrow chilagrow added the area/aggregations Issues about aggregation pipelines label Jun 19, 2023
@chilagrow chilagrow changed the title Add more tests for $unset Add more validation and tests for $unset Jun 19, 2023
@chilagrow chilagrow marked this pull request as ready for review June 19, 2023 07:28
@chilagrow chilagrow requested a review from a team as a code owner June 19, 2023 07:28
@chilagrow chilagrow enabled auto-merge (squash) June 19, 2023 07:28
Copy link
Member

@noisersup noisersup 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
Copy link
Contributor Author

👋 @shibasisp, I added additional validation of $unset arguments in this PR 🤗

@AlekSi AlekSi added this to the Next milestone Jun 19, 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.

LGTM

@chilagrow chilagrow merged commit 4d40b2b into FerretDB:main Jun 19, 2023
22 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/aggregations Issues about aggregation pipelines code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Implement $unset aggregation pipeline stage
4 participants