Skip to content

Commit

Permalink
[8.x] [Auto Import] Make sure the committed schema is generated (#195302
Browse files Browse the repository at this point in the history
) (#195315)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Auto Import] Make sure the committed schema is generated
(#195302)](#195302)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ilya
Nikokoshev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T19:47:43Z","message":"[Auto
Import] Make sure the committed schema is generated (#195302)\n\n##
Summary\r\n\r\nPreviously our schema and `.gen` files were not in sync,
in the sense that\r\n\r\n```\r\ngit checkout main && yarn kbn bootstrap
&& node scripts/generate_openapi --rootDir
./x-pack/plugins/integration_assistant && git
diff\r\n```\r\n\r\nreturned a non-trivial diff, despite the
implementation in
https://github.com/elastic/kibana/issues/193243.\r\n\r\nIn this PR
we\r\n\r\n- add missing additionalProperties to the schema;\r\n-
generate and commit exactly the generated files.\r\n\r\nThere don't seem
to be any effects from the change from `passthrough`
to\r\n`catchall`.\r\n\r\nTested with Teleport (see
GitHub).","sha":"1599e4f61b3e5caf60730be5a2def73f6d603148","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Auto
Import] Make sure the committed schema is
generated","number":195302,"url":"https://github.com/elastic/kibana/pull/195302","mergeCommit":{"message":"[Auto
Import] Make sure the committed schema is generated (#195302)\n\n##
Summary\r\n\r\nPreviously our schema and `.gen` files were not in sync,
in the sense that\r\n\r\n```\r\ngit checkout main && yarn kbn bootstrap
&& node scripts/generate_openapi --rootDir
./x-pack/plugins/integration_assistant && git
diff\r\n```\r\n\r\nreturned a non-trivial diff, despite the
implementation in
https://github.com/elastic/kibana/issues/193243.\r\n\r\nIn this PR
we\r\n\r\n- add missing additionalProperties to the schema;\r\n-
generate and commit exactly the generated files.\r\n\r\nThere don't seem
to be any effects from the change from `passthrough`
to\r\n`catchall`.\r\n\r\nTested with Teleport (see
GitHub).","sha":"1599e4f61b3e5caf60730be5a2def73f6d603148"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195302","number":195302,"mergeCommit":{"message":"[Auto
Import] Make sure the committed schema is generated (#195302)\n\n##
Summary\r\n\r\nPreviously our schema and `.gen` files were not in sync,
in the sense that\r\n\r\n```\r\ngit checkout main && yarn kbn bootstrap
&& node scripts/generate_openapi --rootDir
./x-pack/plugins/integration_assistant && git
diff\r\n```\r\n\r\nreturned a non-trivial diff, despite the
implementation in
https://github.com/elastic/kibana/issues/193243.\r\n\r\nIn this PR
we\r\n\r\n- add missing additionalProperties to the schema;\r\n-
generate and commit exactly the generated files.\r\n\r\nThere don't seem
to be any effects from the change from `passthrough`
to\r\n`catchall`.\r\n\r\nTested with Teleport (see
GitHub).","sha":"1599e4f61b3e5caf60730be5a2def73f6d603148"}}]}]
BACKPORT-->

Co-authored-by: Ilya Nikokoshev <[email protected]>
  • Loading branch information
kibanamachine and ilyannn authored Oct 7, 2024
1 parent fd0bd99 commit 46fd6db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const RawSamples = z.array(z.string());
* mapping object to ECS Mapping Request.
*/
export type Mapping = z.infer<typeof Mapping>;
export const Mapping = z.object({}).passthrough();
export const Mapping = z.object({}).catchall(z.unknown());

/**
* LLM Connector to be used in each API request.
Expand All @@ -58,7 +58,7 @@ export const Connector = z.string();
* An array of processed documents.
*/
export type Docs = z.infer<typeof Docs>;
export const Docs = z.array(z.object({}).passthrough());
export const Docs = z.array(z.object({}).catchall(z.unknown()));

/**
* The name of the log samples format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ components:
Mapping:
type: object
description: mapping object to ECS Mapping Request.
additionalProperties: true

Connector:
type: string
Expand All @@ -41,6 +42,7 @@ components:
description: An array of processed documents.
items:
type: object
additionalProperties: true

SamplesFormatName:
type: string
Expand Down

0 comments on commit 46fd6db

Please sign in to comment.