Skip to content

[Security][OpenAPI generator] add experimentallyImportZodV4#253568

Merged
janmonschke merged 5 commits intoelastic:mainfrom
janmonschke:cases/experimental-zod-v4-flag-openapi-generator
Feb 18, 2026
Merged

[Security][OpenAPI generator] add experimentallyImportZodV4#253568
janmonschke merged 5 commits intoelastic:mainfrom
janmonschke:cases/experimental-zod-v4-flag-openapi-generator

Conversation

@janmonschke
Copy link
Copy Markdown
Contributor

@janmonschke janmonschke commented Feb 17, 2026

Summary

Adds an experimental config flag experimentallyImportZodV4 that changes the generated zod import to import { z } from '@kbn/zod/v4';. This is meant as a quick way to unblock the cases workflow integration because workflow schemas use zod v4.

There is some work done to migrate larger parts of the Kibana codebase (and this generator) to v4 but it will not finish in time for the workflows integration (https://github.com/elastic/kibana-team/issues/2589). We recommend removing this flag as part of the zod upgrade work.

@janmonschke janmonschke added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release Team:Cases Security Solution Cases team labels Feb 17, 2026
@janmonschke janmonschke marked this pull request as ready for review February 18, 2026 05:40
@janmonschke janmonschke requested review from a team as code owners February 18, 2026 05:40
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

@banderror banderror requested review from alainnahalliday and removed request for nikitaindik February 18, 2026 13:33
@janmonschke
Copy link
Copy Markdown
Contributor Author

@alainnahalliday The latest build passed, not sure why there is no updated comment from @elasticmachine

Copy link
Copy Markdown
Contributor

@alainnahalliday alainnahalliday left a comment

Choose a reason for hiding this comment

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

Makes sense to me

@janmonschke janmonschke enabled auto-merge (squash) February 18, 2026 18:18
@janmonschke janmonschke merged commit df5b635 into elastic:main Feb 18, 2026
13 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/22152199804

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- chore(deps): upgraded tar (#253694)
- CODEOWNERS: remove gieselaar (#253766)
- [Security Solution][A11Y] add overflow scroll to timeline modal for small screens (#251334)
9.2 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.2:
- chore(deps): upgraded tar (#253694)
- CODEOWNERS: remove gieselaar (#253766)
- [Security Solution][A11Y] add overflow scroll to timeline modal for small screens (#251334)
- Fixed EsLint violations of @elastic/eui/badge-accessibility-rules rule in Kibana code. (#251665)
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- chore(deps): upgraded tar (#253694)
- Console tutorial date based badge (#253505)
- [SLO] Stabilize deployment-agnostic SLO cleanup deletion (#253726)
- CODEOWNERS: remove gieselaar (#253766)
- Fixed EsLint violations of @elastic/eui/badge-accessibility-rules rule in Kibana code. (#251665)

Manual backport

To create the backport manually run:

node scripts/backport --pr 253568

Questions ?

Please refer to the Backport tool documentation

janmonschke added a commit to janmonschke/kibana that referenced this pull request Feb 18, 2026
…c#253568)

## Summary

Adds an experimental config flag `experimentallyImportZodV4` that
changes the generated zod import to `import { z } from '@kbn/zod/v4';`.
This is meant as a quick way to unblock the cases workflow integration
because workflow schemas use zod v4.

There is some work done to migrate larger parts of the Kibana codebase
(and this generator) to v4 but it will not finish in time for the
workflows integration
(elastic/kibana-team#2589). We recommend
removing this flag as part of the zod upgrade work.

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit df5b635)

# Conflicts:
#	x-pack/platform/plugins/shared/cases/docs/openapi/bundled-types.gen.ts
#	x-pack/platform/plugins/shared/cases/scripts/openapi_generate.js
@janmonschke
Copy link
Copy Markdown
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.3
9.2 Conflict resolution was aborted by the user
8.19 Conflict resolution was aborted by the user

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 253568

Questions ?

Please refer to the Backport tool documentation

@janmonschke janmonschke added backport:version Backport to applied version labels and removed backport:all-open Backport to all branches that could still receive a release labels Feb 18, 2026
@janmonschke janmonschke added (do not use) backport:9.3 This doesn't do backports! use `backport:version` `v9.3.0` instead v9.3.0 and removed (do not use) backport:9.3 This doesn't do backports! use `backport:version` `v9.3.0` instead labels Feb 18, 2026
chrisbmar pushed a commit to chrisbmar/kibana that referenced this pull request Feb 19, 2026
…c#253568)

## Summary

Adds an experimental config flag `experimentallyImportZodV4` that
changes the generated zod import to `import { z } from '@kbn/zod/v4';`.
This is meant as a quick way to unblock the cases workflow integration
because workflow schemas use zod v4.

There is some work done to migrate larger parts of the Kibana codebase
(and this generator) to v4 but it will not finish in time for the
workflows integration
(elastic/kibana-team#2589). We recommend
removing this flag as part of the zod upgrade work.

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
ersin-erdal pushed a commit to ersin-erdal/kibana that referenced this pull request Feb 19, 2026
…c#253568)

## Summary

Adds an experimental config flag `experimentallyImportZodV4` that
changes the generated zod import to `import { z } from '@kbn/zod/v4';`.
This is meant as a quick way to unblock the cases workflow integration
because workflow schemas use zod v4.

There is some work done to migrate larger parts of the Kibana codebase
(and this generator) to v4 but it will not finish in time for the
workflows integration
(elastic/kibana-team#2589). We recommend
removing this flag as part of the zod upgrade work.

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Feb 19, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @janmonschke

janmonschke added a commit that referenced this pull request Feb 20, 2026
…253568) (#253792)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Security][OpenAPI generator] add `experimentallyImportZodV4`
(#253568)](#253568)

<!--- Backport version: 10.2.0 -->

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

<!--BACKPORT [{"author":{"name":"Jan
Monschke","email":"jan.monschke@elastic.co"},"sourceCommit":{"committedDate":"2026-02-18T18:21:55Z","message":"[Security][OpenAPI
generator] add `experimentallyImportZodV4` (#253568)\n\n##
Summary\n\nAdds an experimental config flag `experimentallyImportZodV4`
that\nchanges the generated zod import to `import { z } from
'@kbn/zod/v4';`.\nThis is meant as a quick way to unblock the cases
workflow integration\nbecause workflow schemas use zod v4.\n\nThere is
some work done to migrate larger parts of the Kibana codebase\n(and this
generator) to v4 but it will not finish in time for the\nworkflows
integration\n(elastic/kibana-team#2589). We
recommend\nremoving this flag as part of the zod upgrade
work.\n\n---------\n\nCo-authored-by: Tiago Costa
<tiago.costa@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"df5b63519032a0abe2fff0b19f23f956f08a2fa3","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","Team:Cases","v9.4.0"],"title":"[Security][OpenAPI
generator] add
`experimentallyImportZodV4`","number":253568,"url":"https://github.com/elastic/kibana/pull/253568","mergeCommit":{"message":"[Security][OpenAPI
generator] add `experimentallyImportZodV4` (#253568)\n\n##
Summary\n\nAdds an experimental config flag `experimentallyImportZodV4`
that\nchanges the generated zod import to `import { z } from
'@kbn/zod/v4';`.\nThis is meant as a quick way to unblock the cases
workflow integration\nbecause workflow schemas use zod v4.\n\nThere is
some work done to migrate larger parts of the Kibana codebase\n(and this
generator) to v4 but it will not finish in time for the\nworkflows
integration\n(elastic/kibana-team#2589). We
recommend\nremoving this flag as part of the zod upgrade
work.\n\n---------\n\nCo-authored-by: Tiago Costa
<tiago.costa@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"df5b63519032a0abe2fff0b19f23f956f08a2fa3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/253568","number":253568,"mergeCommit":{"message":"[Security][OpenAPI
generator] add `experimentallyImportZodV4` (#253568)\n\n##
Summary\n\nAdds an experimental config flag `experimentallyImportZodV4`
that\nchanges the generated zod import to `import { z } from
'@kbn/zod/v4';`.\nThis is meant as a quick way to unblock the cases
workflow integration\nbecause workflow schemas use zod v4.\n\nThere is
some work done to migrate larger parts of the Kibana codebase\n(and this
generator) to v4 but it will not finish in time for the\nworkflows
integration\n(elastic/kibana-team#2589). We
recommend\nremoving this flag as part of the zod upgrade
work.\n\n---------\n\nCo-authored-by: Tiago Costa
<tiago.costa@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"df5b63519032a0abe2fff0b19f23f956f08a2fa3"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added v9.3.1 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Feb 20, 2026
janmonschke added a commit that referenced this pull request Feb 27, 2026
## Summary

<img width="1212" height="720" alt="image"
src="https://github.com/user-attachments/assets/59397721-4024-4877-8781-d7736b1d3628"
/>

This PR adds ~~five~~four ~~new~~ enhanced case workflow steps:

1. `cases.createCase`: Does not require user to add optional fields,
supports adding a connector, better autocompletion
2. `cases.updateCase`: Does not require user to specify a `version`,
eliminating the need to fetch the case in the step before. Better
autocompletion.
3. `cases.getCase`: Gets a case by id
4. `cases.addCaseComment`: Adds a comment to a case with better
autocompletion
5. `cases.createCaseFromTemplate`: Creates a case from an autocompleted
case template.

What, 5? I thought it was 4!? Well, yes. Technically there are 5 steps
in this PR but only 4 of them are activated.
`cases.createCaseFromTemplate` depends on workflow improvements
mentioned in #253568 (namely
`owner` inspection).

Note: **all** steps also support pushing the case after completion by
setting the `push-case` property to `true`.

## Testing

Add the following to your `kibana.dev.yml`:

```yml
uiSettings:
  overrides:
    bfetch:disableCompression: true
    workflows:ui:enabled: true
```

I encourage you to check out the code locally and to play around with
the workflow feature to get a feel for the autocompletion and how case
steps behave. If you notice anything that should be enhanced, add a
comment here.

Here's a workflow spec that uses all (enabled) case steps:

<details>
<summary>Click to reveal yaml file</summary>

```yaml
name: Case workflow kitchen sink
enabled: false
description: Tests all the case stes
triggers:
  - type: manual
steps:
  - name: create_case
    type: cases.createCase
    push-case: true
    connector-id: ba236d8b-67fb-47d6-8df8-bba91381beb1
    with:
      description: "Test description"
      title: "test title"
      owner: securitySolution
      settings:
        syncAlerts: false
  - name: update_case
    type: cases.updateCase
    with:
      case_id: "{{steps.create_case.output.case.id}}"
      updates:
        status: in-progress
        title: The title changed
  - name: add_comment
    type: cases.addComment
    with:
      case_id: "{{steps.update_case.output.case.id}}"
      comment: "Test comment"
  - name: get_case
    type: cases.getCase
    with:
      case_id: "{{steps.add_comment.output.case.id}}"
      include_comments: false
```

</details>

## Notes

Reach out to me on Slack for cloud env & connector credentials.

## Meta

Depends on: #253568
Partially implements:
elastic/security-team#15084
Fixes elastic/security-team#15969

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mykhailo Kondrat <247111948+mykhailokondrat@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
## Summary

<img width="1212" height="720" alt="image"
src="https://github.com/user-attachments/assets/59397721-4024-4877-8781-d7736b1d3628"
/>

This PR adds ~~five~~four ~~new~~ enhanced case workflow steps:

1. `cases.createCase`: Does not require user to add optional fields,
supports adding a connector, better autocompletion
2. `cases.updateCase`: Does not require user to specify a `version`,
eliminating the need to fetch the case in the step before. Better
autocompletion.
3. `cases.getCase`: Gets a case by id
4. `cases.addCaseComment`: Adds a comment to a case with better
autocompletion
5. `cases.createCaseFromTemplate`: Creates a case from an autocompleted
case template.

What, 5? I thought it was 4!? Well, yes. Technically there are 5 steps
in this PR but only 4 of them are activated.
`cases.createCaseFromTemplate` depends on workflow improvements
mentioned in elastic#253568 (namely
`owner` inspection).

Note: **all** steps also support pushing the case after completion by
setting the `push-case` property to `true`.

## Testing

Add the following to your `kibana.dev.yml`:

```yml
uiSettings:
  overrides:
    bfetch:disableCompression: true
    workflows:ui:enabled: true
```

I encourage you to check out the code locally and to play around with
the workflow feature to get a feel for the autocompletion and how case
steps behave. If you notice anything that should be enhanced, add a
comment here.

Here's a workflow spec that uses all (enabled) case steps:

<details>
<summary>Click to reveal yaml file</summary>

```yaml
name: Case workflow kitchen sink
enabled: false
description: Tests all the case stes
triggers:
  - type: manual
steps:
  - name: create_case
    type: cases.createCase
    push-case: true
    connector-id: ba236d8b-67fb-47d6-8df8-bba91381beb1
    with:
      description: "Test description"
      title: "test title"
      owner: securitySolution
      settings:
        syncAlerts: false
  - name: update_case
    type: cases.updateCase
    with:
      case_id: "{{steps.create_case.output.case.id}}"
      updates:
        status: in-progress
        title: The title changed
  - name: add_comment
    type: cases.addComment
    with:
      case_id: "{{steps.update_case.output.case.id}}"
      comment: "Test comment"
  - name: get_case
    type: cases.getCase
    with:
      case_id: "{{steps.add_comment.output.case.id}}"
      include_comments: false
```

</details>

## Notes

Reach out to me on Slack for cloud env & connector credentials.

## Meta

Depends on: elastic#253568
Partially implements:
elastic/security-team#15084
Fixes elastic/security-team#15969

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Mykhailo Kondrat <247111948+mykhailokondrat@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Cases Security Solution Cases team v9.3.0 v9.3.1 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants