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

♻️✨ refactoring of pricing plans (🗃️) #4812

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Oct 1, 2023

What do these changes do?

openapi.json specs

  • /v0/services/-/resource-usages now returns real cost + status whether it was billed or not
  • ✨ New endpoints are provided in webserver:
    • /v0/catalog/services/{service_key}/{service_version}/pricing-plan
    • /v0/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}
  • ✨ New endpoints are provided in resource-usage-tracker:
    • /v1/services/{service_key}/{service_version}/pricing-plan
    • /v1/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}
  • ♻️ After several iterations and discussions about the requirements, we have converged on this concept for pricing plans:
    • PricingPlan:
      Describe the overall billing plan/package. The pricing plan can be connected to one or more services. A specific pricing plan might be defined also for billing storage costs.
    • PricingUnit:
      Specifies the various units within a pricing plan that denote different levels or segments. For example, a specific pricing plan might offer three tiers based on resources: SMALL, MEDIUM, and LARGE.
    • PricingUnitCreditCost:
      Defines the credit cost for each unit, which can change over time, allowing for pricing flexibility.
  • 🗃️ DB modifications with all resource_usage_pricing_* tables

Related issue/s

How to test

DevOps Checklist

@matusdrobuliak66 matusdrobuliak66 self-assigned this Oct 1, 2023
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5994 lines exceeds the maximum allowed for the inline comments feature.

@codecov
Copy link

codecov bot commented Oct 1, 2023

Codecov Report

Merging #4812 (b4b78f0) into master (a7f5940) will increase coverage by 4.4%.
The diff coverage is 93.8%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4812     +/-   ##
========================================
+ Coverage    82.9%   87.3%   +4.4%     
========================================
  Files        1154    1045    -109     
  Lines       48048   44734   -3314     
  Branches     1040     629    -411     
========================================
- Hits        39867   39093    -774     
+ Misses       7948    5498   -2450     
+ Partials      233     143     -90     
Flag Coverage Δ
integrationtests 63.6% <69.8%> (+2.7%) ⬆️
unittests 85.1% <93.2%> (+0.3%) ⬆️

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

Files Coverage Δ
...pi_schemas_resource_usage_tracker/pricing_plans.py 100.0% <100.0%> (ø)
...api_schemas_resource_usage_tracker/service_runs.py 100.0% <100.0%> (ø)
...ls_library/api_schemas_webserver/resource_usage.py 100.0% <100.0%> (ø)
...ls-library/src/models_library/rabbitmq_messages.py 90.0% <100.0%> (+<0.1%) ⬆️
...els-library/src/models_library/resource_tracker.py 100.0% <100.0%> (ø)
...ls-library/src/models_library/services_creation.py 100.0% <100.0%> (ø)
...ase/models/resource_tracker_credit_transactions.py 100.0% <ø> (ø)
...models/resource_tracker_pricing_plan_to_service.py 100.0% <ø> (ø)
..._database/models/resource_tracker_pricing_plans.py 100.0% <ø> (ø)
...base/models/resource_tracker_pricing_unit_costs.py 100.0% <100.0%> (ø)
... and 32 more

... and 195 files with indirect coverage changes

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5941 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5852 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5851 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5855 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5855 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5855 lines exceeds the maximum allowed for the inline comments feature.

@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review October 1, 2023 18:04
@matusdrobuliak66 matusdrobuliak66 added this to the the nameless milestone Oct 1, 2023
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

So these are my initial comments. Looks good.

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.

This was a big PR. I could not go in depth in all parts. I left some comments that I hope they are useful .

@pcrespov
Copy link
Member

pcrespov commented Oct 2, 2023

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5925 lines exceeds the maximum allowed for the inline comments feature.

@matusdrobuliak66 matusdrobuliak66 requested a review from GitHK October 2, 2023 11:51
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5935 lines exceeds the maximum allowed for the inline comments feature.

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.

thx. Please do not forget last cleanup!
thx!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2023

Please retry analysis of this Pull-Request directly on SonarCloud.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5913 lines exceeds the maximum allowed for the inline comments feature.

…ub.com:matusdrobuliak66/osparc-simcore into is1133/create-api-for-creation-of-pricing-plan
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5905 lines exceeds the maximum allowed for the inline comments feature.

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) October 2, 2023 15:45
Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5905 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5905 lines exceeds the maximum allowed for the inline comments feature.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 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

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 5905 lines exceeds the maximum allowed for the inline comments feature.

@codeclimate
Copy link

codeclimate bot commented Oct 2, 2023

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

View more on Code Climate.

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) October 2, 2023 19:47
@pcrespov pcrespov disabled auto-merge October 2, 2023 20:09
@pcrespov pcrespov merged commit a03ed85 into ITISFoundation:master Oct 2, 2023
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Oct 5, 2023
36 tasks
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.

Create api for pricing plans/pricing units to be used by webserver & api-server
3 participants