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

[actions] expand object context variables as JSON #85903

Merged

Conversation

pmuellr
Copy link
Member

@pmuellr pmuellr commented Dec 15, 2020

resolves #75601

Summary

Previously, if a context variable that is an object is referenced in a
mustache template used as an action parameter, the resulting variable
expansion will be [Object object]. In this PR, we change this so that
the expansion is a JSON representation of the object.

This is primarily for diagnostic purposes, so that customers can see
all the context variables available, and their values, while testing
testing their alerting actions.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@pmuellr pmuellr force-pushed the actions/to-string-context-var-objects-2 branch 3 times, most recently from 7dd5f05 to cfb20f1 Compare December 15, 2020 13:23
resolves elastic#75601

Previously, if a context variable that is an object is referenced in a
mustache template used as an action parameter, the resulting variable
expansion will be `[Object object]`.  In this PR, we change this so that
the expansion is a JSON representation of the object.

This is primarily for diagnostic purposes, so that customers can see
all the context variables available, and their values, while testing
testing their alerting actions.
@pmuellr pmuellr force-pushed the actions/to-string-context-var-objects-2 branch from cfb20f1 to ada56f6 Compare December 15, 2020 17:57
@pmuellr pmuellr added Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes needs_docs labels Dec 15, 2020
@pmuellr pmuellr marked this pull request as ready for review December 15, 2020 18:27
@pmuellr pmuellr requested a review from a team as a code owner December 15, 2020 18:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mikecote mikecote self-requested a review December 15, 2020 19:00
Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I tried it out locally and this is working really great! I was able to see the whole {{context}} stringified 👍

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM and works great!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Distributable file count

id before after diff
default 47241 48001 +760

History

  • 💚 Build #94441 succeeded cfb20f1529e7634a892d3deda7d303e5497c0a74
  • 💔 Build #94340 failed 7dd5f0548473c4928ac65faa561538758bd362a0
  • 💔 Build #94322 failed e509beedfab5b3c299bfcb549d2b426a10c0aaf7
  • 💔 Build #94311 failed 221b4d7e9c37a44fa5b227b89e50af45c7006bbd

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pmuellr pmuellr merged commit f693697 into elastic:master Dec 15, 2020
pmuellr added a commit to pmuellr/kibana that referenced this pull request Dec 15, 2020
resolves elastic#75601

Previously, if a context variable that is an object is referenced in a
mustache template used as an action parameter, the resulting variable
expansion will be `[Object object]`.  In this PR, we change this so that
the expansion is a JSON representation of the object.

This is primarily for diagnostic purposes, so that customers can see
all the context variables available, and their values, while testing
testing their alerting actions.
pmuellr added a commit that referenced this pull request Dec 16, 2020
resolves #75601

Previously, if a context variable that is an object is referenced in a
mustache template used as an action parameter, the resulting variable
expansion will be `[Object object]`.  In this PR, we change this so that
the expansion is a JSON representation of the object.

This is primarily for diagnostic purposes, so that customers can see
all the context variables available, and their values, while testing
testing their alerting actions.
@pmuellr pmuellr removed the needs_docs label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Actions release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
5 participants