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: Make return type for FieldKind_INT an int64 #1982

Merged

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #1681
Resolves #1981

Description

The PR ensures the return type for FieldKind_INT is always of the same go type int64.

Fixing this also surface a small bug in the indexes where a broken index should have returned an error but was returning an error for a different reason. That reason being that the expected return type was int64 but the actual returned type was uint64.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

(replace) Describe the tests performed to verify the changes. Provide instructions to reproduce them.

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added the bug Something isn't working label Oct 19, 2023
@fredcarle fredcarle added this to the DefraDB v0.8 milestone Oct 19, 2023
@fredcarle fredcarle requested a review from a team October 19, 2023 16:37
@fredcarle fredcarle self-assigned this Oct 19, 2023
@fredcarle fredcarle changed the title fix: Make return type for FieldKind_INT and int64 fix: Make return type for FieldKind_INT an int64 Oct 19, 2023
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (2dbfbd6) 74.45% compared to head (6eb2ea3) 74.38%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1982      +/-   ##
===========================================
- Coverage    74.45%   74.38%   -0.08%     
===========================================
  Files          246      246              
  Lines        24306    24309       +3     
===========================================
- Hits         18096    18080      -16     
- Misses        5006     5026      +20     
+ Partials      1204     1203       -1     
Flag Coverage Δ
all-tests 74.38% <73.91%> (-0.08%) ⬇️

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

Files Coverage Δ
datastore/multi.go 100.00% <100.00%> (ø)
db/backup.go 58.57% <ø> (-1.16%) ⬇️
db/errors.go 71.74% <100.00%> (+0.52%) ⬆️
core/encoding.go 64.71% <62.50%> (-1.08%) ⬇️
db/index.go 86.84% <57.14%> (-4.75%) ⬇️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dbfbd6...6eb2ea3. Read the comment docs.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fredcarle fredcarle merged commit 9e1ad62 into develop Oct 19, 2023
31 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/I1681-fix-return-type-for-FieldKind_Int branch October 19, 2023 17:59
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1681 
Resolves sourcenetwork#1981 

## Description

The PR ensures the return type for `FieldKind_INT` is always of the same
go type `int64`.

Fixing this also surface a small bug in the indexes where a broken index
should have returned an error but was returning an error for a different
reason. That reason being that the expected return type was `int64` but
the actual returned type was `uint64`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants