DSD-DBS / capella-collab-manager

A web app for collaboration on Capella (MBSE) projects
https://dsd-dbs.github.io/capella-collab-manager/
Apache License 2.0
20 stars 3 forks source link

feat: Add workspace management for admins #1652

Closed MoritzWeber0 closed 4 weeks ago

MoritzWeber0 commented 1 month ago

[!IMPORTANT]
The database migration will fail if there are multiple users with the same user name but different casing! Scan your users list to remove duplicated users before updating.

Implements some parts of #998 and workspace related changes proposed in #1645. Resolves #191.

The pvc_name and size are now stored in our database, which enables us to use a new algorithm for persistent volume names without breaking existing volumes. The new algorithm is independent from the username and uses a random UUID as name instead.

Even though the workspace/user relationship is modeled as many-to-many relationship, each user can only have one workspace. It's intended to add support for more workspaces in the future and the database structure is already set up properly.

The CLI has been updated and shows all persistent volumes created before this update as "Persistent user workspace (legacy)". In addition, the size and annotations are now preserved when performing a backup / restore of a workspace via the CLI. It also fixes an issue that the Pod isn't terminated if the command is aborted with CTRL + C while "Waiting for Pod".

The workspaces are also displayed in the UI with their corresponding size in the user profiles for administrators. Workspaces incl. their content can be deleted. In addition, workspace are now also cleaned up during user deletion.

This PR also makes username changes non-breaking.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 91.30435% with 12 lines in your changes missing coverage. Please review.

Project coverage is 81.12%. Comparing base (28e9e64) to head (117be93). Report is 2 commits behind head on main.

Files Patch % Lines
backend/capellacollab/cli/ws.py 74.41% 9 Missing and 2 partials :warning:
backend/capellacollab/events/crud.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1652 +/- ## ========================================== + Coverage 80.65% 81.12% +0.47% ========================================== Files 185 191 +6 Lines 6095 6215 +120 Branches 679 692 +13 ========================================== + Hits 4916 5042 +126 + Misses 1030 1027 -3 + Partials 149 146 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

A Storybook preview is available for commit a020a89351f065b8c904147c5b7274c28c81c4e5. View Storybook View Chromatic build

sonarcloud[bot] commented 4 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud