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

Add a new 'validate' CLI command #120

Merged
merged 20 commits into from
Apr 15, 2024
Merged

Conversation

CasperWA
Copy link
Collaborator

@CasperWA CasperWA commented Apr 10, 2024

Closes #118

The new 'validate' command returns a list of validated Entitys, i.e., Entity pydantic model instances. But only if all supplied sources supply readable and valid entities with unique URIs.


To do:

  • Add tests for the new command.
  • Utilize new command in the 'upload' command as most of the code is a copy paste of the validation parts used there.
  • Fix up the 'upload' command - there seems to be some spurious usages of filepath in the error messages.

It returns a list of validated `Entity`s, i.e., `Entity` pydantic model
instances. But only if all supplied sources supply readable and valid
entities with unique URIs.
@CasperWA CasperWA changed the title Add a new 'validate' command Add a new 'validate' CLI command Apr 10, 2024
Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (bfd5bcb) to head (76a90f3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   89.84%   92.01%   +2.16%     
==========================================
  Files          21       26       +5     
  Lines        1192     1315     +123     
==========================================
+ Hits         1071     1210     +139     
+ Misses        121      105      -16     
Flag Coverage Δ
docker 80.15% <69.46%> (+10.10%) ⬆️
local 90.87% <100.00%> (+2.28%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

CasperWA added 14 commits April 11, 2024 00:02
Only when using 'validate' as a "normal" Python function.
Create a new CLI submodule 'commands', wherein each CLI command gets its
own submodule.
The commands are then added to the CLI through a dynamic retrieval
method in the 'commands' submodule, similar to what it done for the
Service routers.
Copy over tests from the 'upload' command.
Some are even moved, as all validation (even for inputs) for the
'upload' command is now done in the 'validate' command.
Validation tests can now be run, since they are not mixed with the
"uploading" logic, and they do not need authentication.
@CasperWA CasperWA marked this pull request as ready for review April 12, 2024 08:35
@CasperWA CasperWA requested a review from Treesarj April 12, 2024 11:40
@CasperWA CasperWA added the BLOCKING Blocking issue/PR - must be fixed or merged as priority label Apr 12, 2024
@CasperWA CasperWA merged commit 6e4a3ad into main Apr 15, 2024
11 checks passed
@CasperWA CasperWA deleted the cwa/close-118-validate-command branch April 15, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKING Blocking issue/PR - must be fixed or merged as priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Add a new validate command
2 participants