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

✨ Payments service: http clients #4831

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 5, 2023

What do these changes do?

This PR introduces modules to deal with the http-api connections with RUT and the payment-gateway. Both modules have been created using common tools in utils/http_client.py (will eventually be moved to servicelib.fastapi.

payments-copy drawio

  • ✨ httpx connection to RUT api
  • ✨ httpx connection to payments-gateway
  • ✨ Extend CLIsimcore-service-payments echo-dotenv --minimal

Related issue/s

How to test

  • driving tests services/payments/tests/unit/test_services_resource_usage_tracker.py

DevOps

  • ✨ New env-vars consumed in the payments service ( already added in .env-devel)
     - RESOURCE_USAGE_TRACKER_HOST=${RESOURCE_USAGE_TRACKER_HOST}
     - PAYMENTS_SWAGGER_API_DOC_ENABLED=${PAYMENTS_SWAGGER_API_DOC_ENABLED}
  • ✨ New CLI: simcore-service-payments echo-dotenv prints a valid dot-envfile (see --help for different options!). Example of usage:
    $ simcore-service-payments echo-dotenv > .env
    $ cat .env
    $ set -o allexport; source .env; set +o allexport

NOTE: this might be useful to generate an initial list of env-vars for a services.

@pcrespov pcrespov self-assigned this Oct 5, 2023
@pcrespov pcrespov added this to the the nameless milestone Oct 5, 2023
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #4831 (651c970) into master (4681377) will increase coverage by 2.1%.
The diff coverage is 98.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4831     +/-   ##
========================================
+ Coverage    82.9%   85.0%   +2.1%     
========================================
  Files        1074    1163     +89     
  Lines       45637   48372   +2735     
  Branches     1040    1040             
========================================
+ Hits        37859   41158   +3299     
+ Misses       7546    6982    -564     
  Partials      232     232             
Flag Coverage Δ
integrationtests 60.9% <ø> (+<0.1%) ⬆️
unittests 83.5% <98.4%> (-1.3%) ⬇️

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

Files Coverage Δ
...s/models-library/src/models_library/basic_types.py 98.1% <100.0%> (+0.1%) ⬆️
.../src/simcore_service_payments/api/rpc/_payments.py 100.0% <100.0%> (ø)
...vices/payments/src/simcore_service_payments/cli.py 100.0% <100.0%> (ø)
...s/src/simcore_service_payments/core/application.py 100.0% <100.0%> (ø)
...ents/src/simcore_service_payments/core/settings.py 100.0% <100.0%> (ø)
...imcore_service_payments/models/payments_gateway.py 100.0% <100.0%> (ø)
...core_service_payments/services/payments_gateway.py 86.3% <100.0%> (ø)
...ervice_payments/services/resource_usage_tracker.py 100.0% <100.0%> (ø)
.../src/simcore_service_payments/utils/http_client.py 96.1% <96.1%> (ø)

... and 191 files with indirect coverage changes

@pcrespov pcrespov changed the title ✨ Is4657/payments service http clients ✨ Payments service: http clients Oct 5, 2023
@pcrespov pcrespov force-pushed the is4657/payments-service-http-clients branch from 3ec2c24 to 96c7faf Compare October 5, 2023 11:11
@pcrespov pcrespov mentioned this pull request Oct 5, 2023
8 tasks
@pcrespov pcrespov added the a:payments payments service label Oct 5, 2023
Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

LGTM

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.

👍

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.

Very nice! 🎉

@pcrespov pcrespov force-pushed the is4657/payments-service-http-clients branch from 17afb7d to 8c37694 Compare October 5, 2023 19:42
@pcrespov pcrespov enabled auto-merge (squash) October 5, 2023 19:49
Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

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

Thank you!

@mrnicegyu11
Copy link
Member

mrnicegyu11 commented Oct 6, 2023

@pcrespov pcrespov disabled auto-merge October 6, 2023 13:51
@codeclimate
Copy link

codeclimate bot commented Oct 6, 2023

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

View more on Code Climate.

@sonarqubecloud
Copy link

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

@pcrespov pcrespov enabled auto-merge (squash) October 6, 2023 17:07
@pcrespov pcrespov disabled auto-merge October 9, 2023 07:29
@pcrespov pcrespov merged commit e1da1f4 into ITISFoundation:master Oct 9, 2023
@pcrespov pcrespov deleted the is4657/payments-service-http-clients branch October 9, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:payments payments service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants