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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Fix/storage skip invalid projects while listing #3740

Merged
merged 3 commits into from
Jan 10, 2023

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 9, 2023

What do these changes do?

@drniiken could not copy a template project that he owned. This was a side effect of having corrupted data in both projects and meta_data tables. The copy routine was failing because a validation error on some data owned by the same user. The corrupt data had nothing to do with this operation but the error was not handled properly which resulted in a confusing 400 error with message=Invalid header token

image

Running the same request from storage i.e. GET http://storage:8080/v0/locations/0/files/metadata?user_id=5&uuid_filter=b7... revealed the validation error.

Two actions were taken:

  1. fixed corrupted data in staging
  2. create this PR that skips corrupted data in the database

This should prevent for the moment this error but does not completely solves the problem. Follow up should consider adding validation tests against deployed databases:

@pcrespov pcrespov self-assigned this Jan 9, 2023
@pcrespov pcrespov marked this pull request as ready for review January 9, 2023 15:13
@pcrespov pcrespov force-pushed the fix/storage-relax-validation branch from 74bc6ce to 6721b4e Compare January 9, 2023 15:13
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

Thanks 馃挭

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #3740 (df05c01) into master (ea8d620) will decrease coverage by 16.8%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3740      +/-   ##
=========================================
- Coverage    79.8%   62.9%   -16.9%     
=========================================
  Files         776     264     -512     
  Lines       32125   13377   -18748     
  Branches      791       0     -791     
=========================================
- Hits        25636    8424   -17212     
+ Misses       6291    4953    -1338     
+ Partials      198       0     -198     
Flag Coverage 螖
integrationtests 58.8% <酶> (?)
unittests 90.4% <100.0%> (+10.6%) 猬嗭笍

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

Impacted Files Coverage 螖
...storage/src/simcore_service_storage/db_projects.py 100.0% <100.0%> (酶)
...rage/src/simcore_service_storage/simcore_s3_dsm.py 94.0% <100.0%> (酶)
...r/src/simcore_service_webserver/storage_schemas.py 0.0% <0.0%> (-100.0%) 猬囷笍
...service_webserver/projects/_project_models_rest.py 0.0% <0.0%> (-100.0%) 猬囷笍
...es/web/server/src/simcore_service_webserver/log.py 0.0% <0.0%> (-94.8%) 猬囷笍
...erver/src/simcore_service_webserver/rest_models.py 0.0% <0.0%> (-92.7%) 猬囷笍
...simcore_service_webserver/director/director_api.py 0.0% <0.0%> (-76.0%) 猬囷笍
...rc/simcore_service_webserver/version_control_db.py 24.5% <0.0%> (-68.7%) 猬囷笍
...src/simcore_service_webserver/activity/handlers.py 29.3% <0.0%> (-63.8%) 猬囷笍
...ce_webserver/studies_dispatcher/_studies_access.py 22.7% <0.0%> (-63.7%) 猬囷笍
... and 656 more

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

pair-fixed. Thanks!

@pcrespov pcrespov enabled auto-merge (squash) January 9, 2023 17:49
@codeclimate
Copy link

codeclimate bot commented Jan 9, 2023

Code Climate has analyzed commit df05c01 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Jan 9, 2023

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@odeimaiz odeimaiz added this to the Zefram Cochrane milestone Jan 10, 2023
@pcrespov pcrespov merged commit 1321890 into ITISFoundation:master Jan 10, 2023
@pcrespov pcrespov deleted the fix/storage-relax-validation branch January 10, 2023 08:13
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.

None yet

3 participants