Allow kbn-config-schema to ignore unknown keys#59560
Conversation
| ignoreUnknowns?: false; | ||
| } | ||
| // type check to not permit both to be set to `true` at the same time | ||
| type UnknownOptions = AllowUnknowns | IgnoreUnknowns | ForbidUnknowns; |
There was a problem hiding this comment.
I did this because it was less invasive, but it feels messy to me.
Since these options are mutually exclusive of each other, I think a const might be better:
interface UnknownOptions {
unknowns?: 'allow' | 'ignore' | 'forbid'
}with the default behavior being forbid.
I'm happy to make this change, but I wanted to discuss before doing so, as it'll touch a lot of downstream code.
There was a problem hiding this comment.
It makes sense to me...even it will require to touch 70 places in the codebase 🙈 welcome to the platform team world.
|
Pinging @elastic/kibana-platform (Team:Platform) |
smith
left a comment
There was a problem hiding this comment.
APM changes look good to me. Thanks!
lizozom
left a comment
There was a problem hiding this comment.
@elastic/kibana-app-arch changes LGTM
flash1293
left a comment
There was a problem hiding this comment.
Kibana app changes LGTM
|
@elasticmachine merge upstream |
jportner
left a comment
There was a problem hiding this comment.
See comment for minor nit, other than that LGTM!
| * validate: { | ||
| * // handler has access to raw non-validated params in runtime | ||
| * params: schema.object({}, { allowUnknowns: true }) | ||
| * params: schema.object({}, { unknowns: 'allow' }) |
There was a problem hiding this comment.
Somehow, the corresponding Markdown API doc (at docs/development/core/server/kibana-plugin-server.routeconfig.validate.md, line 52) doesn't reflect this change.
…into misc/ignore-unknown-keys
|
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* allow kbn-config-schema to ignore unknown keys * Consolidate unknown key configuration * updates following merge Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: [SIEM] Adds 'Closes one signal when more than one opened signals are selected' test again (elastic#60380) [SIEM][Detections Engine] - Add rule markdown field to rule create, detail, and edit flows (elastic#60108) [Fleet] Add config revision to fleet agents (elastic#60292) Allow kbn-config-schema to ignore unknown keys (elastic#59560) [ML] Functional tests - disable df analytics clone tests skip flaky suite (elastic#58643) (elastic#58991) [FTR] Add support for --include and --exclude files via tags (elastic#60123) [SIEM] Fix link on overview page (elastic#60348) skip flaky test (elastic#60369) [Endpoint] Adds take action dropdown and tests to alert details flyout (elastic#59242) [Lens] Simplify state management from visualization (elastic#58279) Changing default type to start and allowing it to be configured by the event category (elastic#60323) [ML] Adds the class_assignment_objective to classification (elastic#60358)
* allow kbn-config-schema to ignore unknown keys * Consolidate unknown key configuration * updates following merge Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (51 commits) do not update cell background if is label cell (elastic#60308) FTR configurable test users (elastic#52431) [Reporting] Wholesale moves client to newest-platform (elastic#58945) [Ingest] Support `show_user` package registry flag (elastic#60338) [SIEM] Adds 'Closes one signal when more than one opened signals are selected' test again (elastic#60380) [SIEM][Detections Engine] - Add rule markdown field to rule create, detail, and edit flows (elastic#60108) [Fleet] Add config revision to fleet agents (elastic#60292) Allow kbn-config-schema to ignore unknown keys (elastic#59560) [ML] Functional tests - disable df analytics clone tests skip flaky suite (elastic#58643) (elastic#58991) [FTR] Add support for --include and --exclude files via tags (elastic#60123) [SIEM] Fix link on overview page (elastic#60348) skip flaky test (elastic#60369) [Endpoint] Adds take action dropdown and tests to alert details flyout (elastic#59242) [Lens] Simplify state management from visualization (elastic#58279) Changing default type to start and allowing it to be configured by the event category (elastic#60323) [ML] Adds the class_assignment_objective to classification (elastic#60358) [TSVB] fix text color when using custom background color (elastic#60261) Fix import to timefilter from in TSVB (elastic#60296) [NP] Get rid of usage redirectWhenMissing service (elastic#59777) ...
* alerting/view-in-app: (53 commits) fixed typo handle optional alerting plugin do not update cell background if is label cell (elastic#60308) FTR configurable test users (elastic#52431) [Reporting] Wholesale moves client to newest-platform (elastic#58945) [Ingest] Support `show_user` package registry flag (elastic#60338) [SIEM] Adds 'Closes one signal when more than one opened signals are selected' test again (elastic#60380) [SIEM][Detections Engine] - Add rule markdown field to rule create, detail, and edit flows (elastic#60108) [Fleet] Add config revision to fleet agents (elastic#60292) Allow kbn-config-schema to ignore unknown keys (elastic#59560) [ML] Functional tests - disable df analytics clone tests skip flaky suite (elastic#58643) (elastic#58991) [FTR] Add support for --include and --exclude files via tags (elastic#60123) [SIEM] Fix link on overview page (elastic#60348) skip flaky test (elastic#60369) [Endpoint] Adds take action dropdown and tests to alert details flyout (elastic#59242) [Lens] Simplify state management from visualization (elastic#58279) Changing default type to start and allowing it to be configured by the event category (elastic#60323) [ML] Adds the class_assignment_objective to classification (elastic#60358) [TSVB] fix text color when using custom background color (elastic#60261) ...
Summary
Updates
@kbn/config-schemato allow theobjecttype to accept, but remove unknown keys.This also removes the existing
allowUnknownsproperty, and introduces anunknowns: 'allow'option in its place:See #58850 (comment) for a potential use case.
/cc @azasypkin