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

✨Personalized resources: remove projects to projects nodes table 🗃️ #4384

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Jun 19, 2023

What do these changes do?

  • removes the table projects_to_projects_nodes
  • added project_uuid in projects_nodes table
  • removed the ability to share nodes

This PR essentially simplifies the database. The original design was keeping a separate table for the mapping between projects and nodes.
It appears that node_uuid are not unique. A few tests, and also the meta-programming rely on the fact that node_uuid are copied to keep a trace. Therefore the node_uuid cannot be used as a primary key in the DB. Further analysis show that there is currently no need to share a node.
The uniqueness of a node is defined by both its project_uuid and node_uuid. This is the current constraint that is also found in the comp_tasks table.
this partially reverts #4362

Bonus:
postgres-database is fully SqlAchemy 2.0 warning free

Related issue/s

How to test

DevOps Checklist

@sanderegg sanderegg added the a:services-library issues on packages/service-libs label Jun 19, 2023
@sanderegg sanderegg added this to the Watermelon milestone Jun 19, 2023
@sanderegg sanderegg self-assigned this Jun 19, 2023
@sanderegg sanderegg changed the title ✨Personalized resources: remove projects to projects nodes table ✨Personalized resources: remove projects to projects nodes table 🗃️ Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Merging #4384 (4460cda) into master (ddb37c4) will decrease coverage by 0.5%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4384     +/-   ##
========================================
- Coverage    87.7%   87.2%   -0.5%     
========================================
  Files         567     843    +276     
  Lines       28104   37186   +9082     
  Branches      554     461     -93     
========================================
+ Hits        24669   32460   +7791     
- Misses       3303    4611   +1308     
+ Partials      132     115     -17     
Flag Coverage Δ
integrationtests 68.1% <ø> (+0.1%) ⬆️
unittests 84.5% <100.0%> (-1.5%) ⬇️

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

Impacted Files Coverage Δ
...simcore_postgres_database/models/projects_nodes.py 100.0% <ø> (ø)
.../simcore_postgres_database/utils_projects_nodes.py 100.0% <100.0%> (ø)

... and 466 files with indirect coverage changes

@sanderegg sanderegg requested a review from GitHK June 19, 2023 15:59
@sonarcloud
Copy link

sonarcloud bot commented Jun 19, 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

@codeclimate
Copy link

codeclimate bot commented Jun 19, 2023

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

View more on Code Climate.

@sanderegg sanderegg merged commit ba7387b into ITISFoundation:master Jun 20, 2023
@sanderegg sanderegg deleted the personalized-resources/remove-projects-to-projects-nodes branch June 20, 2023 06:20
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 22, 2023
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:services-library issues on packages/service-libs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants