Skip to content

Conversation

@GitHK
Copy link
Contributor

@GitHK GitHK commented Oct 24, 2025

What do these changes do?

For a given published project add an entry inside projects_optionals with allow_guests_to_push_states_and_output_ports=True to allow GUEST users to save the outputs and the states of all new style dynamic services in that project.

Related issue/s

How to test

Dev-ops

@GitHK GitHK requested a review from Copilot October 24, 2025 16:09
@GitHK GitHK self-assigned this Oct 24, 2025
@GitHK GitHK added this to the Imparable milestone Oct 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces functionality to allow guest users to save service states and push data to output ports when running projects from templates that have this option enabled. The implementation adds a new database table to track this optional project setting and propagates it from templates to instances.

Key Changes:

  • Added a new projects_optionals database table to store per-project optional settings
  • Implemented logic to check and enable state/output port pushing for guest users when the project allows it
  • Ensured template projects propagate their guest permissions to newly created project instances

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/postgres-database/src/simcore_postgres_database/models/projects_optionals.py Defines the new projects_optionals table schema with a boolean flag for guest permissions
packages/postgres-database/src/simcore_postgres_database/migration/versions/a85557c02d71_add_projects_optionals.py Database migration to create the projects_optionals table
packages/postgres-database/src/simcore_postgres_database/utils_projects_optionals.py Repository class providing methods to check and set guest permissions for projects
services/web/server/src/simcore_service_webserver/studies_dispatcher/_studies_access.py Copies guest permission settings from template to new project instance
services/web/server/src/simcore_service_webserver/projects/_projects_service.py Enables state saving for guest users when project permissions allow
services/web/server/src/simcore_service_webserver/garbage_collector/_core_orphans.py Enables state saving during service removal for guest users when permitted
packages/postgres-database/tests/test_utils_projects_optionals.py Test coverage for the new repository methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.92%. Comparing base (991eab8) to head (5f93549).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8555      +/-   ##
==========================================
+ Coverage   87.55%   87.92%   +0.36%     
==========================================
  Files        2011     1605     -406     
  Lines       78761    64259   -14502     
  Branches     1368      569     -799     
==========================================
- Hits        68958    56497   -12461     
+ Misses       9399     7611    -1788     
+ Partials      404      151     -253     
Flag Coverage Δ
integrationtests 63.88% <50.00%> (-0.06%) ⬇️
unittests 86.10% <87.87%> (-0.18%) ⬇️
Components Coverage Δ
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 92.87% <ø> (ø)
pkg_notifications_library 85.20% <ø> (ø)
pkg_postgres_database 88.08% <100.00%> (+0.12%) ⬆️
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.13% <ø> (+0.17%) ⬆️
agent 93.10% <ø> (ø)
api_server 91.62% <ø> (ø)
autoscaling 95.83% <ø> (ø)
catalog 92.06% <ø> (ø)
clusters_keeper 99.14% <ø> (ø)
dask_sidecar 92.38% <ø> (ø)
datcore_adapter 97.95% <ø> (ø)
director 75.72% <ø> (ø)
director_v2 90.93% <ø> (+0.01%) ⬆️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 90.44% <ø> (ø)
efs_guardian 89.83% <ø> (ø)
invitations 90.90% <ø> (ø)
payments 92.80% <ø> (ø)
resource_usage_tracker 92.11% <ø> (ø)
storage 86.60% <ø> (-0.25%) ⬇️
webclient ∅ <ø> (∅)
webserver 82.57% <66.66%> (-4.45%) ⬇️

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 991eab8...5f93549. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GitHK GitHK requested a review from Copilot October 24, 2025 16:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GitHK GitHK marked this pull request as ready for review October 24, 2025 16:13
@mergify
Copy link
Contributor

mergify bot commented Oct 24, 2025

🧪 CI Insights

Here's what we observed from your CI run for 5f93549.

❌ Job Failures

Pipeline Job Health on master Retries 🔍 CI Insights 📄 Logs
CI system-tests Broken 0 View View
unit-tests Healthy 0 View View

@sonarqubecloud
Copy link

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.

not sure I understand why states have to be uploaded here. outputs ok, but why the states?
Please change the db table name to something more precise. thanks!

from .projects import projects

projects_optionals = sa.Table(
"projects_optionals",
Copy link
Member

Choose a reason for hiding this comment

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

I find this name very weird and very unclear. That could mean anything.
Also I wonder what is the point of pushing the states here? a guest user is only temporary, what is the point of saving the states?
The outputs I understand as this can be used in subsequent nodes, but the states?


@classmethod
async def allows_guests_to_push_states_and_output_ports(
cls, async_engine: AsyncEngine, *, project_uuid: str
Copy link
Member

Choose a reason for hiding this comment

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

so this is like a separate call to a separate database everytime one asks for the projects? can this not be made together with a join in one call?
at this point, if that is really needed, the table should be named something like projects_guest_properties maybe

class CouldNotCreateOrUpdateUserPreferenceError(Exception): ...


class BaseProjectOptionalsRepo:
Copy link
Member

Choose a reason for hiding this comment

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

Base?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants