moto icon indicating copy to clipboard operation
moto copied to clipboard

Add Full Support for ServiceDiscovery

Open PisanoCyberG opened this issue 1 year ago • 6 comments

This PR implements functionality for ServiceDiscovery Instances. It also adds support for the missing update_http_namespace() function.

Functions added:

  • update_http_namespace()
  • register_instance()
  • deregister_instance()
  • get_instance()
  • get_instances_health_status()
  • update_instance_custom_health_status()
  • list_instances()
  • discover_instances()
  • discover_instances_revision()

This leaves ServiceDiscovery at 100% implementation.

Feedback on any issues is welcome!

PisanoCyberG avatar Jun 14 '24 16:06 PisanoCyberG

Thank you for taking a look at my changes! Those whitespace changes are changing CRLF to just LF. Previously different files had different methods of encoding line breaks. I've changed them to all follow the Linux standard of LF, since CRLF broke some files (in particular the shebangs at the tops of python files). Let me know if you would still like me to revert and I will be happy to do so.

PisanoCyberG avatar Jun 21 '24 13:06 PisanoCyberG

Let me know if you would still like me to revert and I will be happy to do so.

Yes please

bblommers avatar Jun 23 '24 13:06 bblommers

I have reverted the whitespace changes. Let me know if I can do anything else for you!

PisanoCyberG avatar Jun 25 '24 16:06 PisanoCyberG

I've noticed some issues with dict and list typing issues in Python 3.8. I have fixed this in the latest commit.

PisanoCyberG avatar Jun 28 '24 14:06 PisanoCyberG

Looks like there are a few errors during the 3.12 tests, although they seem to be relating to other services (Lambda, CloudWatch, etc.). Could that be an issue with my proposed changes?

PisanoCyberG avatar Jul 01 '24 20:07 PisanoCyberG

Codecov Report

Attention: Patch coverage is 90.82969% with 21 lines in your changes missing coverage. Please review.

Project coverage is 94.33%. Comparing base (5acba3a) to head (c698d30). Report is 34 commits behind head on master.

Files Patch % Lines
moto/servicediscovery/models.py 86.76% 18 Missing :warning:
moto/servicediscovery/exceptions.py 77.77% 2 Missing :warning:
moto/servicediscovery/responses.py 98.80% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7770      +/-   ##
==========================================
- Coverage   94.34%   94.33%   -0.01%     
==========================================
  Files        1092     1107      +15     
  Lines       93171    94207    +1036     
==========================================
+ Hits        87898    88871     +973     
- Misses       5273     5336      +63     
Flag Coverage Δ
servertests 29.28% <13.97%> (-0.26%) :arrow_down:
unittests 94.30% <90.82%> (-0.01%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 02 '24 07:07 codecov[bot]

Looks like there are a few errors during the 3.12 tests, although they seem to be relating to other services (Lambda, CloudWatch, etc.). Could that be an issue with my proposed changes?

I think Github had some hickups last night - all Docker tests failed randomly, on all PR's. Restarting the build fixed it.

bblommers avatar Jul 02 '24 09:07 bblommers

This is now part of moto >= 5.0.11.dev12

github-actions[bot] avatar Jul 02 '24 10:07 github-actions[bot]