Skip to content

[Cases] Re-implement runtime types in zod#258427

Merged
lgestc merged 20 commits into
elastic:mainfrom
lgestc:feature-zod
May 6, 2026
Merged

[Cases] Re-implement runtime types in zod#258427
lgestc merged 20 commits into
elastic:mainfrom
lgestc:feature-zod

Conversation

@lgestc
Copy link
Copy Markdown
Contributor

@lgestc lgestc commented Mar 18, 2026

Summary

This is stage 1 of the migration, see [Epic] [Cases] Migrate away from io-ts

This implements all io-ts types as zod schemas; a stepping stone towards full migration

None of the types are used for validation yet, they will be enforced in future PR's that will follow this one.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@lgestc lgestc requested a review from a team as a code owner March 18, 2026 18:41
@lgestc lgestc added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Cases Security Solution Cases team labels Mar 18, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-cases (Team:Cases)

@lgestc lgestc changed the title [Cases] Migrate runtime types to zod [Cases] Re-implement runtime types in zod Mar 23, 2026
Copy link
Copy Markdown
Contributor

@christineweng christineweng left a comment

Choose a reason for hiding this comment

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

@lgestc Appreciate you taking this on! Overall LGTM, left some comments on attachment V2 coverage

Comment thread x-pack/platform/plugins/shared/cases/common/types/domain_zod/case/v1.ts Outdated
Comment thread x-pack/platform/plugins/shared/cases/common/schema_zod/index.ts Outdated
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
cases 121 165 +44

Unreferenced deprecated APIs

id before after diff
cases 121 165 +44

History

@janmonschke
Copy link
Copy Markdown
Contributor

@lgestc Have you considered reusing the types from x-pack/platform/plugins/shared/cases/common/bundled-types.gen.ts where possible? Otherwise we'll end up with a bunch of duplicated zod schemas.

@lgestc
Copy link
Copy Markdown
Contributor Author

lgestc commented May 6, 2026

@lgestc Have you considered reusing the types from x-pack/platform/plugins/shared/cases/common/bundled-types.gen.ts where possible? Otherwise we'll end up with a bunch of duplicated zod schemas.

looking into it:) thanks!

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
cases 118 162 +44

Unreferenced deprecated APIs

id before after diff
cases 118 162 +44

History

@lgestc lgestc merged commit f085474 into elastic:main May 6, 2026
31 checks passed
@lgestc lgestc deleted the feature-zod branch May 6, 2026 10:57
ersin-erdal pushed a commit to ersin-erdal/kibana that referenced this pull request May 6, 2026
## Summary

This is stage 1 of the migration, see [[Epic] [Cases] Migrate away from
io-ts](elastic/security-team#16437)

This implements all io-ts types as zod schemas; a stepping stone towards
full migration

None of the types are used for validation yet, they will be enforced in
future PR's that will follow this one.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgestc lgestc mentioned this pull request May 8, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Cases Security Solution Cases team v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants