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

Validate content type #2402

Closed
wants to merge 10 commits into from
Closed

Validate content type #2402

wants to merge 10 commits into from

Conversation

lferran
Copy link
Contributor

@lferran lferran commented Aug 19, 2024

Description

  • Validate content types on uploads
  • Do not update resource's basic icon with content types that are not valid

How was this PR tested?

Unit and integration tests

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 9 lines in your changes missing coverage. Please review.

Project coverage is 86.60%. Comparing base (0b327ef) to head (1828b0e).

Files Patch % Lines
nucliadb_models/src/nucliadb_models/common.py 55.55% 4 Missing ⚠️
...cliadb_models/src/nucliadb_models/content_types.py 83.33% 2 Missing ⚠️
nucliadb_models/src/nucliadb_models/writer.py 33.33% 2 Missing ⚠️
nucliadb/src/nucliadb/writer/api/v1/upload.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2402      +/-   ##
==========================================
- Coverage   86.66%   86.60%   -0.07%     
==========================================
  Files         373      374       +1     
  Lines       23066    23093      +27     
==========================================
+ Hits        19990    19999       +9     
- Misses       3076     3094      +18     
Flag Coverage Δ
nucliadb 73.63% <60.00%> (-0.08%) ⬇️
nucliadb-ingest 29.55% <26.66%> (+<0.01%) ⬆️
nucliadb-reader 25.29% <13.33%> (-0.01%) ⬇️
nucliadb-train 46.43% <33.33%> (-0.01%) ⬇️
nucliadb-writer 40.46% <80.00%> (+0.01%) ⬆️
nucliadb_dataset 60.09% <ø> (ø)
nucliadb_models 84.83% <66.66%> (-0.28%) ⬇️
nucliadb_sdk 77.48% <ø> (ø)
nucliadb_sidecar 94.44% <ø> (ø)
nucliadb_telemetry 86.55% <ø> (ø)
nucliadb_utils 83.34% <ø> (ø)

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.

@pytest.mark.parametrize(
"content_type",
[
"application/epub+zip",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this list has been obtained from prod

@lferran lferran closed this Aug 20, 2024
@lferran lferran deleted the validate-content-type branch September 2, 2024 09:24
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.

2 participants