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

feat: Add depth support for commits #889

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #888

Description

Adds depth support for commits.

@AndrewSisley AndrewSisley added feature New feature or request area/query Related to the query component action/no-benchmark Skips the action that runs the benchmark. labels Oct 12, 2022
@AndrewSisley AndrewSisley added this to the DefraDB v0.4 milestone Oct 12, 2022
@AndrewSisley AndrewSisley requested a review from a team October 12, 2022 15:39
@AndrewSisley AndrewSisley self-assigned this Oct 12, 2022
Results: []map[string]any{
{
// Composite head
"cid": "bafybeiaxjhz6dna7fyf7tqo5hooilwvaezswd5xfsmb2lfgcy7tpzklikm",
Copy link
Contributor Author

@AndrewSisley AndrewSisley Oct 12, 2022

Choose a reason for hiding this comment

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

These can be made more obvious once #852 is done

@@ -268,6 +268,8 @@ func (n *dagScanNode) Next() (bool, error) {
return false, errors.New("Headset scan node returned an invalid cid")
}
n.currentCid = &cid
// Reset the depthVisited for each head yielded by headset
n.depthVisited = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was a hidden/logic bug that existed previously, however was never exposed as latestCommits has a mandatory docKey (for now :)) and thus only one head will have been yielded per node-instance where depth != 0 (commits previously only allowed infinite depth)

@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #889 (84ee316) into develop (ecb1d1f) will increase coverage by 0.02%.
The diff coverage is 81.25%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #889      +/-   ##
===========================================
+ Coverage    59.73%   59.76%   +0.02%     
===========================================
  Files          157      157              
  Lines        17406    17420      +14     
===========================================
+ Hits         10398    10411      +13     
- Misses        6067     6068       +1     
  Partials       941      941              
Impacted Files Coverage Δ
query/graphql/mapper/commitSelect.go 0.00% <ø> (ø)
query/graphql/parser/commit.go 72.36% <57.14%> (-1.55%) ⬇️
query/graphql/mapper/mapper.go 85.23% <100.00%> (+0.01%) ⬆️
query/graphql/planner/commit.go 90.99% <100.00%> (+0.33%) ⬆️
query/graphql/planner/dagscan.go 75.36% <100.00%> (+0.24%) ⬆️
events/simple.go 86.76% <0.00%> (+2.94%) ⬆️

Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM!

@AndrewSisley AndrewSisley merged commit bdd9b03 into develop Oct 12, 2022
@AndrewSisley AndrewSisley deleted the sisley/feat/I888-commits-depth branch October 12, 2022 18:45
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
* Reset the depthVisited for each head

* Add depth support to commits
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. area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commits: Add depth param to commits
2 participants