Skip to content

Relax package-spec constraints for slo templates#1064

Merged
mrodm merged 4 commits intoelastic:mainfrom
agithomas:relax-packagespec-constraints-slo
Feb 2, 2026
Merged

Relax package-spec constraints for slo templates#1064
mrodm merged 4 commits intoelastic:mainfrom
agithomas:relax-packagespec-constraints-slo

Conversation

@agithomas
Copy link
Copy Markdown
Contributor

@agithomas agithomas commented Jan 28, 2026

What does this PR do?

To have the ability to add SLO templates to packages without bumping the minimum required kibana version to 9+. For kibana versions that do not support slo templates, they should be silently ignored at install.

We had the same requirement for rule templates, and is solved by relaxing the package spec constraints for inclusion of the rules: #1012

Why is it important?

With this change, integration packages can receive slo assets under slo_templates

Checklist

Related issues

@agithomas agithomas marked this pull request as ready for review January 28, 2026 13:58
@agithomas agithomas requested a review from a team as a code owner January 28, 2026 13:58
Comment thread spec/changelog.yml Outdated
- description: Add support for deprecating packages or individual features (policy_templates, inputs, data_streams or variables).
type: enhancement
link: https://github.com/elastic/package-spec/pull/1053
- description: Add version patches to exclude `slo_template` assets for spec versions before 3.4.0.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we move this into 3.4.3-next and release the patch? it sounds odd to me to release in 3.6 a change for 3.2 🤔 WDYT @jsoriano @mrodm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't recall to release backport fixes for previous minor of the spec previously. Do you mean that ?

Probably, this changelog entry could be moved under 3.5.6-next.
As, this PR is setting lower spec versions for these assets, those assets could be defined in the next release without bumping the format_version of the packages. And in other PRs (e.g. #1012) it was done the same.

WDYT ? @jsoriano @teresaromero

If this PR is going to change the minimum spec version for SLO templates, it looks like that this changelog entry should be moved too (currently under 3.6.0-next), shouldn't it?

- description: Add support for Kibana `slo_template` assets
type: enhancement
link: https://github.com/elastic/package-spec/pull/1037

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The change that is closely related to this change is - add slo_template kibana assets and goes under the 3.6.0-next. This is the reason why i added the relax constraints under 3.6.0-next. Taking the mentioned PR into consideration, what would be the recommendation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I think this change should go in 3.5.6-next, and we can consider moving the changelog entry.

We could even consider moving the changelog entry to 3.4.0, and don't add another entry here.

This case falls in the kind of problems that #1011 aims to fix, and I don't think we have a perfect solution with the current approach.

Comment thread spec/integration/kibana/spec.yml
Comment thread spec/changelog.yml Outdated
- description: Add support for deprecating packages or individual features (policy_templates, inputs, data_streams or variables).
type: enhancement
link: https://github.com/elastic/package-spec/pull/1053
- description: Add version patches to exclude `slo_template` assets for spec versions before 3.4.0.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't recall to release backport fixes for previous minor of the spec previously. Do you mean that ?

Probably, this changelog entry could be moved under 3.5.6-next.
As, this PR is setting lower spec versions for these assets, those assets could be defined in the next release without bumping the format_version of the packages. And in other PRs (e.g. #1012) it was done the same.

WDYT ? @jsoriano @teresaromero

If this PR is going to change the minimum spec version for SLO templates, it looks like that this changelog entry should be moved too (currently under 3.6.0-next), shouldn't it?

- description: Add support for Kibana `slo_template` assets
type: enhancement
link: https://github.com/elastic/package-spec/pull/1037

@agithomas agithomas requested a review from kdelemme January 29, 2026 06:13
@agithomas
Copy link
Copy Markdown
Contributor Author

++ @kdelemme, who worked on the PR, to highlight any issues or concerns.

pattern: '^.+\.json$'
versions:
- before: 3.6.0
- before: 3.4.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should it be updated also the content packages ?

- before: 3.6.0
patch:
- op: remove
path: "/contents/2" # remove SLO definitions
- before: 3.5.0
patch:
- op: remove
path: "/contents/4" # remove alerting rule template definitions

Currently, in content packages alert rule templates just can be used from 3.5.0 onwards. It was not changed as part of the #1012

What should we do with slo templates there ? Removed that support for specs <3.5.0 as alert rule templates ?

cc @jsoriano

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reporting this. I have updated the SLO patch to match the alert rule templates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently, in content packages alert rule templates just can be used from 3.5.0 onwards. It was not changed as part of the #1012

All the content packs are presently using 3.5.0 (and we don't have any content packs targeting 8.x stack version) unlike integration packages. Any new content packs will keep this constraint (with stack version 9.2.0). We can keep 3.5.0 for content packs.

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

Copy link
Copy Markdown
Contributor

@teresaromero teresaromero left a comment

Choose a reason for hiding this comment

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

thanks

@mrodm mrodm merged commit 52f8733 into elastic:main Feb 2, 2026
3 checks passed
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.

[slo templates] allow packages targeting 8.x to ship with SLO templates

6 participants