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

[fleet] Add escape_string and to_json helpers #135992

Merged
merged 4 commits into from
Jul 8, 2022

Conversation

marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Jul 8, 2022

Summary

Adds to_json and escape_string helpers to handlebars for fleet server.

Closes #127268
Related #133070

Checklist

For maintainers

@marc-gr marc-gr added release_note:enhancement enhancement New value added to drive a business result Team:Fleet Team label for Observability Data Collection Fleet team v8.4.0 labels Jul 8, 2022
@marc-gr marc-gr requested a review from a team as a code owner July 8, 2022 09:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for taking this on.

@kpollich
Copy link
Member

kpollich commented Jul 8, 2022

@elastic/integrations Is there somewhere we should document helpers like this for integration maintainers?

@marc-gr marc-gr merged commit 4a23325 into elastic:main Jul 8, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jul 8, 2022
@marc-gr marc-gr deleted the fleet/string-helpers branch July 8, 2022 13:08
@andrewkroh
Copy link
Member

We should document these (and any other custom handlebar functions like contains) in the package-spec definition for the templates.

@andrewkroh
Copy link
Member

I wonder about the feasibility of backporting this to 7.17. We have many Fleet packages that are supported in 7.17 and 8.x. If we wanted to use these functions then we'll have to drop 7.17 support in these Fleet packages.

@marc-gr marc-gr added auto-backport Deprecated - use backport:version if exact versions are needed v7.17.6 and removed backport:skip This commit does not require backporting labels Jul 12, 2022
@marc-gr
Copy link
Contributor Author

marc-gr commented Jul 12, 2022

I wonder about the feasibility of backporting this to 7.17. We have many Fleet packages that are supported in 7.17 and 8.x. If we wanted to use these functions then we'll have to drop 7.17 support in these Fleet packages.

Added the backport labels after checking it is fine with @kpollich

kibanamachine pushed a commit that referenced this pull request Jul 12, 2022
* Add escape_string and to_json helpers

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add regexp for new line and fix tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4a23325)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 12, 2022
* Add escape_string and to_json helpers

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add regexp for new line and fix tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4a23325)

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
@marc-gr marc-gr added the v8.3.3 label Jul 13, 2022
@jen-huang jen-huang added auto-backport Deprecated - use backport:version if exact versions are needed and removed auto-backport Deprecated - use backport:version if exact versions are needed labels Jul 13, 2022
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit that referenced this pull request Jul 13, 2022
* Add escape_string and to_json helpers

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add regexp for new line and fix tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4a23325)
kibanamachine added a commit that referenced this pull request Jul 13, 2022
* Add escape_string and to_json helpers

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* Add regexp for new line and fix tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4a23325)

Co-authored-by: Marc Guasch <marc-gr@users.noreply.github.com>
@jen-huang jen-huang added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement enhancement New value added to drive a business result labels Jul 13, 2022
@nchaulet nchaulet mentioned this pull request Jul 20, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.17.6 v8.3.3 v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Add helpers for escaping special characters in YAML variables
7 participants