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

chore: Strip DSKey prefixes and simplify NewDataStoreKey #944

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #943
Resolves #799

Description

The PR returns NewDataStoreKey to its simplest form of element indexing requiring the provided key string to be either 3 (Object Marker) or 4 elements. To accomplish this we made sure that the return datastorekey strings were stripped of prefixes.

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?

make test

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

  • MacOS

@fredcarle fredcarle added bug Something isn't working action/no-benchmark Skips the action that runs the benchmark. labels Nov 16, 2022
@fredcarle fredcarle added this to the DefraDB v0.4 milestone Nov 16, 2022
@fredcarle fredcarle requested a review from a team November 16, 2022 05:33
@fredcarle fredcarle self-assigned this Nov 16, 2022
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #944 (29e412e) into develop (0b9719f) will increase coverage by 0.01%.
The diff coverage is 76.59%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #944      +/-   ##
===========================================
+ Coverage    60.29%   60.30%   +0.01%     
===========================================
  Files          164      164              
  Lines        17700    17712      +12     
===========================================
+ Hits         10672    10682      +10     
- Misses        6081     6082       +1     
- Partials       947      948       +1     
Impacted Files Coverage Δ
db/fetcher/fetcher.go 60.43% <40.00%> (-0.63%) ⬇️
db/collection.go 66.10% <50.00%> (-0.26%) ⬇️
datastore/wrappedStore.go 66.01% <82.35%> (+1.77%) ⬆️
core/key.go 87.50% <89.47%> (+2.25%) ⬆️

core/errors.go Outdated Show resolved Hide resolved
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Looks good - thanks for fixing this :)

@fredcarle fredcarle merged commit 3e69fe6 into develop Nov 16, 2022
@fredcarle fredcarle deleted the fredcarle/refactor/I799-new-datastore-key branch November 16, 2022 06:14
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…rk#944)

Relevant issue(s)
Resolves sourcenetwork#943
Resolves sourcenetwork#799

Description
The PR returns NewDataStoreKey to its simplest form of element indexing requiring the provided key string to be either 3 (Object Marker) or 4 elements. To accomplish this we made sure that the return datastorekey strings were stripped of prefixes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datastore prefix is leaking into DB NewDataStoreKey parameter parsing is fragile and could be improved
2 participants