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

♻️ refactor RUT to use new transactional context #6874

Conversation

matusdrobuliak66
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 commented Dec 1, 2024

What do these changes do?

  • ♻️ refactor RUT to use new transactional context
    • Removed ResourceTrackerRepository and rather introduced three db modules: credit_transactions_db, pricing_plans_db, service_runs_db

Related issue/s

How to test

Dev-ops checklist

Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 77.12766% with 86 lines in your changes missing coverage. Please review.

Project coverage is 65.74%. Comparing base (fd62ccf) to head (800d306).
Report is 1 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (fd62ccf) and HEAD (800d306). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (fd62ccf) HEAD (800d306)
unittests 30 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6874       +/-   ##
===========================================
- Coverage   88.33%   65.74%   -22.59%     
===========================================
  Files        1546      669      -877     
  Lines       60975    33938    -27037     
  Branches     2095      318     -1777     
===========================================
- Hits        53862    22314    -31548     
- Misses       6781    11564     +4783     
+ Partials      332       60      -272     
Flag Coverage Δ
integrationtests 64.53% <ø> (-0.52%) ⬇️
unittests 77.55% <77.12%> (-8.96%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.36% <ø> (-8.02%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 77.81% <ø> (-13.54%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 59.86% <ø> (-29.89%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
osparc_gateway_server 79.79% <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker 89.07% <77.12%> (-1.73%) ⬇️
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 59.15% <ø> (-29.16%) ⬇️

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 fd62ccf...800d306. Read the comment docs.

@matusdrobuliak66 matusdrobuliak66 self-assigned this Dec 2, 2024
@matusdrobuliak66 matusdrobuliak66 marked this pull request as ready for review December 2, 2024 07:56
@matusdrobuliak66 matusdrobuliak66 added a:resource-usage-tracker resource usage tracker service t:maintenance Some planned maintenance work labels Dec 2, 2024
@matusdrobuliak66 matusdrobuliak66 added this to the Event Horizon milestone Dec 2, 2024
@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) December 2, 2024 09:03
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.

Please be very carful when doing these changes. You have correctly awaited the execute part of the query, which is correct. But after an execute you are returned a cursor.

Each time you interact with a cursor it communicates to the DB.
The operations scalar, first, fetch_all they all interact with the cursor. Please replace them with he await versions, which usually just implies in awaiting on the same method.

@matusdrobuliak66
Copy link
Contributor Author

Please be very carful when doing these changes. You have correctly awaited the execute part of the query, which is correct. But after an execute you are returned a cursor.

Each time you interact with a cursor it communicates to the DB. The operations scalar, first, fetch_all they all interact with the cursor. Please replace them with he await versions, which usually just implies in awaiting on the same method.

Discussed in person. There are two approaches: either the one I have, which buffers the results into memory, or the one that streams the results, where fetching also needs to be awaited.

Copy link

sonarqubecloud bot commented Dec 3, 2024

@matusdrobuliak66 matusdrobuliak66 merged commit ca5fcdc into ITISFoundation:master Dec 3, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:resource-usage-tracker resource usage tracker service t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants