Skip to content

Comments

Add new functions and template example for ILM and tranforms#3221

Open
jrmolin wants to merge 16 commits intoelastic:mainfrom
jrmolin:add_new_readme_functions-ilm_and_transform
Open

Add new functions and template example for ILM and tranforms#3221
jrmolin wants to merge 16 commits intoelastic:mainfrom
jrmolin:add_new_readme_functions-ilm_and_transform

Conversation

@jrmolin
Copy link

@jrmolin jrmolin commented Jan 21, 2026

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:

### Data streams using ILM policies:
#### example
| Key | Value |
|---|---|
| policy.phases.delete.min_age | 30d |
| policy.phases.hot.actions.rollover.max_age | 30d |
| policy.phases.hot.actions.rollover.max_primary_shard_size | 50gb |

The readme must have {{ transform }} included in the readme for the transform function to be called.

The output is as follows:

### Transforms used:
| Name | Description | Source | Dest |
|---|---|---|---|
| latest | Latest Findings from Cloud Synergy | logs-cloud_synergy.findings-* | cloud_solution-cloud_synergy.latest-v1 |

* 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
@elastic elastic deleted a comment from elasticmachine Jan 22, 2026
@elastic elastic deleted a comment from elasticmachine Jan 22, 2026
@jrmolin jrmolin marked this pull request as ready for review January 23, 2026 14:47

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

that's a good idea

Copy link
Author

Choose a reason for hiding this comment

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

is that better?

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Author

Choose a reason for hiding this comment

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

ah, i see. thanks for the clarification!


*/}}

{{ ilm }}
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 20, 2026

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")
Copy link

Choose a reason for hiding this comment

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

Can you add a test for rendering with lifecycle.yml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants