-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] added support for installing tag saved objects #114110
Conversation
Pinging @elastic/fleet (Team:Fleet) |
...leet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/kibana/tags/sampe_tag.json
Outdated
Show resolved
Hide resolved
type: 'tags', | ||
id: 'sample_tag', | ||
}); | ||
expect(resTags.id).equal('sample_tag'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is failing locally, investigating
debg Gettings saved object: {"type":"tags","id":"sample_tag"} └- ✖ fail: Fleet Endpoints EPM Endpoints installs and uninstalls all assets reinstalls all assets should have installed the kibana assets │ Error: Request failed with status code 404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be because of the type being tags
instead of tag
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be, let me update to tag
@@ -53,6 +54,7 @@ export const AssetIcons: Record<KibanaAssetType, IconType> = { | |||
lens: 'lensApp', | |||
security_rule: 'securityApp', | |||
ml_module: 'mlApp', | |||
tag: 'tagApp', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the changes from here, though I think these constants are not yet used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, just a couple notes:
- Let's add the sample tag to the sample dashboard in the all_assets package so that we can test this integration. This can be done by adding
{ "id": "sample_tag", "type": "tag", "name": "tag-ref-sample_tag" }
to thereferences
array in thesample_dashboard.json
file. We can then add an assertion to the api integration test that the dashboard has the associated tag. - We may also want to add some UI for linking to the associated tag on the "Assets" tab of the Integration Details view
- This is handled by
x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets_accordion.tsx
- Unfortunately, it doesn't appear that the Tags UI supports linking to an individual tag or filtering the list by a URL query parameter.
- @mostlyjason do you think we should:
- Link to the overall tag page
/app/management/kibana/tags
- Include the tag in the asset list, but don't link anywhere
- Don't add the tag to the asset list at all right now, file an issue for adding support for linking to an individual tag
- Link to the overall tag page
x-pack/plugins/fleet/public/applications/integrations/sections/epm/constants.tsx
Outdated
Show resolved
Hide resolved
...fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/kibana/tag/sampe_tag.json
Outdated
Show resolved
Hide resolved
@joshdover How did you bring up All Assets on UI? |
I did the following:
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For posterity's sake, Julia and I discussed deferring any changes to the Asset tab since there is not a direct page to link to and not all assets are currently represented in this page currently.
Ah, I just saw the spec update for tags, and I wonder if we need to update the logic to only read files that begin with the package name as specified here: https://github.com/elastic/package-spec/blob/1e17043c2cf746e7c0168594e51824c903c00e35/versions/1/kibana/spec.yml#L94 @mtojek is that the correct behavior? To only accept tags that are named |
Adding a comment here as I didn't have the time to approve before the merge, I tested the branch locally and followed @joshdover steps and it worked fine for me. |
* added tag saved objects to assets * fixed review comments * added translation to constants * added missing icon type Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
@joshdover how would that look like? a modified version of installKibanaSavedObjects to filter out assets that are not adhering to the file naming in the spec? |
@joshdover I can explain why there is the PACKAGE_NAME prefix. Two different packages install their assets and it may happen that they both refer to the same "magic-asset-1". In this case the first installed one will be overridden with the other one, so we want to prevent it using package name prefixes. |
@joshdover do we have to do anything here or can we close the issue? |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
3 similar comments
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Can you file a new issue to update this for all assets to ensure that packages do not step on one another? For now, we can rely on the package spec to enforce this for us. |
@joshdover raised this: #115386 |
#114446) * [Fleet] added support for installing tag saved objects (#114110) * added tag saved objects to assets * fixed review comments * added translation to constants * added missing icon type Co-authored-by: Kibana Machine <[email protected]> * fixed backport Co-authored-by: juliaElastic <[email protected]> Co-authored-by: Julia Bardi <[email protected]>
Summary
Solves #110660
Checklist