-
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
[UII] Support content packages in UI #195831
Conversation
@@ -391,7 +391,7 @@ export function useOnSubmit({ | |||
|
|||
// Check if agentless is configured in ESS and Serverless until Agentless API migrates to Serverless | |||
const isAgentlessConfigured = | |||
isAgentlessAgentPolicy(createdPolicy) || isAgentlessPackagePolicy(data!.item); | |||
isAgentlessAgentPolicy(createdPolicy) || (data && isAgentlessPackagePolicy(data.item)); |
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.
when data
is undefined, this line previously prevented error
from being handled and bubbled up to the UI
Pinging @elastic/fleet (Team:Fleet) |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
cc @jen-huang |
...eet/public/applications/integrations/sections/epm/screens/detail/settings/install_button.tsx
Show resolved
Hide resolved
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
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11351109145 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Resolves elastic#192484. This PR adds support for content packages in UI. When a package is of `type: content`: - `Content only` badge is shown on its card in Integrations list, and on header of its details page - `Add integration` button is replaced by `Install assets` button in header - References to agent policies are hidden - Package policy service throws error if attempting to create or bulk create policies for content packages <img width="1403" alt="image" src="https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf"> <img width="1401" alt="image" src="https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba"> ## How to test The only current content package is `kubernetes_otel`. You will need to bump up the max allowed spec version and search with beta (prerelease) packages enabled to find it: ``` xpack.fleet.internal.registry.spec.max: '3.4' ``` Test UI scenarios as above. The API can be tested by running: ``` POST kbn:/api/fleet/package_policies { "policy_ids": [ "" ], "package": { "name": "kubernetes_otel", "version": "0.0.2" }, "name": "kubernetes_otel-1", "description": "", "namespace": "", "inputs": {} } ``` ### Checklist Delete any items that are not applicable to this PR. - [x] 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) - [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 (cherry picked from commit 9512f6c) # Conflicts: # x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx
# Backport This will backport the following commits from `main` to `8.x`: - [[UII] Support content packages in UI (#195831)](#195831) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jen Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T17:18:41Z","message":"[UII] Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves #192484. This PR adds support for content packages in UI. When\r\na package is of `type: content`:\r\n\r\n- `Content only` badge is shown on its card in Integrations list, and on\r\nheader of its details page\r\n- `Add integration` button is replaced by `Install assets` button in\r\nheader\r\n- References to agent policies are hidden\r\n- Package policy service throws error if attempting to create or bulk\r\ncreate policies for content packages\r\n\r\n<img width=\"1403\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img width=\"1401\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n## How to test\r\nThe only current content package is `kubernetes_otel`. You will need to\r\nbump up the max allowed spec version and search with beta (prerelease)\r\npackages enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max: '3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n \"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\": \"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\": \"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\": \"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] 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- [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","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Fleet","v9.0.0","release_note:feature","backport:prev-minor"],"number":195831,"url":"https://github.com/elastic/kibana/pull/195831","mergeCommit":{"message":"[UII] Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves #192484. This PR adds support for content packages in UI. When\r\na package is of `type: content`:\r\n\r\n- `Content only` badge is shown on its card in Integrations list, and on\r\nheader of its details page\r\n- `Add integration` button is replaced by `Install assets` button in\r\nheader\r\n- References to agent policies are hidden\r\n- Package policy service throws error if attempting to create or bulk\r\ncreate policies for content packages\r\n\r\n<img width=\"1403\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img width=\"1401\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n## How to test\r\nThe only current content package is `kubernetes_otel`. You will need to\r\nbump up the max allowed spec version and search with beta (prerelease)\r\npackages enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max: '3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n \"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\": \"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\": \"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\": \"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] 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- [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","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195831","number":195831,"mergeCommit":{"message":"[UII] Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves #192484. This PR adds support for content packages in UI. When\r\na package is of `type: content`:\r\n\r\n- `Content only` badge is shown on its card in Integrations list, and on\r\nheader of its details page\r\n- `Add integration` button is replaced by `Install assets` button in\r\nheader\r\n- References to agent policies are hidden\r\n- Package policy service throws error if attempting to create or bulk\r\ncreate policies for content packages\r\n\r\n<img width=\"1403\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img width=\"1401\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n## How to test\r\nThe only current content package is `kubernetes_otel`. You will need to\r\nbump up the max allowed spec version and search with beta (prerelease)\r\npackages enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max: '3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n \"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\": \"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\": \"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\": \"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete any items that are not applicable to this PR.\r\n\r\n- [x] 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- [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","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181"}}]}] BACKPORT-->
Summary
Resolves #192484. This PR adds support for content packages in UI. When a package is of
type: content
:Content only
badge is shown on its card in Integrations list, and on header of its details pageAdd integration
button is replaced byInstall assets
button in headerHow to test
The only current content package is
kubernetes_otel
. You will need to bump up the max allowed spec version and search with beta (prerelease) packages enabled to find it:Test UI scenarios as above. The API can be tested by running:
Checklist
Delete any items that are not applicable to this PR.