-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Include ID field in packages on get/create #100908
[Fleet] Include ID field in packages on get/create #100908
Conversation
Pinging @elastic/fleet (Team:Fleet) |
/run-fleet-e2e-tests |
@@ -36,6 +36,7 @@ const PackagePolicyBaseSchema = { | |||
enabled: schema.boolean(), | |||
package: schema.maybe( | |||
schema.object({ | |||
id: schema.string(), |
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.
should we have a schema.maybe()
for retro compatibility ?
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.
Yes good call.
@@ -126,6 +126,7 @@ export async function getPackageInfo(options: { | |||
title: packageInfo.title || nameAsTitle(packageInfo.name), | |||
assets: Registry.groupPathsByService(paths || []), | |||
removable: !isRequiredPackage(pkgName), | |||
id: packageInfo.name, |
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 mimics the behavior in the list endpoint: https://github.com/elastic/kibana/blob/master/x-pack/plugins/fleet/server/services/epm/packages/get.ts#L51
@@ -224,6 +224,7 @@ const getSavedObjectTypes = ( | |||
output_id: { type: 'keyword' }, | |||
package: { | |||
properties: { | |||
id: { type: 'keyword' }, |
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.
Does touching these saved object mappings require anything else? Is this what migrations are for? We don't necessarily have to persist this ID, and we could instead just implement a workaround to allow it at the request/response level.
E2E tests are failing because they include the ID field returned by the package list endpoint. This just updates our request schema to accept an ID, though we don't persist or deal with the ID anywhere. Closes elastic#100897
61bc055
to
9fb470f
Compare
After tracking down a bunch of type issues where we reference package objects, it seemed better to just fix the immediate issue with the E2E tests instead, so I've updated the approach in this PR to just avoid erroring when an ID is provided in the create package policy request body. |
/run-fleet-e2e-tests |
@mdelapenya I kicked off the E2E tests and it seems like they're still failing. I'm seeing 22 failures on https://beats-ci.elastic.co/blue/organizations/jenkins/e2e-tests%2Fe2e-testing-mbp/detail/master/927/tests - maybe I'm looking in the wrong place or misunderstanding? |
Let me debug this |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @kpollich |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
E2E tests are failing because they include the ID field returned by the package list endpoint. This just updates our request schema to accept an ID, though we don't persist or deal with the ID anywhere. Closes elastic#100897 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
E2E tests are failing because they include the ID field returned by the package list endpoint. This just updates our request schema to accept an ID, though we don't persist or deal with the ID anywhere. Closes #100897 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kyle Pollich <kyle.pollich@elastic.co>
Add
id
field for packages in info/create requestsCloses #100897
Fixes error in E2E tests reported here: #99866 (comment)