Skip to content

[Fleet] Never delete @custom component templates#214232

Merged
nchaulet merged 1 commit intoelastic:mainfrom
nchaulet:feature-do-not-delete-custom
Mar 12, 2025
Merged

[Fleet] Never delete @custom component templates#214232
nchaulet merged 1 commit intoelastic:mainfrom
nchaulet:feature-do-not-delete-custom

Conversation

@nchaulet
Copy link
Member

@nchaulet nchaulet commented Mar 12, 2025

Summary

Resolve #212518

That PR update the code that delete component template on package removal to make sure we never delete user custom component template ( template ending with `@custom)

Test

You can create some @custom component template for your package and check they are not deleted.
I added some unit tests.

I think we should backport this to 8.18 and 9.0 as it seems a really weird behaviour to delete user component templates, especially global ones likes logs@custom

@nchaulet nchaulet added Team:Fleet Team label for Observability Data Collection Fleet team backport:prev-minor labels Mar 12, 2025
@nchaulet nchaulet self-assigned this Mar 12, 2025
@nchaulet nchaulet requested a review from a team as a code owner March 12, 2025 16:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet added the release_note:skip Skip the PR/issue when compiling release notes label Mar 12, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @nchaulet

@kpollich
Copy link
Member

I think we should backport this to 8.18 and 9.0 as it seems a really weird behaviour to delete user component templates, especially global ones likes logs@custom

+1 let's backport this.

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Code LGTM 🚀

++ on backporting to all open branches

@nchaulet nchaulet merged commit fc64501 into elastic:main Mar 12, 2025
19 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.0

https://github.com/elastic/kibana/actions/runs/13820392629

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 12, 2025
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.0

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 Mar 12, 2025
…4279)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Fleet] Never delete @Custom component templates
(#214232)](#214232)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-03-12T19:58:40Z","message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v9.1.0","backport:8.18"],"title":"[Fleet]
Never delete @Custom component
templates","number":214232,"url":"https://github.com/elastic/kibana/pull/214232","mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214232","number":214232,"mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}}]}]
BACKPORT-->

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
@nchaulet nchaulet added backport:version Backport to applied version labels v8.18.1 labels Mar 12, 2025
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 9.0

https://github.com/elastic/kibana/actions/runs/13822257272

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 12, 2025
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.18
9.0 Cherrypick failed because the selected commit (fc64501) is empty. It looks like the commit was already backported in #214279

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 214232

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 13, 2025
…14289)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Fleet] Never delete @Custom component templates
(#214232)](#214232)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-03-12T19:58:40Z","message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor","backport:version","v9.1.0","backport:8.18","v8.18.1"],"title":"[Fleet]
Never delete @Custom component
templates","number":214232,"url":"https://github.com/elastic/kibana/pull/214232","mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}},"sourceBranch":"main","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214279","number":214279,"state":"MERGED","mergeCommit":{"sha":"ffc575724f73009d5d564b7c896ab162e7880c4e","message":"[9.0]
[Fleet] Never delete @Custom component templates (#214232)
(#214279)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Fleet] Never delete @Custom component
templates\n(#214232)](https://github.com/elastic/kibana/pull/214232)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Nicolas Chaulet
<nicolas.chaulet@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214232","number":214232,"mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
@kpollich
Copy link
Member

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

nchaulet added a commit that referenced this pull request Jan 12, 2026
kpollich added a commit that referenced this pull request Jan 13, 2026
…48736)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Fleet] Never delete @Custom component templates
(#214232)](#214232)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2025-03-12T19:58:40Z","message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.18.1","v8.19.10"],"title":"[Fleet]
Never delete @Custom component
templates","number":214232,"url":"https://github.com/elastic/kibana/pull/214232","mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214279","number":214279,"state":"MERGED","mergeCommit":{"sha":"ffc575724f73009d5d564b7c896ab162e7880c4e","message":"[9.0]
[Fleet] Never delete @Custom component templates (#214232)
(#214279)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Fleet] Never delete @Custom component
templates\n(#214232)](https://github.com/elastic/kibana/pull/214232)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Nicolas Chaulet
<nicolas.chaulet@elastic.co>"}},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214289","number":214289,"state":"MERGED","mergeCommit":{"sha":"e1b94117642e9a1a59773612a1cdf85b67247472","message":"[8.18]
[Fleet] Never delete @Custom component templates (#214232)
(#214289)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.18`:\n- [[Fleet] Never delete @Custom component
templates\n(#214232)](https://github.com/elastic/kibana/pull/214232)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\n---------\n\nCo-authored-by:
Nicolas Chaulet
<nicolas.chaulet@elastic.co>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214232","number":214232,"mergeCommit":{"message":"[Fleet]
Never delete @Custom component templates
(#214232)","sha":"fc64501577284038eef59bb8fc37ea4d80b49827"}},{"branch":"8.19","label":"v8.19.10","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.18.0 v8.18.1 v8.19.10 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] Removing a package delete logs@custom

5 participants