Open
Conversation
The jump to message version v1.01 to v1.2 was triggered by downstream problems (ie in other packages) by passing timezone-aware datetime objects instead of the naive times posttroll returned before. Since then, v1.2 means message data might contain timezone-aware datetime objects, while v1.01 ensure only naive datetmes are passed on. Posttroll also has a configuration item the user can set to force the message version to use, so that backwards-compatible messages can be sent by newer instances of posttroll. However, to facilitate the migration to newer message versions, it seems to be necessary (eg for the nameserver) to be able to send both v1.01 messages or v1.2 messages, depending on the contents of the message. This commit implements just that mechanism, so that if the message version-number is not provided explicitly (either as an argument to `Message`, or as a configuration item), the lower compatible message-version will be used. This means v1.01 for messages not containing datetime objects, and v1.2 otherwise.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 88.70% 88.73% +0.03%
==========================================
Files 26 26
Lines 2576 2611 +35
==========================================
+ Hits 2285 2317 +32
- Misses 291 294 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The jump to message version v1.01 to v1.2 was triggered by downstream
problems (ie in other packages) by passing timezone-aware datetime
objects instead of the naive times posttroll returned before. Since
then, v1.2 means message data might contain timezone-aware datetime
objects, while v1.01 ensure only naive datetmes are passed on.
Posttroll also has a configuration item the user can set to force the
message version to use, so that backwards-compatible messages can be
sent by newer instances of posttroll.
However, to facilitate the migration to newer message versions, it seems
to be necessary (eg for the nameserver) to be able to send both v1.01
messages or v1.2 messages, depending on the contents of the message.
This commit implements just that mechanism, so that if the message
version-number is not provided explicitly (either as an argument to
Message, or as a configuration item), the lower compatiblemessage-version will be used. This means v1.01 for messages not
containing datetime objects, and v1.2 otherwise.