Add new functions and template example for ILM and tranforms#3221
Add new functions and template example for ILM and tranforms#3221jrmolin wants to merge 16 commits intoelastic:mainfrom
Conversation
* add a new function to handle {{ ilm }} in a readme
* add a new function to handle {{ transform }} in a readme
* update the package-docs-readme.md template to include the ilm and transform calls
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| */}} | ||
|
|
||
| {{ ilm }} |
There was a problem hiding this comment.
You could add some comments here explaining what these will do. This will end up in the default readme created when a new integration is created, so explaining them could help newer users know what this is for.
There was a problem hiding this comment.
That's good, except I don't think the comment style will work, that will render and be visible on some versions of the published documentation, I forget which version now.
You need to use {{/* .... */}} style comments
There was a problem hiding this comment.
ah, i see. thanks for the clarification!
|
|
||
| */}} | ||
|
|
||
| {{ ilm }} |
There was a problem hiding this comment.
That's good, except I don't think the comment style will work, that will render and be visible on some versions of the published documentation, I forget which version now.
You need to use {{/* .... */}} style comments
internal/packages/archetype/_static/package-docs-readme.md.tmpl
Outdated
Show resolved
Hide resolved
…w_readme_functions-ilm_and_transform
⏳ Build in-progress, with failures
Failed CI Steps
History
|
| func getILMPolicyFilePath(packageRoot, dataStreamName string) (string, error) { | ||
| // also look for data_stream/<dataStreamName>/lifecycle.yml | ||
| // if lifecycle.yml exists, return that | ||
| lifecyclePath := filepath.Join(packageRoot, "data_stream", dataStreamName, "lifecycle.yml") |
There was a problem hiding this comment.
Can you add a test for rendering with lifecycle.yml?
Some integrations have ILM policies defined in them, and some have specific transforms defined. There is no convenient way to add this information into the readmes for the integrations. Until now!!!
This PR adds rendering functions for the readme templates to handle outputting basic ILM and transform information, if it exists in the integration.
The readme must have
{{ ilm }}included in the readme for the ILM function to be called.The output is as follows:
The readme must have
{{ transform }}included in the readme for the transform function to be called.The output is as follows: