octue / octue-sdk-python

The python SDK for @Octue services and digital twins.
https://octue.com
Other
10 stars 4 forks source link

Publish answers to question topic #603

Closed cortadocodes closed 10 months ago

cortadocodes commented 1 year ago

Summary

This pull request removes the use of answer topics by publishing answer messages to the service revision (formerly known as question) topic and filtering subscriptions to only receive a) questions or b) response messages to a specific question. This speeds up the question asking process, reduces cloud infrastructure requirements and the permissions surface, and allows us to avoid topic number limits.

Also added is validation of all messages and their attributes against a new publicly available schema. This ensures services are communicating as they should and opens up the possibility of writing services in other languages and creating emulators.

As this, by itself, constitutes an inter-service communication breaking change, we've taken the opportunity to reduce the complexity of the codebase by removing backwards compatibility patches for service communication (i.e. we've grouped multiple breaking changes together into one).

Contents (#603)

IMPORTANT: There are 7 breaking changes.

New features

Enhancements

Fixes

Dependencies

Refactoring

Testing

Operations


Upgrade instructions

πŸ’₯ Update all Octue services in your network to use this version of octue so they're still able to communicate. Postpone upgrading until you can upgrade all services simultaneously.

πŸ’₯ Replace allow_save_diagnostics_data_on_crash with save_diagnostics set to one of these values: "SAVE_DIAGNOSTICS_OFF", "SAVE_DIAGNOSTICS_ON_CRASH", or "SAVE_DIAGNOSTICS_ON"

πŸ’₯ Crash diagnostics rename:

codecov-commenter commented 1 year ago

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (19cfd4c) 95.03% compared to head (1902194) 94.90%. Report is 1 commits behind head on main.

Files Patch % Lines
octue/cloud/validation.py 73.91% 6 Missing :warning:
octue/cloud/pub_sub/events.py 87.50% 2 Missing :warning:
octue/cloud/pub_sub/service.py 95.83% 2 Missing :warning:
octue/runner.py 88.88% 2 Missing :warning:
...cloud/deployment/google/answer_pub_sub_question.py 80.00% 1 Missing :warning:
octue/cloud/emulators/_pub_sub.py 97.14% 1 Missing :warning:
octue/cloud/pub_sub/message_handler.py 96.15% 1 Missing :warning:
octue/diagnostics.py 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #603 +/- ## ========================================== - Coverage 95.03% 94.90% -0.14% ========================================== Files 75 77 +2 Lines 3322 3394 +72 ========================================== + Hits 3157 3221 +64 - Misses 165 173 +8 ```

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