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

🎨 moving folders to workspaces #6851

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Nov 27, 2024

What do these changes do?

  • ✨ Expose moving folder to workspace api
  • ♻️ Utilizing the new transaction_context to make complicated operations on DB

Helpers:

  • Firstly check permissions

    • source folder "delete" access rights
    • all projects inside a folder "delete" access rights
    • destination workspace "write" access rights
  • Private Workspace Folder --> Shared workspace (root)

    • update projects table "workspace_id" field
    • update folder_v2 table "workspace_id" field (all children) and "parent_folder_id" field with NULL (just for the one moving)
    • update projects_to_folders table -> Remove all records with children folders where "user_id" field is not the one moving
    • update projects_to_folders table -> Update "user_id" field with None
    • Remove project permissions
  • Shared Workspace Folder --> Shared workspace (root)

    • update projects table "workspace_id" field
    • update folder_v2 table "workspace_id" field (all children) and "parent_folder_id" field with NULL (just for the one moving)
    • update projects_to_folders table -> Update "user_id" field with None
    • Remove project permissions
  • Shared Workspace Folder --> Private workspace (root)

    • update projects table "workspace_id" field with NULL
    • update folder_v2 table "workspace_id" field (all children) with NULL and "parent_folder_id" field with NULL (just for the one moving)
    • update projects_to_folders table -> Update "user_id" field with USER ID integer
    • Add project permissions

Related issue/s

How to test

Dev-ops checklist

@matusdrobuliak66 matusdrobuliak66 self-assigned this Nov 27, 2024
@matusdrobuliak66 matusdrobuliak66 added the a:webserver issue related to the webserver service label Nov 27, 2024
@matusdrobuliak66 matusdrobuliak66 added this to the Event Horizon milestone Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.29%. Comparing base (6a7b073) to head (eabeafb).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (6a7b073) and HEAD (eabeafb). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (6a7b073) HEAD (eabeafb)
unittests 31 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6851       +/-   ##
===========================================
- Coverage   87.28%   65.29%   -21.99%     
===========================================
  Files        1557      648      -909     
  Lines       61890    31562    -30328     
  Branches     2108      263     -1845     
===========================================
- Hits        54018    20608    -33410     
- Misses       7541    10894     +3353     
+ Partials      331       60      -271     
Flag Coverage Δ *Carryforward flag
integrationtests 64.73% <ø> (-2.26%) ⬇️ Carriedforward from 3dded08
unittests 91.64% <ø> (+5.23%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
api 78.42% <ø> (ø)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.36% <ø> (-8.02%) ⬇️
agent 97.00% <ø> (ø)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 76.47% <ø> (-8.72%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 59.86% <ø> (-29.86%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
osparc_gateway_server 79.79% <ø> (-5.70%) ⬇️
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 59.57% <ø> (-27.65%) ⬇️

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 6a7b073...eabeafb. Read the comment docs.

@matusdrobuliak66 matusdrobuliak66 changed the title WIP: 🎨 moving folders to workspaces 🎨 moving folders to workspaces Nov 28, 2024
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

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

really nice! Having things standardize allows me to follow your changes to a much greater degree. I left some suggestions. If there are not clear lets catch up in offline. thx!

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.

nice! thanks

@odeimaiz odeimaiz self-requested a review November 29, 2024 12:36
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.

Beautiful

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

thx!

@jsaq007
Copy link
Contributor

jsaq007 commented Dec 2, 2024

Nice

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) December 2, 2024 16:45
Copy link

sonarqubecloud bot commented Dec 3, 2024

@sanderegg sanderegg disabled auto-merge December 3, 2024 13:04
@sanderegg sanderegg merged commit 59aeb99 into ITISFoundation:master Dec 3, 2024
38 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement test_project_workspace_movement_full_workflow Backend: Moving folders between workspaces
6 participants