Skip to content
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

Duration are serialized as seconds count instead of "PT..." notation #3742

Closed
Tracked by #4656
brian-mulier-p opened this issue May 15, 2024 · 2 comments · Fixed by #4955
Closed
Tracked by #4656

Duration are serialized as seconds count instead of "PT..." notation #3742

brian-mulier-p opened this issue May 15, 2024 · 2 comments · Fixed by #4955
Assignees
Labels
documentation Improvements or additions to documentation kind/cooldown Great candidate for the cooldown period

Comments

@brian-mulier-p
Copy link
Member

Describe the issue

See here.

I believe we should change the serialization format to "PT..." notation (in fact the Duration.toString() value, not the ObjectMapper.writeValueAsString(...)).

Maybe we will also need to change the deserializer to read from PT...

Environment

  • Kestra Version:
  • Operating System (OS/Docker/Kubernetes):
  • Java Version (if you don't run kestra in Docker):
@brian-mulier-p brian-mulier-p added the bug Something isn't working label May 15, 2024
@anna-geller anna-geller added this to the v0.18.0 milestone Jun 8, 2024
@github-project-automation github-project-automation bot moved this to To triage in Issues Jun 10, 2024
@anna-geller anna-geller added kind/technical-issue kind/cooldown Great candidate for the cooldown period and removed bug Something isn't working labels Jul 3, 2024
@anna-geller anna-geller removed this from the v0.18.0 milestone Jul 3, 2024
@brian-mulier-p
Copy link
Member Author

brian-mulier-p commented Jul 3, 2024

After digging, we need to add .configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false).
However, it doesn't handle the Deserialization as now durations are serialized as PTXS format but in the end it's still a string and if we don't type strongly the deserialization it will not work (which is what we do when we deserialize to map or list for eg.) so we may need to add a custom deserializer that uses regex for it (^P(?=[^T]|T.)(?:\d*D)?(?:T(?=.)(?:\d*H)?(?:\d*M)?(?:\d*S)?)?$ should work)

@anna-geller anna-geller added the documentation Improvements or additions to documentation label Aug 12, 2024
@brian-mulier-p
Copy link
Member Author

This must be fixed once that has been tackled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation kind/cooldown Great candidate for the cooldown period
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants