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

updates doc on action parameter variable mustache escaping #88521

Merged
merged 3 commits into from
Jan 21, 2021

Conversation

pmuellr
Copy link
Member

@pmuellr pmuellr commented Jan 15, 2021

resolves #87933

Summary

Updates the docs discussing action parameter templating with mustache, and the escaping of values during the rendering of the templates. The text being replaced mentioned HTML escaping, but as of PR #83919, we no longer ever do HTML escaping, but do some action type-specific escaping for some action parameters, described in this PR.

Checklist

Delete any items that are not applicable to this PR.

@pmuellr pmuellr added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) docs v7.11.0 v7.12.0 labels Jan 15, 2021
@pmuellr pmuellr requested a review from a team as a code owner January 15, 2021 20:18
@elasticmachine
Copy link
Contributor

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

@pmuellr
Copy link
Member Author

pmuellr commented Jan 16, 2021

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

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

LGTM


- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I'd understand what action configuration property means if I came in without knowledge of the framework internals.

Perhaps we should just call it the message field? Or something like that, as it's a form field which the user inputs at creation, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

heh, ya, I was working from the docs, where action "params" wasn't referred to as params, but a property, and so the resulting word salad was a bit unwieldy. Will wordsmith that one a bit more, see if I can find other references to a param like that somewhere ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Poking around the docs, action params seem to be referred to as "Action configuration" in the docs, and such references refer to the enclosed "properties":

image

So, unless we want to use some brand new terminology, I think "action configuration property" is probably the right choice. cc: @gchaps ?

Copy link
Contributor

Choose a reason for hiding this comment

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

++ to "action configuration property"

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@pmuellr
Copy link
Member Author

pmuellr commented Jan 20, 2021

@elasticmachine merge upstream


[role="screenshot"]
image::images/alert-flyout-action-variables.png[Passing alert values to an action]

There are some cases where the variable values will be "escaped", when used in a context where escaping is needed:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
There are some cases where the variable values will be "escaped", when used in a context where escaping is needed:
Some cases exist where the variable values will be "escaped", when used in a context where escaping is needed:


[role="screenshot"]
image::images/alert-flyout-action-variables.png[Passing alert values to an action]

There are some cases where the variable values will be "escaped", when used in a context where escaping is needed:

- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
- For the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown.

There are some cases where the variable values will be "escaped", when used in a context where escaping is needed:

- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown
- For the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack Markdown.


- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values
- For the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values.


- for the <<email-action-type, Email>> connector, the `message` action configuration property escapes any characters that would be interpreted as Markdown
- for the <<slack-action-type, Slack>> connector, the `message` action configuration property escapes any characters that would be interpreted as Slack markdown
- for the <<webhook-action-type, Webhook>> connector, the `body` action configuration property escapes any characters that are invalid in JSON string values
Copy link
Contributor

Choose a reason for hiding this comment

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

++ to "action configuration property"

@pmuellr pmuellr merged commit d3fa06b into elastic:master Jan 21, 2021
pmuellr added a commit to pmuellr/kibana that referenced this pull request Jan 21, 2021
…8521)

Provides more detail on mustache variable escaping within action parameter templates.
pmuellr added a commit to pmuellr/kibana that referenced this pull request Jan 21, 2021
…8521)

Provides more detail on mustache variable escaping within action parameter templates.
pmuellr added a commit that referenced this pull request Jan 21, 2021
…88972)

Provides more detail on mustache variable escaping within action parameter templates.
pmuellr added a commit that referenced this pull request Jan 21, 2021
…88971)

Provides more detail on mustache variable escaping within action parameter templates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported docs Feature:Alerting 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 v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[alerts] fix up the docs on mustache escaping
6 participants