Skip to content

Conversation

@AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #3845

Description

Removes CollectionDefinition.

Anything public that used to return it now returns CollectionVersion.

@AndrewSisley AndrewSisley added this to the DefraDB v0.20 milestone Aug 12, 2025
@AndrewSisley AndrewSisley self-assigned this Aug 12, 2025
@AndrewSisley AndrewSisley requested a review from a team August 12, 2025 23:40
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 84.41926% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.04%. Comparing base (9b8f3ca) to head (7908d2b).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
client/collection_cache.go 74.67% 15 Missing and 4 partials ⚠️
cli/test/action/collection_describe.go 25.00% 6 Missing and 6 partials ⚠️
internal/request/graphql/schema/collection.go 76.00% 6 Missing ⚠️
cbindings/logic/collection.go 0.00% 4 Missing ⚠️
internal/request/graphql/schema/generate.go 82.61% 3 Missing and 1 partial ⚠️
internal/db/definition_validation.go 90.32% 0 Missing and 3 partials ⚠️
internal/db/collection_index.go 87.50% 2 Missing ⚠️
http/client_tx.go 0.00% 1 Missing ⚠️
internal/db/fetcher/encoded_doc.go 83.33% 1 Missing ⚠️
internal/db/txn.go 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3939      +/-   ##
===========================================
- Coverage    73.07%   73.04%   -0.03%     
===========================================
  Files          463      463              
  Lines        42068    41945     -123     
===========================================
- Hits         30738    30636     -102     
+ Misses        9299     9284      -15     
+ Partials      2031     2025       -6     
Flag Coverage Δ
all-tests 73.04% <84.42%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
cli/collection_create.go 73.26% <100.00%> (ø)
cli/collection_describe.go 100.00% <100.00%> (ø)
client/collection.go 100.00% <ø> (ø)
client/db.go 89.29% <ø> (ø)
client/document.go 64.61% <100.00%> (ø)
client/field_kind.go 72.04% <ø> (ø)
client/index.go 80.95% <100.00%> (ø)
http/client.go 55.22% <100.00%> (ø)
http/client_collection.go 50.95% <100.00%> (-0.37%) ⬇️
http/handler_collection.go 72.92% <100.00%> (ø)
... and 43 more

... and 7 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 9b8f3ca...7908d2b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

"graphql_request": &GraphQLRequest{},
"backup_config": &client.BackupConfig{},
"collection": &client.CollectionVersion{},
"collection_definition": &client.CollectionDefinition{},
Copy link
Member

Choose a reason for hiding this comment

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

question: should above collection be changed to collection_version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy with collection. Long term I think I want to remove client.Collection anyway (replacing it with db funcs that take a CollectionVersion), but want to see what Keenan ends up doing with client.Collection (I think he is looking to remove a lot of it).

Do you have a strong preference for collection_version here? And if so why?

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. Just one suggestion.

// in the given store.
//
// If the related definition is not found, or an error occurs, default and false will be returned.
func GetDefinitionFromStore(
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: GetVersionFromStore or GetCollectionFromStore if you want to be consistant with the cache version of this function. This PR is removing CollectionDefinition so it's weird to see this added with that name.

Copy link
Contributor Author

@AndrewSisley AndrewSisley Aug 13, 2025

Choose a reason for hiding this comment

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

Nice spot, I thought I changed this :)

  • Rename GetDefinitionFromStore

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.

Great work sorting this out.

LGTM

@AndrewSisley AndrewSisley merged commit fd4c07f into sourcenetwork:develop Aug 13, 2025
71 of 76 checks passed
@AndrewSisley AndrewSisley deleted the 3845-rm-col-def branch August 13, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove client.CollectionDefinition

3 participants