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

✨ Trash folders #6642

Merged
merged 48 commits into from
Nov 8, 2024
Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 30, 2024

What do these changes do?

Folders and all their contents (subfolders and projects) can now be trashed (POST /folders/{id}:trash) and restored (POST /folders/{id}/:untrash). The endpoint GET /folders?filters={"trashed": true} will list only explicitly trashed folders. All folder contents (projects and files) is also implicitly trashed, i.e. it is marked as trashed but are not included in the listing, even with the trashed filter applied.

Hightlights

  • ⬆️ web-server API upgraded 0.44.0 → 0.45.0. SEE trash section of openapi specsimage
  • POST /folders/{folder_id}:trash, untrash
    • Mark folder trashed and children (former as explicit and latter as implicit trash)
    • auth/z and access-rights checks
  • 🎨 🗃️ Lists explicitly trashed folder
    • trashed_at in FolderGet
    • trashed_explicitly flag in db
    • add filter in GET /folders
  • ♻️ refactored exception handling. This is just a step towards a more general design in 🎨 web-server: exception handling framework #6655
  • All trash entry-points are only available with WEBSERVER_DEV_FEATURES_ENABLED=1 (i.e. master deploys)

Next steps

  • Trash workspaces
  • Enable search of explicitly trashed items
  • Implement deletion when retention time expires
  • Unit of work to revert back upon failure in batch operations
  • Batch trash and delete operations

Related issue/s

How to test

cd services/web/server
make install-dev
pytest -vv tests/unit/with_db/**/test_*trash*.py
pytest -vv tests/unit/with_db/**/test_*folder*.py

Dev-ops

None

@pcrespov pcrespov added this to the Caveman milestone Oct 30, 2024
@pcrespov pcrespov self-assigned this Oct 30, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 95.11111% with 11 lines in your changes missing coverage. Please review.

Project coverage is 87.94%. Comparing base (72766b4) to head (01bf2ad).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6642      +/-   ##
==========================================
+ Coverage   87.91%   87.94%   +0.02%     
==========================================
  Files        1564     1569       +5     
  Lines       62991    63110     +119     
  Branches     2106     2106              
==========================================
+ Hits        55379    55500     +121     
+ Misses       7287     7285       -2     
  Partials      325      325              
Flag Coverage Δ
integrationtests 64.83% <65.75%> (+0.01%) ⬆️
unittests 85.89% <95.11%> (+0.02%) ⬆️
Components Coverage Δ
api 79.60% <ø> (ø)
pkg_aws_library 93.38% <ø> (ø)
pkg_dask_task_models_library 96.87% <ø> (ø)
pkg_models_library 92.20% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library 83.79% <ø> (ø)
pkg_postgres_database 87.77% <100.00%> (+<0.01%) ⬆️
pkg_service_integration 71.44% <ø> (ø)
pkg_service_library 76.53% <ø> (ø)
pkg_settings_library 91.42% <ø> (ø)
pkg_simcore_sdk 85.27% <ø> (ø)
agent 97.17% <ø> (ø)
api_server 89.82% <ø> (ø)
autoscaling 95.21% <ø> (ø)
catalog 89.46% <ø> (ø)
clusters_keeper 98.72% <ø> (ø)
dask_sidecar 91.32% <ø> (ø)
datcore_adapter 94.05% <ø> (ø)
director 58.38% <ø> (ø)
director_v2 90.79% <ø> (ø)
dynamic_scheduler 96.59% <ø> (ø)
dynamic_sidecar 89.76% <ø> (-0.04%) ⬇️
efs_guardian 90.00% <ø> (ø)
invitations 93.51% <ø> (ø)
osparc_gateway_server 85.15% <ø> (ø)
payments 93.02% <ø> (ø)
resource_usage_tracker 90.68% <ø> (-0.08%) ⬇️
storage 89.76% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 89.36% <94.97%> (+0.08%) ⬆️

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 72766b4...01bf2ad. Read the comment docs.

@pcrespov pcrespov force-pushed the is468/trash-api-folders branch from f64db9b to ad1dd58 Compare November 4, 2024 18:26
@pcrespov pcrespov added a:webserver issue related to the webserver service a:api framework api, data schemas, labels Nov 4, 2024
@pcrespov pcrespov force-pushed the is468/trash-api-folders branch 5 times, most recently from 16ef4b0 to f4c101c Compare November 6, 2024 19:13
@pcrespov pcrespov changed the title WIP: Is468/trash api folders ✨ Trash folders Nov 6, 2024
@pcrespov pcrespov marked this pull request as ready for review November 6, 2024 22:32
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.

👌

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.

can we discuss that PR? I would like to understand the explciti concept and what is its use

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 reviewed, some changes will be done. let me know when this is ready. thanks!

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

Thanks for this. I had one question Please see below.

@pcrespov pcrespov force-pushed the is468/trash-api-folders branch from 110e1eb to 361613f Compare November 7, 2024 17:46
@pcrespov pcrespov requested a review from sanderegg November 7, 2024 20:42
@pcrespov pcrespov force-pushed the is468/trash-api-folders branch from 9c5c9c9 to 01bf2ad Compare November 8, 2024 08:57
Copy link

sonarcloud bot commented Nov 8, 2024

@pcrespov pcrespov mentioned this pull request Nov 8, 2024
4 tasks
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Reviewed in person, thanks!

@pcrespov pcrespov requested a review from GitHK November 8, 2024 10:08
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

All good, thanks for clearing up.

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

👍🏻 cool, thanks a lot

@pcrespov pcrespov disabled auto-merge November 8, 2024 10:42
@pcrespov pcrespov merged commit 299c1ac into ITISFoundation:master Nov 8, 2024
87 of 89 checks passed
@pcrespov pcrespov deleted the is468/trash-api-folders branch November 11, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants