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

@kbn/io-ts-utils: make sure keys from objects in arrays are validated #191607

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

dgieselaar
Copy link
Member

@dgieselaar dgieselaar commented Aug 28, 2024

Makes sure keys from plain objects in arrays are validated as well.

@dgieselaar dgieselaar added release_note:skip Skip the PR/issue when compiling release notes v8.16.0 v8.15.1 labels Aug 28, 2024
@dgieselaar dgieselaar requested a review from a team as a code owner August 28, 2024 12:47
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM. thanks

@dgieselaar dgieselaar requested a review from a team as a code owner August 29, 2024 08:48
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Aug 29, 2024
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dgieselaar dgieselaar merged commit 8ade3da into elastic:main Aug 30, 2024
24 checks passed
@dgieselaar dgieselaar deleted the strict-keys-array-check branch August 30, 2024 06:00
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 30, 2024
)

Makes sure keys from plain objects in arrays are validated as well.

---------

Co-authored-by: Søren Louv-Jansen <[email protected]>
Co-authored-by: Carlos Crespo <[email protected]>
(cherry picked from commit 8ade3da)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 30, 2024
) (#191797)

# Backport

This will backport the following commits from `main` to `8.15`:
- [@kbn/io-ts-utils: strictKeys: validate objects in arrays
(#191607)](#191607)

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

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

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-08-30T06:00:42Z","message":"@kbn/io-ts-utils:
strictKeys: validate objects in arrays (#191607)\n\nMakes sure keys from
plain objects in arrays are validated as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: Søren Louv-Jansen
<[email protected]>\r\nCo-authored-by: Carlos Crespo
<[email protected]>","sha":"8ade3da14d67aabb3a3bd4172187579559e610ff","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.16.0","v8.15.1"],"title":"@kbn/io-ts-utils:
make sure keys from objects in arrays are
validated","number":191607,"url":"https://github.com/elastic/kibana/pull/191607","mergeCommit":{"message":"@kbn/io-ts-utils:
strictKeys: validate objects in arrays (#191607)\n\nMakes sure keys from
plain objects in arrays are validated as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: Søren Louv-Jansen
<[email protected]>\r\nCo-authored-by: Carlos Crespo
<[email protected]>","sha":"8ade3da14d67aabb3a3bd4172187579559e610ff"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191607","number":191607,"mergeCommit":{"message":"@kbn/io-ts-utils:
strictKeys: validate objects in arrays (#191607)\n\nMakes sure keys from
plain objects in arrays are validated as
well.\r\n\r\n---------\r\n\r\nCo-authored-by: Søren Louv-Jansen
<[email protected]>\r\nCo-authored-by: Carlos Crespo
<[email protected]>","sha":"8ade3da14d67aabb3a3bd4172187579559e610ff"}},{"branch":"8.15","label":"v8.15.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dario Gieselaar <[email protected]>
dgieselaar added a commit that referenced this pull request Sep 3, 2024
In #191607, we fixed a bug around
`strictKeysRt` not strictly checking object types in arrays. That
exposed a bug in our `messageRt` type where we define `data`
incorrectly, which means that any conversation that has data (as the
result of some function calls) will fail with a 400. This PR corrects
that mistake.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 3, 2024
…#191952)

In elastic#191607, we fixed a bug around
`strictKeysRt` not strictly checking object types in arrays. That
exposed a bug in our `messageRt` type where we define `data`
incorrectly, which means that any conversation that has data (as the
result of some function calls) will fail with a 400. This PR corrects
that mistake.

(cherry picked from commit 448c9e1)
kibanamachine added a commit that referenced this pull request Sep 10, 2024
…ata (#191952) (#192030)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Obs AI Assistant] Don&#x27;t fail calls where messages have data
(#191952)](#191952)

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

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

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-03T19:21:02Z","message":"[Obs
AI Assistant] Don't fail calls where messages have data (#191952)\n\nIn
#191607, we fixed a bug
around\r\n`strictKeysRt` not strictly checking object types in arrays.
That\r\nexposed a bug in our `messageRt` type where we define
`data`\r\nincorrectly, which means that any conversation that has data
(as the\r\nresult of some function calls) will fail with a 400. This PR
corrects\r\nthat
mistake.","sha":"448c9e13283a3ee0661ed22092f2cdd01825b77c","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Obs
AI
Assistant","ci:project-deploy-observability","v8.16.0","v8.15.1"],"title":"[Obs
AI Assistant] Don't fail calls where messages have
data","number":191952,"url":"https://github.com/elastic/kibana/pull/191952","mergeCommit":{"message":"[Obs
AI Assistant] Don't fail calls where messages have data (#191952)\n\nIn
#191607, we fixed a bug
around\r\n`strictKeysRt` not strictly checking object types in arrays.
That\r\nexposed a bug in our `messageRt` type where we define
`data`\r\nincorrectly, which means that any conversation that has data
(as the\r\nresult of some function calls) will fail with a 400. This PR
corrects\r\nthat
mistake.","sha":"448c9e13283a3ee0661ed22092f2cdd01825b77c"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191952","number":191952,"mergeCommit":{"message":"[Obs
AI Assistant] Don't fail calls where messages have data (#191952)\n\nIn
#191607, we fixed a bug
around\r\n`strictKeysRt` not strictly checking object types in arrays.
That\r\nexposed a bug in our `messageRt` type where we define
`data`\r\nincorrectly, which means that any conversation that has data
(as the\r\nresult of some function calls) will fail with a 400. This PR
corrects\r\nthat
mistake.","sha":"448c9e13283a3ee0661ed22092f2cdd01825b77c"}},{"branch":"8.15","label":"v8.15.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dario Gieselaar <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v8.15.1 v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants