Add formatting-aware timestamp replacement via new TimestampTransformer#9772
Merged
dominikschubert merged 12 commits intomasterfrom Dec 11, 2023
Merged
Add formatting-aware timestamp replacement via new TimestampTransformer#9772dominikschubert merged 12 commits intomasterfrom
dominikschubert merged 12 commits intomasterfrom
Conversation
6adf9b7 to
83fd9ae
Compare
38d4913 to
547acf1
Compare
steffyP
approved these changes
Dec 11, 2023
Member
steffyP
left a comment
There was a problem hiding this comment.
Great work 🚀 👍 Love that we can now check the actual expected date format 👏
the replacements are using a reference timestamp: 2022-07-13T13:48:01Z which is the UTC timestamp of the v1.0.0 commit of localstack/localstack
nice, I remember we once talked about this approach 😄
This means that it's fairly easy to incrementally migrate/regenerate snapshots and avoids a big-bang merge with a lot of merge conflicts.
👍 🙇♀️
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.
Motivation
In the past we've had issues with missing parity of timestamp formats due to the default transformer replacing all timestamps with the same generic tokens. This is an attempt to improve on this by encoding the date format. It's intentionally not trying to be too smart by doing too much magic(e.g. trying to parse & infer formatting) and needs to be explicitly extended by regex + replacement.
I really like how Golang does date formatting, so in that style, the replacements are using a reference timestamp:
2022-07-13T13:48:01Zwhich is the UTC timestamp of the v1.0.0 commit of localstack/localstack: cf26bd9Changes
<datetime>for anything that boto deserializes as adatetime.datetime(typically epoch numbers in the API)<timestamp:...>for serialized timestamps, e.g."2022-07-13T13:48:01.000000+00:00"=>"<timestamp:2022-07-13T13:48:01.000000+00:00>"Examples
Example from a currently failing run:
Follow-Ups
What's left to do: