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

Fix empty projections panic #2562

Merged
merged 3 commits into from
May 3, 2023

Conversation

w84thesun
Copy link
Contributor

@w84thesun w84thesun commented May 3, 2023

Description

Closes #2551.

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.

@w84thesun w84thesun added the code/bug-regression Some user-visible feature works incorrectly, but worked before label May 3, 2023
@w84thesun w84thesun self-assigned this May 3, 2023
@w84thesun w84thesun added this to the v1.1.0 milestone May 3, 2023
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #2562 (3675f06) into main (a1aee02) will decrease coverage by 37.40%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2562       +/-   ##
===========================================
- Coverage   64.35%   26.95%   -37.40%     
===========================================
  Files         405      405               
  Lines       20119    20119               
===========================================
- Hits        12948     5424     -7524     
- Misses       6234    14124     +7890     
+ Partials      937      571      -366     
Impacted Files Coverage Δ
internal/handlers/common/projection.go 0.00% <0.00%> (-71.07%) ⬇️

... and 128 files with indirect coverage changes

Flag Coverage Δ
integration 5.02% <0.00%> (-52.08%) ⬇️
mongodb 5.02% <0.00%> (ø)
pg ?
unit 25.58% <0.00%> (-0.05%) ⬇️

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

@w84thesun w84thesun marked this pull request as ready for review May 3, 2023 11:50
@w84thesun w84thesun requested a review from a team as a code owner May 3, 2023 11:50
@w84thesun w84thesun requested review from AlekSi and rumyantseva May 3, 2023 11:50
@w84thesun w84thesun enabled auto-merge (squash) May 3, 2023 11:50
@w84thesun w84thesun requested review from a team, chilagrow and noisersup May 3, 2023 11:50
AlekSi
AlekSi previously approved these changes May 3, 2023
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.

:shipit:

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.

The fix looks good to me, but I have one question.

integration/query_projection_compat_test.go Show resolved Hide resolved
internal/handlers/common/projection.go Show resolved Hide resolved
@w84thesun w84thesun requested review from AlekSi and rumyantseva May 3, 2023 15:37
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

@w84thesun w84thesun merged commit 03575a7 into FerretDB:main May 3, 2023
@w84thesun w84thesun deleted the issue-2551-fix-empty-projection branch May 3, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/bug-regression Some user-visible feature works incorrectly, but worked before
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Empty projection document causes nil pointer deference
3 participants