[Fleet] Replace call to registry when deleting kibana assets for custom packages#224886
[Fleet] Replace call to registry when deleting kibana assets for custom packages#224886criamico merged 6 commits intoelastic:mainfrom
Conversation
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
cc @criamico |
|
@elasticmachine merge upstream |
| pkgName: name, | ||
| pkgVersion: version, | ||
| skipArchive: installSource !== 'registry', | ||
| }); |
There was a problem hiding this comment.
This is the main fix: used getPackageInfo instead of calling the registry.
| pkgName: installedPkg.attributes.name, | ||
| pkgVersion: installedPkg.attributes.version, | ||
| skipArchive: installedPkg.attributes.install_source !== 'registry', | ||
| }); |
There was a problem hiding this comment.
Replacing it also here, it is a different code path but this way we ensure that packages that it doesn't error for packages not installed from registry.
|
Pinging @elastic/fleet (Team:Fleet) |
|
Starting backport for target branches: 9.0 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Starting backport for target branches: 9.0 |
|
Starting backport for target branches: 9.0 |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
1 similar comment
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…om packages (elastic#224886) Fixes elastic#224191 ## Summary Bugfix - Replace call to registry when deleting kibana assets for packages of type "custom" and "bundled". Also replaced the call to `fetchInfo.registry` on another code path to avoid errors in the same situation - - These calls are replaced with `getPackageInfo`, that has some internal functionalities to decide when the packageInfo should be fetched from the cache, ES or the registry. - Added additional logging to the delete assets functions ### Testing - Install a custom integration that has some assets (a dashboard for instance) - Uninstall it and check that the asset is correctly removed and there are no errors: <img width="1453" alt="Screenshot 2025-06-25 at 11 02 39" src="https://github.com/user-attachments/assets/32fb07f3-2628-4e30-be92-16610043b3ae" /> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 550b9d5) # Conflicts: # x-pack/platform/plugins/shared/fleet/server/services/epm/kibana/assets/install.ts # x-pack/platform/plugins/shared/fleet/server/services/epm/packages/remove.ts
…r custom packages (#224886) (#225288) # Backport This will backport the following commits from `main` to `9.0`: - [[Fleet] Replace call to registry when deleting kibana assets for custom packages (#224886)](#224886) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-25T12:21:41Z","message":"[Fleet] Replace call to registry when deleting kibana assets for custom packages (#224886)\n\nFixes https://github.com/elastic/kibana/issues/224191\n\n## Summary\n\nBugfix - Replace call to registry when deleting kibana assets for\npackages of type \"custom\" and \"bundled\". Also replaced the call to\n`fetchInfo.registry` on another code path to avoid errors in the same\nsituation -\n- These calls are replaced with `getPackageInfo`, that has some internal\nfunctionalities to decide when the packageInfo should be fetched from\nthe cache, ES or the registry.\n- Added additional logging to the delete assets functions\n\n### Testing\n- Install a custom integration that has some assets (a dashboard for\ninstance)\n- Uninstall it and check that the asset is correctly removed and there\nare no errors:\n\n<img width=\"1453\" alt=\"Screenshot 2025-06-25 at 11 02 39\"\nsrc=\"https://github.com/user-attachments/assets/32fb07f3-2628-4e30-be92-16610043b3ae\"\n/>\n\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"550b9d58eab13c9ba46615808330e0579c44ce65","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v9.1.0"],"title":"[Fleet] Replace call to registry when deleting kibana assets for custom packages","number":224886,"url":"https://github.com/elastic/kibana/pull/224886","mergeCommit":{"message":"[Fleet] Replace call to registry when deleting kibana assets for custom packages (#224886)\n\nFixes https://github.com/elastic/kibana/issues/224191\n\n## Summary\n\nBugfix - Replace call to registry when deleting kibana assets for\npackages of type \"custom\" and \"bundled\". Also replaced the call to\n`fetchInfo.registry` on another code path to avoid errors in the same\nsituation -\n- These calls are replaced with `getPackageInfo`, that has some internal\nfunctionalities to decide when the packageInfo should be fetched from\nthe cache, ES or the registry.\n- Added additional logging to the delete assets functions\n\n### Testing\n- Install a custom integration that has some assets (a dashboard for\ninstance)\n- Uninstall it and check that the asset is correctly removed and there\nare no errors:\n\n<img width=\"1453\" alt=\"Screenshot 2025-06-25 at 11 02 39\"\nsrc=\"https://github.com/user-attachments/assets/32fb07f3-2628-4e30-be92-16610043b3ae\"\n/>\n\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"550b9d58eab13c9ba46615808330e0579c44ce65"}},"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/224886","number":224886,"mergeCommit":{"message":"[Fleet] Replace call to registry when deleting kibana assets for custom packages (#224886)\n\nFixes https://github.com/elastic/kibana/issues/224191\n\n## Summary\n\nBugfix - Replace call to registry when deleting kibana assets for\npackages of type \"custom\" and \"bundled\". Also replaced the call to\n`fetchInfo.registry` on another code path to avoid errors in the same\nsituation -\n- These calls are replaced with `getPackageInfo`, that has some internal\nfunctionalities to decide when the packageInfo should be fetched from\nthe cache, ES or the registry.\n- Added additional logging to the delete assets functions\n\n### Testing\n- Install a custom integration that has some assets (a dashboard for\ninstance)\n- Uninstall it and check that the asset is correctly removed and there\nare no errors:\n\n<img width=\"1453\" alt=\"Screenshot 2025-06-25 at 11 02 39\"\nsrc=\"https://github.com/user-attachments/assets/32fb07f3-2628-4e30-be92-16610043b3ae\"\n/>\n\n\n### Checklist\n\n- [ ] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"550b9d58eab13c9ba46615808330e0579c44ce65"}}]}] BACKPORT-->
Fixes #224191
Summary
Bugfix - Replace call to registry when deleting kibana assets for packages of type "custom" and "bundled". Also replaced the call to
fetchInfo.registryon another code path to avoid errors in the same situation -getPackageInfo, that has some internal functionalities to decide when the packageInfo should be fetched from the cache, ES or the registry.Testing
Checklist