Skip to content

Commit

Permalink
[8.17] [Fleet] Fix getBulkAssets behavior with missing dashboard (#20…
Browse files Browse the repository at this point in the history
…5619) (#205659)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Fleet] Fix getBulkAssets behavior with missing dashboard
(#205619)](#205619)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Nicolas
Chaulet","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-06T17:59:32Z","message":"[Fleet]
Fix getBulkAssets behavior with missing dashboard
(#205619)","sha":"d00a73c5e59425cdd07689e35ae5424097530fd4","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor","backport:prev-major","v8.18.0"],"title":"[Fleet]
Fix getBulkAssets behavior with missing
dashboard","number":205619,"url":"https://github.com/elastic/kibana/pull/205619","mergeCommit":{"message":"[Fleet]
Fix getBulkAssets behavior with missing dashboard
(#205619)","sha":"d00a73c5e59425cdd07689e35ae5424097530fd4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205619","number":205619,"mergeCommit":{"message":"[Fleet]
Fix getBulkAssets behavior with missing dashboard
(#205619)","sha":"d00a73c5e59425cdd07689e35ae5424097530fd4"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/205640","number":205640,"state":"MERGED","mergeCommit":{"sha":"d4f033b7367eb340d9af567995d06d4957ddc058","message":"[8.x]
[Fleet] Fix getBulkAssets behavior with missing dashboard (#205619)
(#205640)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.x`:\n- [[Fleet] Fix getBulkAssets behavior with missing
dashboard\n(#205619)](https://github.com/elastic/kibana/pull/205619)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Nicolas\nChaulet\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2025-01-06T17:59:32Z\",\"message\":\"[Fleet]\nFix
getBulkAssets behavior with missing
dashboard\n(#205619)\",\"sha\":\"d00a73c5e59425cdd07689e35ae5424097530fd4\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"Team:Fleet\",\"v9.0.0\",\"backport:prev-minor\"],\"title\":\"[Fleet]\nFix
getBulkAssets behavior with
missing\ndashboard\",\"number\":205619,\"url\":\"https://github.com/elastic/kibana/pull/205619\",\"mergeCommit\":{\"message\":\"[Fleet]\nFix
getBulkAssets behavior with missing
dashboard\n(#205619)\",\"sha\":\"d00a73c5e59425cdd07689e35ae5424097530fd4\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/205619\",\"number\":205619,\"mergeCommit\":{\"message\":\"[Fleet]\nFix
getBulkAssets behavior with missing
dashboard\n(#205619)\",\"sha\":\"d00a73c5e59425cdd07689e35ae5424097530fd4\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Nicolas Chaulet <[email protected]>"}}]}] BACKPORT-->

Co-authored-by: Nicolas Chaulet <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent 58562ff commit 5aa4a48
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export async function getBulkAssets(

const res: SimpleSOAssetType[] = resolvedObjects
.map(({ saved_object: savedObject }) => savedObject)
.filter((savedObject) => displayedAssetTypesLookup.has(savedObject.type))
.filter(
(savedObject) =>
savedObject?.error?.statusCode !== 404 && displayedAssetTypesLookup.has(savedObject.type)
)
.map((obj) => {
// Kibana SOs are registered with an app URL getter, so try to use that
// for retrieving links to assets whenever possible
Expand Down

0 comments on commit 5aa4a48

Please sign in to comment.