Skip to content
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] Filter integrations/packages list shown depending on the policy_templates_behavior field #200605

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

mrodm
Copy link
Contributor

@mrodm mrodm commented Nov 18, 2024

Summary

Closes #198145

Add support to filter the tiles shown in the integrations UI as well as the packages shown in the global search provider depending on the policy_templates_behaviour field introduced in elastic/package-spec#802.

If this new field is not present in the package manifest, the same behavior is kept. Therefore, it is shown a tile for the package itself plus a tile for each policy template defined in the manifest.

Tested using a custom Elastic Package Registry with some packages defining this new policy_templates_behavior via the key:

xpack.fleet.registryUrl: http://localhost:8080

Screenshots

Checked option "Elastic Agent only" in the integrations UI to avoid tutorials based on Beats.

Example with azure_metrics package in the Integrations UI:

  • policy_templates_behavior: all
    All policy templates

  • policy_templates_behavior: combined_policy
    Just combined policy

  • policy_templates_behavior: individual_policies
    Just individual policy templates

Example in the Global Search with azure_metrics package and combined policy behavior:
global search with azure metrics package

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_node:* label is applied per the guidelines

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

  • [ ]

@mrodm mrodm added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 18, 2024
@mrodm mrodm self-assigned this Nov 18, 2024
@mrodm
Copy link
Contributor Author

mrodm commented Nov 19, 2024

@kpollich Should this PR be backported too ? What label should I set here?

@mrodm mrodm marked this pull request as ready for review November 19, 2024 10:32
@mrodm mrodm requested a review from a team as a code owner November 19, 2024 10:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1302 1303 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.7MB 1.7MB +52.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 174.1KB 174.3KB +253.0B
Unknown metric groups

API count

id before after diff
fleet 1427 1428 +1

History

cc @mrodm

@kpollich
Copy link
Member

@kpollich Should this PR be backported too ? What label should I set here?

I think we can safely backport this to 8.17, so I'll add prev-minor. cc @seanstory this behavior to tweak the rendering of the individual policy template cards would be available in 8.17.

@kpollich kpollich added the backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) label Nov 19, 2024
Copy link
Member

@nchaulet nchaulet 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 🚀

