Skip to content

Conversation

@bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented Jan 7, 2025

What do these changes do?

  • This PR exposes the the following endpoints in the api-server:
GET licensed_items
POST licensed_items/{licensed_item_id}/checked-out-items/{licensed_item_checkout_id}/release
GET wallets/{wallet_id}/licensed-items
POST wallets/{wallet_id}/licensed-items/{licensed_item_id}/checkout

Related issue/s

How to test

cd services/api-server
make install-dev
cd tests/unit
python -m pytest test_licensed_items.py

Dev-ops checklist

@bisgaard-itis bisgaard-itis self-assigned this Jan 7, 2025
@codecov
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 95.80420% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.82%. Comparing base (f543f5a) to head (5e0fba5).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7009      +/-   ##
==========================================
+ Coverage   86.92%   87.82%   +0.90%     
==========================================
  Files        1646     1331     -315     
  Lines       64676    55774    -8902     
  Branches     2041      900    -1141     
==========================================
- Hits        56217    48985    -7232     
+ Misses       8121     6652    -1469     
+ Partials      338      137     -201     
Flag Coverage Δ
integrationtests 64.50% <100.00%> (-0.33%) ⬇️
unittests 86.76% <95.80%> (+1.46%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 91.58% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 70.02% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.38% <ø> (ø)
agent 96.82% <ø> (ø)
api_server 90.57% <95.65%> (+0.43%) ⬆️
autoscaling 96.09% <ø> (ø)
catalog 90.57% <ø> (ø)
clusters_keeper 99.48% <ø> (ø)
dask_sidecar 91.26% <ø> (ø)
datcore_adapter 93.18% <ø> (ø)
director 76.40% <ø> (ø)
director_v2 91.41% <ø> (+0.02%) ⬆️
dynamic_scheduler 97.19% <ø> (ø)
dynamic_sidecar 89.74% <ø> (ø)
efs_guardian 90.12% <ø> (ø)
invitations 93.44% <ø> (ø)
osparc_gateway_server ∅ <ø> (∅)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.50% <100.00%> (+0.23%) ⬆️
storage 89.59% <ø> (ø)
webclient ∅ <ø> (∅)
webserver 83.56% <100.00%> (-0.52%) ⬇️

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 f543f5a...5e0fba5. Read the comment docs.

@bisgaard-itis bisgaard-itis added the a:apiserver api-server service label Jan 7, 2025
@bisgaard-itis bisgaard-itis added this to the Event Horizon milestone Jan 7, 2025
@bisgaard-itis
Copy link
Contributor Author

I still need to polish the tests a bit, but apart from that the PR is ready for review

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Nice! Left some suggestions and thoughts.

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!

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.

Sorry, forgot to submit! Thanks a lot! 💯

@pcrespov
Copy link
Member

pcrespov commented Jan 8, 2025

@bisgaard-itis there is a issue under the main PO that I think fits thisone as well: #6875

Copy link
Member

@mguidon mguidon left a comment

Choose a reason for hiding this comment

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

So just for my understanding. When we will add more "licensed item" in the future we just use a flat list and a GET will retrieve them all. Is there a way that we can distinguish different vendor license items at least internally? Such that we could filter e.g. with a query parameter?

@bisgaard-itis
Copy link
Contributor Author

So just for my understanding. When we will add more "licensed item" in the future we just use a flat list and a GET will retrieve them all. Is there a way that we can distinguish different vendor license items at least internally? Such that we could filter e.g. with a query parameter?

I could add a query parameter in this PR which is only allowed to take a single value ("VIP" I guess) and then we can allow for it to take other values in the future. For me it is easy to forward that to the webserver, but what do you think from your perspective @matusdrobuliak66?

@bisgaard-itis bisgaard-itis requested a review from GitHK January 9, 2025 10:44
@bisgaard-itis
Copy link
Contributor Author

So just for my understanding. When we will add more "licensed item" in the future we just use a flat list and a GET will retrieve them all. Is there a way that we can distinguish different vendor license items at least internally? Such that we could filter e.g. with a query parameter?

I could add a query parameter in this PR which is only allowed to take a single value ("VIP" I guess) and then we can allow for it to take other values in the future. For me it is easy to forward that to the webserver, but what do you think from your perspective @matusdrobuliak66?

@mguidon I discussed with @matusdrobuliak66, who mentioned filtering will come at a later point.

@bisgaard-itis bisgaard-itis enabled auto-merge (squash) January 9, 2025 11:15
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2025

@bisgaard-itis bisgaard-itis merged commit 7e31592 into ITISFoundation:master Jan 9, 2025
92 of 93 checks passed
@bisgaard-itis bisgaard-itis deleted the 6948-expose-licensing-endpoints-in-api-server branch January 9, 2025 14:08
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jan 15, 2025
58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:apiserver api-server service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose licensing endpoints in api-server Implement backend for time-based leasing of features with seats (Resource tracking)

7 participants