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

✨ web-api interface for tags sharing and add to services #6298

Merged
merged 20 commits into from
Sep 9, 2024

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Sep 3, 2024

What do these changes do?

Creates the web-api (w/o implementation) to both share tags and assign tags to services.

  • ✨ Extended web-api (0.42.0 → 0.43.0) to share tags and add(rm) tags to services
  • 📝 Cleaned up openapi specs tags to document better sharing (associations with group) and sub-resource associations (e.g. tags in services or projects)

web-api

  • Open Swagger Editor
  • share tags with other groups
    image
  • add/remove (existing) tags to (existing) projects and now also to (existing) catalog's services. Note that this adds or removes a relation/association since neither of the resources are created or deleted here.
    image

Related issue/s

How to test

cd services/web/server
make install-dev
pytest -vv tests/unit/with_dbs -k test_app_named_resources_against_openapi_specs

Dev-ops checklist

@pcrespov pcrespov self-assigned this Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 79.38931% with 27 lines in your changes missing coverage. Please review.

Project coverage is 82.3%. Comparing base (cafbf96) to head (2759e90).
Report is 514 commits behind head on master.

Files with missing lines Patch % Lines
...er/src/simcore_service_webserver/tags/_handlers.py 59.0% 18 Missing ⚠️
...imcore_service_webserver/catalog/_tags_handlers.py 72.7% 9 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6298      +/-   ##
=========================================
- Coverage    84.5%   82.3%    -2.2%     
=========================================
  Files          10     591     +581     
  Lines         214   30176   +29962     
  Branches       25     260     +235     
=========================================
+ Hits          181   24861   +24680     
- Misses         23    5255    +5232     
- Partials       10      60      +50     
Flag Coverage Δ
integrationtests 64.6% <74.8%> (?)
unittests 87.9% <79.3%> (+3.3%) ⬆️

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

Files with missing lines Coverage Δ
...er/src/simcore_service_webserver/catalog/plugin.py 100.0% <100.0%> (ø)
...mcore_service_webserver/projects/_tags_handlers.py 93.3% <100.0%> (ø)
...rver/src/simcore_service_webserver/tags/schemas.py 100.0% <100.0%> (ø)
...imcore_service_webserver/catalog/_tags_handlers.py 72.7% <72.7%> (ø)
...er/src/simcore_service_webserver/tags/_handlers.py 83.1% <59.0%> (ø)

... and 596 files with indirect coverage changes

@pcrespov pcrespov added this to the Eisbock milestone Sep 4, 2024
@pcrespov pcrespov added a:api framework api, data schemas, a:webserver issue related to the webserver service labels Sep 4, 2024
@pcrespov pcrespov force-pushed the is6202/web-api-tags branch from 6e56505 to b53f1ac Compare September 4, 2024 16:04
@pcrespov pcrespov changed the title WIP: ✨ Is6202/web api tags ✨ web-api interface for tags sharing and add to services Sep 4, 2024
@pcrespov pcrespov marked this pull request as ready for review September 4, 2024 16:23
Copy link
Contributor

@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! As discussed, for future consideration (and also for future resources): since a tag is a resource that is bound either to a service or a project, I believe we do not need to have a tag-sharing functionality. Additionally, we do not need to bother the user with sharing tags.

A valid approach might be to resolve permissions in the service layer of the tag as the first step. If it's a project tag, check whether the user has write permissions for the project. If it's a service tag, check whether the user has write permissions for the service. If the user does not have the necessary permissions, we do not allow to proceed further.

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.

api/specs/web-server/_folders.py Outdated Show resolved Hide resolved
api/specs/web-server/_wallets.py Show resolved Hide resolved
@pcrespov pcrespov force-pushed the is6202/web-api-tags branch from 7f4d6e0 to 3b744f3 Compare September 5, 2024 12:07
@pcrespov pcrespov enabled auto-merge (squash) September 5, 2024 12:28
Copy link

sonarqubecloud bot commented Sep 9, 2024

@pcrespov pcrespov merged commit 9f06e36 into ITISFoundation:master Sep 9, 2024
57 checks passed
@pcrespov pcrespov deleted the is6202/web-api-tags branch September 9, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:api framework api, data schemas, a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants