Skip to content

Conversation

@giancarloromeo
Copy link
Contributor

@giancarloromeo giancarloromeo commented Aug 18, 2025

What do these changes do?

ReDoc

This PR adds group permissions management endpoints for Functions, allowing users to get, set, and remove group access rights for specific functions. The implementation follows the existing permissions pattern used elsewhere in the codebase.

Key Changes

  • Added three new REST endpoints for managing function group permissions: GET, PUT, and DELETE operations
  • Modified existing permission access rights structure to support group-based permissions instead of simple boolean flags
  • Enhanced the functions service and repository layers to support group permissions retrieval and management
image

Related issue/s

How to test

cd services/web/server
pytest -vv --pdb tests/unit/with_dbs/04/functions/test_functions_controller_rest.py

Dev-ops

@giancarloromeo giancarloromeo added this to the Voyager milestone Aug 18, 2025
@giancarloromeo giancarloromeo self-assigned this Aug 18, 2025
@giancarloromeo giancarloromeo added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label Aug 18, 2025
@codecov
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

❌ Patch coverage is 70.75472% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.87%. Comparing base (b0784c9) to head (e30c60d).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8226      +/-   ##
==========================================
+ Coverage   88.06%   89.87%   +1.80%     
==========================================
  Files        1915     1507     -408     
  Lines       73891    62115   -11776     
  Branches     1300      498     -802     
==========================================
- Hits        65071    55824    -9247     
+ Misses       8429     6162    -2267     
+ Partials      391      129     -262     
Flag Coverage Δ
integrationtests 64.02% <29.47%> (-0.05%) ⬇️
unittests 88.24% <70.75%> (+1.53%) ⬆️
Components Coverage Δ
pkg_aws_library ∅ <ø> (∅)
pkg_celery_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 93.03% <100.00%> (+0.01%) ⬆️
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 70.19% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.03% <ø> (ø)
agent 93.90% <ø> (ø)
api_server 93.26% <ø> (ø)
autoscaling 95.89% <ø> (ø)
catalog 92.34% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 92.37% <ø> (ø)
datcore_adapter 97.94% <ø> (ø)
director 76.14% <ø> (ø)
director_v2 90.98% <ø> (+0.05%) ⬆️
dynamic_scheduler 96.27% <ø> (ø)
dynamic_sidecar 90.05% <ø> (ø)
efs_guardian 89.62% <ø> (ø)
invitations 91.44% <ø> (ø)
payments 92.61% <ø> (ø)
resource_usage_tracker 92.13% <ø> (ø)
storage 86.34% <ø> (-0.30%) ⬇️
webclient ∅ <ø> (∅)
webserver 88.10% <67.36%> (-0.06%) ⬇️

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 b0784c9...e30c60d. 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.

@mergify
Copy link
Contributor

mergify bot commented Aug 18, 2025

🧪 CI Insights

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

❌ Failed Jobs

Pipeline Job Health on base branch Retries 🔍 CI Insights 📄 Logs
PR CI OAS backwards compatibility Unknown 0 View View

✅ Passed Jobs With Interesting Signals

Pipeline Job Signal Health on base branch Retries 🔍 CI Insights 📄 Logs
CI [sys] public api (3.11, ubuntu-24.04) Base branch is broken, but the job passed. Looks like this might be a real fix 💪 Broken 0 View View
[unit] dynamic-sidecar (3.11, ubuntu-24.04) Base branch is healthy, but retries were needed. Could be early signs of flakiness 👀 Healthy 1 View View
system-tests Base branch is broken, but the job passed. Looks like this might be a real fix 💪 Broken 0 View View
unit-tests Base branch is healthy, but retries were needed. Could be early signs of flakiness 👀 Healthy 1 View View

@giancarloromeo giancarloromeo requested a review from Copilot August 18, 2025 13:51
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 adds group permissions management endpoints for Functions, allowing users to get, set, and remove group access rights for specific functions. The implementation follows the existing permissions pattern used elsewhere in the codebase.

Key Changes

  • Added three new REST endpoints for managing function group permissions: GET, PUT, and DELETE operations
  • Modified existing permission access rights structure to support group-based permissions instead of simple boolean flags
  • Enhanced the functions service and repository layers to support group permissions retrieval and management

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test_functions_service.py Updated test to verify the return value of set_function_group_permissions
_functions_service.py Added get_function_group_permissions function and modified set_function_group_permissions to return permissions
_functions_repository.py Added get_group_permissions function and updated set_group_permissions to return access rights
_functions_exceptions.py Added new exception class for group access rights not found errors
_functions_rest_schemas.py Added FunctionGroupPathParams schema for group-specific path parameters
_functions_rest.py Added three new REST endpoints and updated existing endpoints to use group-based access rights
openapi.yaml Updated API specification to include new endpoints and modified schemas
functions.py Added new schemas for group access rights and updated existing function schemas
_functions.py Added API specifications for the new group permissions endpoints

@giancarloromeo giancarloromeo marked this pull request as ready for review August 18, 2025 19:12
@giancarloromeo giancarloromeo added the 🤖-automerge marks PR as ready to be merged for Mergify label Aug 18, 2025
@giancarloromeo giancarloromeo changed the title ✨ Add Functions permissions management endpoints ✨ Add Function groups permissions management endpoints Aug 18, 2025
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.

Thanks!!

What about POST? How do I share a function with a new group?

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.

Thanks, please review my comments. there are a few open questions.

@giancarloromeo
Copy link
Contributor Author

Thanks!!

What about POST? How do I share a function with a new group?

Well, you have to use the PUT, that is also idempotent...

Copy link
Contributor

@wvangeit wvangeit left a comment

Choose a reason for hiding this comment

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

Thanks a lot @giancarloromeo

Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Thanks! some minor comments

@giancarloromeo
Copy link
Contributor Author

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Aug 19, 2025

queue

🛑 Configuration not compatible with a branch protection setting

The branch protection setting Require branches to be up to date before merging is not compatible with max_parallel_checks>1, queue_conditions != merge_conditions and must be unset.

@giancarloromeo giancarloromeo enabled auto-merge (squash) August 19, 2025 08:45
@sonarqubecloud
Copy link

@giancarloromeo giancarloromeo merged commit 4c15e6c into ITISFoundation:master Aug 19, 2025
143 of 148 checks passed
@giancarloromeo giancarloromeo deleted the is1905/add-functions-permissions-management branch August 19, 2025 10:35
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Sep 2, 2025
61 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify 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.

6 participants