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

[UII] Support content packages in UI #195831

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

jen-huang
Copy link
Contributor

@jen-huang jen-huang commented Oct 10, 2024

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 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
image image

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.

@jen-huang jen-huang self-assigned this Oct 10, 2024
@jen-huang jen-huang added Team:Fleet Team label for Observability Data Collection Fleet team release_note:feature Makes this part of the condensed release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 10, 2024
@@ -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));
Copy link
Contributor Author

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

cc @Omolola-Akinleye

@jen-huang jen-huang marked this pull request as ready for review October 11, 2024 05:22
@jen-huang jen-huang requested a review from a team as a code owner October 11, 2024 05:22
@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 1290 1291 +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 +681.0B
Unknown metric groups

API count

id before after diff
fleet 1413 1414 +1

History

cc @jen-huang

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@jen-huang jen-huang merged commit 9512f6c into elastic:main Oct 15, 2024
25 checks passed
@jen-huang jen-huang deleted the feat/content-packages branch October 15, 2024 17:18
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 195831

Questions ?

Please refer to the Backport tool documentation

@jen-huang
Copy link
Contributor Author

💚 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

jen-huang added a commit to jen-huang/kibana that referenced this pull request Oct 15, 2024
## 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
jen-huang added a commit that referenced this pull request Oct 15, 2024
# 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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Support content packages in integrations UI
4 participants