Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 8, 2025

What do these changes do?

Preparations to add new features to the trash domain at the web-server. This action requires first some refactoring first to comply with the Controller-Service-Repository (CSR) layer and the naming conventions for action timestamps in the database columns.

🗃️ changes in database

image

  • unifies naming for trash columns in projects, workspaces and folders tables
  • renames trashed_at to trashed in order to follow convention in the database tables
    • NOTE: that the web-api trashedAt maps the database column trashed !
  • adds trashed_by to projects table to track user

♻️ webserver

  • creates plugin/domain for trash
    • Renamed PROJECT_TRASH_RETENTION_DAYS as TRASH_RETENTION_DAYS
  • renames folders modules to follow CSR layers
  • renames workspaces modules to follow CSR layers
  • fixes dependencies between models (i.e. api-schemas know about domain models but not the other way around)
  • adapts projects fixtures to new naming changes

Related issue/s

How to test

cd services/web/server
make install-dev
pytest -vv --pdb --ff tests/unit/**/test_*project*.py
pytest -vv --pdb --ff tests/unit/**/test_*trash*.py

Dev-ops ⚠️

  • Renamed PROJECT_TRASH_RETENTION_DAYS to TRASH_RETENTION_DAYS
  • repo.config adapted this osparc-config MR
  • ⚠️ when this PR reaches production, we can completely remove PROJECT_TRASH_RETENTION_DAYS from all deploys

@pcrespov pcrespov self-assigned this Jan 8, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Jan 8, 2025
@pcrespov pcrespov changed the title ✨ Is468/empty trash ✨ Is468/empty trash ⚠️ Jan 8, 2025
@codecov
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 87.01299% with 40 lines in your changes missing coverage. Please review.

Project coverage is 86.39%. Comparing base (79d19bf) to head (a639ad0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7018      +/-   ##
==========================================
- Coverage   86.94%   86.39%   -0.55%     
==========================================
  Files        1651     1664      +13     
  Lines       64840    65036     +196     
  Branches     2043     2091      +48     
==========================================
- Hits        56373    56191     -182     
- Misses       8132     8497     +365     
- Partials      335      348      +13     
Flag Coverage Δ
integrationtests 64.84% <56.43%> (-3.07%) ⬇️
unittests 84.71% <83.76%> (-0.61%) ⬇️
Components Coverage Δ
api 76.84% <ø> (ø)
pkg_aws_library 93.49% <ø> (ø)
pkg_dask_task_models_library 97.09% <ø> (ø)
pkg_models_library 91.48% <92.10%> (-0.11%) ⬇️
pkg_notifications_library 84.57% <ø> (ø)
pkg_postgres_database 88.29% <100.00%> (+0.01%) ⬆️
pkg_service_integration 70.02% <ø> (ø)
pkg_service_library 73.89% <ø> (ø)
pkg_settings_library 90.60% <ø> (ø)
pkg_simcore_sdk 85.38% <ø> (ø)
agent 96.45% <ø> (ø)
api_server 90.54% <ø> (ø)
autoscaling 96.09% <ø> (ø)
catalog 90.66% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.26% <ø> (ø)
datcore_adapter 93.18% <ø> (ø)
director 76.51% <ø> (ø)
director_v2 91.31% <ø> (ø)
dynamic_scheduler 97.20% <ø> (ø)
dynamic_sidecar 89.75% <ø> (ø)
efs_guardian 90.46% <ø> (ø)
invitations 93.44% <ø> (ø)
osparc_gateway_server ∅ <ø> (∅)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.34% <ø> (+0.05%) ⬆️
storage 89.57% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 82.69% <86.36%> (-1.38%) ⬇️

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 79d19bf...a639ad0. Read the comment docs.

Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

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

@pcrespov shall we already create a PR deleting PROJECT_TRASH_RETENTION_DAYS?

Or how not to forget to do that?

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

Approving quickly to unblock without reading the whole PR, I had a look at the .env-devel, dev-ops-related-stuff, it all looks perfectly complete. Thanks a lot for also making the ops-config PR yourself in a very nice manner! < 3

@pcrespov pcrespov enabled auto-merge (squash) January 15, 2025 11:24
@pcrespov pcrespov disabled auto-merge January 15, 2025 17:56
@pcrespov pcrespov enabled auto-merge (squash) January 16, 2025 17:02
@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit a9c4d54 into ITISFoundation:master Jan 16, 2025
56 checks passed
@pcrespov pcrespov deleted the is468/empty-trash branch January 16, 2025 20:19
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Mar 6, 2025
63 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants