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: Multiple schema file support in schema add #3352

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

ChrisBQu
Copy link
Collaborator

@ChrisBQu ChrisBQu commented Jan 2, 2025

Relevant issue(s)

Resolves #1248

Description

Previously, a single schema file could be added by calling defradb schema add -f filename. Now we can add multiple new schemas from different files in the following way: defradb schema add -f file_one -f file_two -f file_three

This PR also adjusts some import statements that were using the incorrect error import.

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?

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

  • Windows

@ChrisBQu ChrisBQu added feature New feature or request area/cli Related to the CLI binary labels Jan 2, 2025
@ChrisBQu ChrisBQu added this to the DefraDB v0.16 milestone Jan 2, 2025
@ChrisBQu ChrisBQu self-assigned this Jan 2, 2025
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 78.38%. Comparing base (65fa135) to head (9cb6ecd).
Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
cli/schema_add.go 50.00% 11 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3352      +/-   ##
===========================================
+ Coverage    78.10%   78.38%   +0.27%     
===========================================
  Files          388      392       +4     
  Lines        35398    35650     +252     
===========================================
+ Hits         27647    27941     +294     
+ Misses        6119     6069      -50     
- Partials      1632     1640       +8     
Flag Coverage Δ
all-tests 78.38% <50.00%> (+0.27%) ⬆️

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

Files with missing lines Coverage Δ
acp/acp_local.go 98.05% <ø> (ø)
cli/config.go 80.00% <ø> (ø)
crypto/nonce.go 55.00% <ø> (ø)
internal/db/collection_index.go 87.50% <ø> (ø)
cli/schema_add.go 66.67% <50.00%> (-5.33%) ⬇️

... and 37 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 65fa135...9cb6ecd. Read the comment docs.

@ChrisBQu ChrisBQu requested a review from a team January 6, 2025 16:00
@@ -20,6 +19,8 @@ import (
"github.com/sourcenetwork/corelog"
"github.com/spf13/pflag"
"github.com/spf13/viper"

"github.com/sourcenetwork/defradb/errors"
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Might be worth adding a linter rule for this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to the CLI binary feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

schema add command to support multiple files
2 participants