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: Return slice of correct length from db.AddSchema #2765

Merged

Conversation

AndrewSisley
Copy link
Contributor

@AndrewSisley AndrewSisley commented Jun 24, 2024

Relevant issue(s)

Resolves #2764

Description

Return slice of correct length from db.AddSchema, values are appended to this slice later in the function, but the result declaration is done as if they will be set by index.

Bug also affected db.AddView.

I'll create a ticket to allow us to test this properly (the results of AddSchema and AddView` are never asserted by our integration tests atm). Ticket created: #2766

@AndrewSisley AndrewSisley added bug Something isn't working area/schema Related to the schema system labels Jun 24, 2024
@AndrewSisley AndrewSisley added this to the DefraDB v0.12 milestone Jun 24, 2024
@AndrewSisley AndrewSisley self-assigned this Jun 24, 2024
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! Thanks for fixing :)

Values are appended to this slice
@AndrewSisley AndrewSisley force-pushed the 2764-create-col-return-slice branch from 5e78787 to e3b9fba Compare June 24, 2024 19:33
@AndrewSisley
Copy link
Contributor Author

LGTM! Thanks for fixing :)

Thanks for finding it :)

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

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.23%. Comparing base (f895315) to head (5e78787).

Current head 5e78787 differs from pull request most recent head e3b9fba

Please upload reports for the commit e3b9fba to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2765      +/-   ##
===========================================
+ Coverage    78.16%   78.23%   +0.07%     
===========================================
  Files          310      310              
  Lines        23071    23071              
===========================================
+ Hits         18032    18049      +17     
+ Misses        3669     3658      -11     
+ Partials      1370     1364       -6     
Flag Coverage Δ
all-tests 78.23% <100.00%> (+0.07%) ⬆️

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

Files Coverage Δ
internal/db/collection_define.go 75.26% <100.00%> (ø)

... and 16 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 f895315...e3b9fba. Read the comment docs.

@AndrewSisley AndrewSisley merged commit 281aa77 into sourcenetwork:develop Jun 24, 2024
35 of 36 checks passed
@AndrewSisley AndrewSisley deleted the 2764-create-col-return-slice branch June 24, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Related to the schema system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

createCollections returns slice with empty values
3 participants