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
Add formatting-aware timestamp replacement via new TimestampTransformer #9772
Conversation
6adf9b7
to
83fd9ae
Compare
38d4913
to
547acf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
👍 🙇♀️
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:01Z
which 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: