-
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
[Fleet] using @kbn/config-schema part 2 (outputs and other apis) #193326
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/fleet (Team:Fleet) |
@@ -10,8 +10,8 @@ import { schema } from '@kbn/config-schema'; | |||
export const genericErrorResponse = () => | |||
schema.object( | |||
{ | |||
statusCode: schema.number(), | |||
error: schema.string(), | |||
statusCode: schema.maybe(schema.number()), |
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.
@@ -131,7 +131,7 @@ paths: | |||
type: string | |||
required: | |||
- note | |||
description: 'The note to add or update, along with additional metadata.' | |||
description: The note to add or update, along with additional metadata. |
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.
these changes are coming from an auto commit
561ff93
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.
code LGTM for the Threat Hunting Investigations team, though it seems that the changes have already been merged by this PR
@juliaElastic I'm testing the branch locally and found an issue related to outputs. This happens when trying to update an output from a type to another, in my case I had a Kafka output like this:
Then I tried to change it to a logstash one filling out only the required fields: I also tried saving it as ES output and this time it fails with this error: So I think there are generally issues with switching the type of output. |
Thanks for testing, it seems when changing output type, the previous output type fields are set to null, not removed, and it fails schema validation. Checking how to fix the logic. So the fields are set to null to reset them, because that's how we can reset them when updating an SO. (removing a field from the updated object would not modify the field in the doc when updating).
I think I'm going to go with the first solution to get this resolved, we can create a follow up to make a more involved solution.
Should be fixed now in the latest commit. |
Yes I think it's fine to use this solution for now and have a follow up to reevaluate it in the future |
@juliaElastic I tested locally again different cases of switching output type and works fine. Do you think it would be possible to add at least a test covering such a scenario? |
Added a null field to the unit test here, I could add a more complete test too. |
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 🚀 Thanks for adding the tests!
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* main: (176 commits) [ML][Rules] Fixes deletion in Check interval input for anomaly detection rule (elastic#193420) Bump maximum supported package spec version to 3.2 (elastic#193574) [ES|QL] new pattern for `SORT` autocomplete (elastic#193595) [Inventory][ECO] Entities page search bar (elastic#193546) [Synthetics] Remove extra overview route (elastic#192449) [Obs Alerts table] Fix error on clicking alert reason message (elastic#193693) [Migrations] Remove tests that are not applicable in 9.x (elastic#193699) [EDR Workflows] Set Agent Tamper Protection to false on policy unassignment (elastic#193017) [Inventory][ECO] Enable elastic entity model from inventory (elastic#193557) [EDR Workflows] The host isolation exception tab is hidden on the basic license if no artifacts (elastic#192562) [Entity Analytics] Ensuring definition transforms are managed (elastic#193408) [Automatic Import] Do not remove message field for unstructured logs (elastic#193678) [Fleet] Add missing permissions for connector package (elastic#193573) [Fleet] using @kbn/config-schema part 2 (outputs and other apis) (elastic#193326) [Migrations] Provide testing archives + tooling for migrations integration tests (elastic#193328) [ES|QL] Renames the textbased editor to esql editor (elastic#193521) [ES|QL] Update function metadata (elastic#193662) [Security Solution][Entity Analytics] Scoping the entity store to spaces (elastic#193303) [Docs] Update Sharing docs (elastic#190318) [ML] AIOps: Move Log Rate Analysis results callout to help popover. (elastic#192243) ... # Conflicts: # x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.test.tsx # x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx
Summary
Relates #184685
Added tests to verify response schemas.
To verify, go to Fleet settings and try create/update different output types, fleet server hosts, outputs.