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
fix PagerDuty timestamp validation #122321
fix PagerDuty timestamp validation #122321
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
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.
Nice job adding this validation to the server side! We should also fix it on the client side, where validation occurs in x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty.tsx
After a discussion with Patrick, i changed the code a bit. |
When I try
Although I see that it is formatted correctly as |
Yes i saw that warning to, probably the single digit hour (5) caused it. |
I like not forcing users to format their own timestamps and handling the formatting ourselves but just worried this deprecation will eventually turn into an error. WDYT @pmuellr? |
Ya, it's an SDH generator :-) I'm wondering if parsing with just |
That deprecation warning is shown when a non-ISO date string is passed to moment such as: So, i don't think that the fall back will be deprecated. And since the code is consistent and working as expected, we can merge this PR. |
That's fair :) |
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.
LGTM! Nice job
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
LGTM!
Regarding the discussion of the deprecation message in moment, this may actually be useful, in case we ever hit it and wonder why a date may have been generated the way it was generated. Hopefully it would show up in the logs, but I imagine it's being written directly to stdout, so may not show up in all logging scenarios ...
* fix PagerDuty timestamp validation * convert a valid timestamp to ISOString * frontend validation (cherry picked from commit 1752caf)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
fixes: #116173
PagerDuty requires ISO 8601 format for the timestamp, native JS Date.parse method does not support some ISO-8601 formats. With this PR, we use moment for date validation.