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] Create shared package policy #185916

Merged
merged 10 commits into from
Jun 12, 2024

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Jun 11, 2024

Summary

Closes https://github.com/elastic/ingest-dev/issues/3263

Added multi-select agent policy component to Add integration policy page.

Steps to verify

To verify:

  • Enable feature flag by adding xpack.fleet.enableExperimental: ['enableReusableIntegrationPolicies'] to kibana.dev.yml locally
  • Create a few agent policies
  • Open Integrations UI, click on Add integration
  • Go to Existing hosts tab at the bottom
  • Verify that the agent policy selector support multiple selection
  • Verify that all selected agent policy ids are included in the API request (check with Preview API Request button)
image

Logstash output restriction

There are a few scenarios where agent policy selection is restricted.

  • Add logstash output to one of the agent policies
  • Try to add APM integration policy
  • Verify that agent policy with logstash output is disabled
  • The new EuiComboBox component doesn't support a multiline custom option rendering, so added a warning icon with a tooltip instead.
image

Existing UI with EuiSuperSelect:

image

Limited packages restriction

The other restrictions don't allow limited packages to be added twice to an agent policy: endpoint, osquery.
Test by adding osquery_manager to one agent policy, and then try to add another integration policy to the same agent policy. It should be disabled.

image

Agent policies used by agents

The UI shows the sum of agents enrolled to the selected agent policies

image

The Preview API Request feature should keep the policy_ids list in sync when adding/removing agent policies.

image

The confirmation modal should also show a sum of enrolled agents and list of selected agent policies.

image

Checklist

@juliaElastic juliaElastic added the release_note:feature Makes this part of the condensed release notes label Jun 11, 2024
@juliaElastic juliaElastic self-assigned this Jun 11, 2024
@juliaElastic juliaElastic requested review from a team as code owners June 11, 2024 08:31
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jun 11, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

juliaElastic and others added 2 commits June 11, 2024 14:34
…policy/create_package_policy_page/components/steps/step_select_agent_policy.tsx

Co-authored-by: Kyle Pollich <kpollich1@gmail.com>
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.

Followed the test instructions and it worked as expected LGTM 🚀

}, [agentPolicyMultiOptions, selectedPolicyIds]);

const [selected, setSelected] = React.useState<any>(selectedOptions);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need that state cannot we use selectedOptions directly? changing selectedPolicyIds should update it no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, it's not necessary, updated.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

The CI Stats report is too large to be displayed here, check out the CI build annotation for this information.

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @juliaElastic

@juliaElastic juliaElastic merged commit 74738c0 into elastic:main Jun 12, 2024
20 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jun 12, 2024
criamico added a commit that referenced this pull request Jun 14, 2024
Closes #182111

## Summary
 Show multiple agent policies in integrations table.

## Testing
- Enable feature flag `enableReusableIntegrationPolicies`
- Install an integration that has more than one agent policies
associated with it (instructions are
[here](#185916))
- Navigate to integrations table and verify that the policy displays a
badge with the number of associated policies -1 and that it opens up a
popover, like in below screenshots.

**NOTE** the button "Manage agent policies" does not work for now, as
the feature is under development and it's hidden with a feature flag!

### With feature flag enabled, when integration has multiple agent
policies

![Screenshot 2024-06-12 at 15 49
34](https://github.com/elastic/kibana/assets/16084106/bd8a4e6a-a752-46bb-8003-a4e875d0fa93)

![Screenshot 2024-06-12 at 15 46
38](https://github.com/elastic/kibana/assets/16084106/f93a91bc-bae7-40a0-8425-ac2dbbcaeae4)

When one of the policies is managed:
![Screenshot 2024-06-13 at 11 30
01](https://github.com/elastic/kibana/assets/16084106/3ba0d5cb-4af1-46e5-875a-d4391c79ad6d)


### When feature flag not enabled or integration has only one agent
policy

The UI remains as it is today:
![Screenshot 2024-06-12 at 15 48
56](https://github.com/elastic/kibana/assets/16084106/14122ad3-d4f8-448a-b4b3-6f08900ba833)


### Checklist

- [ ] 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)
- [ ] [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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants