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

Check for nil values in iterators explicitly #2758

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

AlekSi
Copy link
Member

@AlekSi AlekSi commented Jun 1, 2023

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.

@AlekSi AlekSi added the code/chore Code maintenance improvements label Jun 1, 2023
@AlekSi AlekSi added this to the Next milestone Jun 1, 2023
@AlekSi AlekSi self-assigned this Jun 1, 2023
@AlekSi AlekSi requested a review from a team as a code owner June 1, 2023 06:40
@AlekSi AlekSi requested review from w84thesun and rumyantseva June 1, 2023 06:40
@AlekSi AlekSi enabled auto-merge (squash) June 1, 2023 06:40
@AlekSi AlekSi requested review from a team, chilagrow and noisersup June 1, 2023 06:40
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.

This is nice, we ensure that iterator is never nil and enforces the iterator to return interator.ErrIteratorDone if value is empty.

@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #2758 (c81ead0) into main (14534a5) will increase coverage by 21.20%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            main    #2758       +/-   ##
==========================================
+ Coverage   4.96%   26.17%   +21.20%     
==========================================
  Files        439      441        +2     
  Lines      22390    22639      +249     
==========================================
+ Hits        1112     5926     +4814     
+ Misses     21199    16103     -5096     
- Partials      79      610      +531     
Impacted Files Coverage Δ
internal/handlers/pg/pgdb/query_iterator.go 83.33% <ø> (+83.33%) ⬆️
...nternal/handlers/tigris/tigrisdb/query_iterator.go 88.88% <ø> (+88.88%) ⬆️
internal/util/iterator/count.go 0.00% <0.00%> (ø)
internal/util/iterator/func.go 71.42% <0.00%> (-5.50%) ⬇️
internal/util/iterator/values.go 81.81% <0.00%> (+81.81%) ⬆️

... and 136 files with indirect coverage changes

Flag Coverage Δ
integration 4.96% <0.00%> (-0.01%) ⬇️
mongodb 4.96% <0.00%> (-0.01%) ⬇️
unit 24.64% <0.00%> (?)

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

Copy link
Contributor

@w84thesun w84thesun 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 AlekSi changed the title Explicitly check for nil values in iterators Check for nil values in iterators explicitly Jun 1, 2023
@AlekSi AlekSi disabled auto-merge June 1, 2023 09:54
@AlekSi AlekSi enabled auto-merge (squash) June 1, 2023 09:55
@AlekSi AlekSi merged commit bddfa9e into FerretDB:main Jun 1, 2023
@AlekSi AlekSi deleted the iterators-nil branch June 1, 2023 10:31
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