@mrodm mrodm merged commit 8352b86 into elastic:main Nov 19, 2024
25 checks passed
@mrodm mrodm deleted the filter_tiles_depending_on_behavior_field branch November 19, 2024 14:27
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 19, 2024
…icy_templates_behavior` field (elastic#200605)

## Summary
Closes elastic#198145

Add support to filter the tiles shown in the integrations UI as well as
the packages shown in the global search provider depending on the
`policy_templates_behaviour` field introduced in
elastic/package-spec#802.

If this new field is not present in the package manifest, the same
behavior is kept. Therefore, it is shown a tile for the package itself
plus a tile for each policy template defined in the manifest.

Tested using a custom Elastic Package Registry with some packages
defining this new `policy_templates_behavior` via the key:
```yaml
xpack.fleet.registryUrl: http://localhost:8080
```

### Screenshots

Checked option "Elastic Agent only" in the integrations UI to avoid
tutorials based on Beats.

Example with `azure_metrics` package in the Integrations UI:
- `policy_templates_behavior: all`
![All policy
templates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)

- `policy_templates_behavior: combined_policy`
![Just combined
policy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)

- `policy_templates_behavior: individual_policies`
![Just individual policy
templates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)

Example in the Global Search with `azure_metrics` package and `combined
policy` behavior:
![global search with azure metrics
package](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ]

(cherry picked from commit 8352b86)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Nov 19, 2024
…e `policy_templates_behavior` field (#200605) (#200749)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Filter integrations/packages list shown depending on the
`policy_templates_behavior` field
(#200605)](#200605)

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

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

<!--BACKPORT [{"author":{"name":"Mario Rodriguez
Molins","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-19T14:27:19Z","message":"[Fleet]
Filter integrations/packages list shown depending on the
`policy_templates_behavior` field (#200605)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/198145\r\n\r\nAdd support to
filter the tiles shown in the integrations UI as well as\r\nthe packages
shown in the global search provider depending on
the\r\n`policy_templates_behaviour` field introduced
in\r\nhttps://github.com/elastic/package-spec/issues/802.\r\n\r\nIf this
new field is not present in the package manifest, the same\r\nbehavior
is kept. Therefore, it is shown a tile for the package itself\r\nplus a
tile for each policy template defined in the manifest.\r\n\r\n\r\nTested
using a custom Elastic Package Registry with some packages\r\ndefining
this new `policy_templates_behavior` via the
key:\r\n```yaml\r\nxpack.fleet.registryUrl:
http://localhost:8080\r\n```\r\n\r\n### Screenshots\r\n\r\nChecked
option \"Elastic Agent only\" in the integrations UI to
avoid\r\ntutorials based on Beats.\r\n\r\nExample with `azure_metrics`
package in the Integrations UI:\r\n- `policy_templates_behavior:
all`\r\n![All
policy\r\ntemplates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)\r\n\r\n-
`policy_templates_behavior: combined_policy`\r\n![Just
combined\r\npolicy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)\r\n\r\n-
`policy_templates_behavior: individual_policies`\r\n![Just individual
policy\r\ntemplates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)\r\n\r\n\r\nExample
in the Global Search with `azure_metrics` package and
`combined\r\npolicy` behavior:\r\n![global search with azure
metrics\r\npackage](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [
]","sha":"8352b86f59522319f6d20ae2165d11b621f1f22b","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Fleet","v9.0.0","backport:prev-minor"],"title":"[Fleet]
Filter integrations/packages list shown depending on the
`policy_templates_behavior`
field","number":200605,"url":"https://github.com/elastic/kibana/pull/200605","mergeCommit":{"message":"[Fleet]
Filter integrations/packages list shown depending on the
`policy_templates_behavior` field (#200605)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/198145\r\n\r\nAdd support to
filter the tiles shown in the integrations UI as well as\r\nthe packages
shown in the global search provider depending on
the\r\n`policy_templates_behaviour` field introduced
in\r\nhttps://github.com/elastic/package-spec/issues/802.\r\n\r\nIf this
new field is not present in the package manifest, the same\r\nbehavior
is kept. Therefore, it is shown a tile for the package itself\r\nplus a
tile for each policy template defined in the manifest.\r\n\r\n\r\nTested
using a custom Elastic Package Registry with some packages\r\ndefining
this new `policy_templates_behavior` via the
key:\r\n```yaml\r\nxpack.fleet.registryUrl:
http://localhost:8080\r\n```\r\n\r\n### Screenshots\r\n\r\nChecked
option \"Elastic Agent only\" in the integrations UI to
avoid\r\ntutorials based on Beats.\r\n\r\nExample with `azure_metrics`
package in the Integrations UI:\r\n- `policy_templates_behavior:
all`\r\n![All
policy\r\ntemplates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)\r\n\r\n-
`policy_templates_behavior: combined_policy`\r\n![Just
combined\r\npolicy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)\r\n\r\n-
`policy_templates_behavior: individual_policies`\r\n![Just individual
policy\r\ntemplates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)\r\n\r\n\r\nExample
in the Global Search with `azure_metrics` package and
`combined\r\npolicy` behavior:\r\n![global search with azure
metrics\r\npackage](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [
]","sha":"8352b86f59522319f6d20ae2165d11b621f1f22b"}},"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/200605","number":200605,"mergeCommit":{"message":"[Fleet]
Filter integrations/packages list shown depending on the
`policy_templates_behavior` field (#200605)\n\n## Summary\r\nCloses
https://github.com/elastic/kibana/issues/198145\r\n\r\nAdd support to
filter the tiles shown in the integrations UI as well as\r\nthe packages
shown in the global search provider depending on
the\r\n`policy_templates_behaviour` field introduced
in\r\nhttps://github.com/elastic/package-spec/issues/802.\r\n\r\nIf this
new field is not present in the package manifest, the same\r\nbehavior
is kept. Therefore, it is shown a tile for the package itself\r\nplus a
tile for each policy template defined in the manifest.\r\n\r\n\r\nTested
using a custom Elastic Package Registry with some packages\r\ndefining
this new `policy_templates_behavior` via the
key:\r\n```yaml\r\nxpack.fleet.registryUrl:
http://localhost:8080\r\n```\r\n\r\n### Screenshots\r\n\r\nChecked
option \"Elastic Agent only\" in the integrations UI to
avoid\r\ntutorials based on Beats.\r\n\r\nExample with `azure_metrics`
package in the Integrations UI:\r\n- `policy_templates_behavior:
all`\r\n![All
policy\r\ntemplates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)\r\n\r\n-
`policy_templates_behavior: combined_policy`\r\n![Just
combined\r\npolicy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)\r\n\r\n-
`policy_templates_behavior: individual_policies`\r\n![Just individual
policy\r\ntemplates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)\r\n\r\n\r\nExample
in the Global Search with `azure_metrics` package and
`combined\r\npolicy` behavior:\r\n![global search with azure
metrics\r\npackage](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)\r\n\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [ ] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[
]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] If a plugin
configuration key changed, check if it needs to be\r\nallowlisted in the
cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\r\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\r\nchanges have been approved by the breaking-change committee.
The\r\n`release_note:breaking` label should be applied in these
situations.\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] The PR description includes
the appropriate Release Notes section,\r\nand the correct
`release_node:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n###
Identify risks\r\n\r\nDoes this PR introduce any risks? For example,
consider risks like hard\r\nto test bugs, performance regression,
potential of data loss.\r\n\r\nDescribe the risk, its severity, and
mitigation for each identified\r\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\r\n\r\n- [
]","sha":"8352b86f59522319f6d20ae2165d11b621f1f22b"}}]}] BACKPORT-->

---------

Co-authored-by: Mario Rodriguez Molins <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…icy_templates_behavior` field (elastic#200605)

## Summary
Closes elastic#198145

Add support to filter the tiles shown in the integrations UI as well as
the packages shown in the global search provider depending on the
`policy_templates_behaviour` field introduced in
elastic/package-spec#802.

If this new field is not present in the package manifest, the same
behavior is kept. Therefore, it is shown a tile for the package itself
plus a tile for each policy template defined in the manifest.


Tested using a custom Elastic Package Registry with some packages
defining this new `policy_templates_behavior` via the key:
```yaml
xpack.fleet.registryUrl: http://localhost:8080
```

### Screenshots

Checked option "Elastic Agent only" in the integrations UI to avoid
tutorials based on Beats.

Example with `azure_metrics` package in the Integrations UI:
- `policy_templates_behavior: all`
![All policy
templates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)

- `policy_templates_behavior: combined_policy`
![Just combined
policy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)

- `policy_templates_behavior: individual_policies`
![Just individual policy
templates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)


Example in the Global Search with `azure_metrics` package and `combined
policy` behavior:
![global search with azure metrics
package](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ]
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…icy_templates_behavior` field (elastic#200605)

## Summary
Closes elastic#198145

Add support to filter the tiles shown in the integrations UI as well as
the packages shown in the global search provider depending on the
`policy_templates_behaviour` field introduced in
elastic/package-spec#802.

If this new field is not present in the package manifest, the same
behavior is kept. Therefore, it is shown a tile for the package itself
plus a tile for each policy template defined in the manifest.


Tested using a custom Elastic Package Registry with some packages
defining this new `policy_templates_behavior` via the key:
```yaml
xpack.fleet.registryUrl: http://localhost:8080
```

### Screenshots

Checked option "Elastic Agent only" in the integrations UI to avoid
tutorials based on Beats.

Example with `azure_metrics` package in the Integrations UI:
- `policy_templates_behavior: all`
![All policy
templates](https://github.com/user-attachments/assets/907618e3-f2db-44df-b1ac-3965b1978b2c)

- `policy_templates_behavior: combined_policy`
![Just combined
policy](https://github.com/user-attachments/assets/77293616-8125-4d01-81f3-b3f17135ca49)

- `policy_templates_behavior: individual_policies`
![Just individual policy
templates](https://github.com/user-attachments/assets/b68ad474-8aac-464b-9946-9ae6104dd2ae)


Example in the Global Search with `azure_metrics` package and `combined
policy` behavior:
![global search with azure metrics
package](https://github.com/user-attachments/assets/e70315b7-d303-4b32-aa9e-8e1e9b056239)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_node:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v8.17.0 v9.0.0
Projects
None yet
5 participants