Skip to content

[Streams] [Streamlang] Add base / core types#226668

Merged
Kerry350 merged 1 commit intoelastic:mainfrom
Kerry350:224421-add-streamlang-types
Jul 8, 2025
Merged

[Streams] [Streamlang] Add base / core types#226668
Kerry350 merged 1 commit intoelastic:mainfrom
Kerry350:224421-add-streamlang-types

Conversation

@Kerry350
Copy link
Copy Markdown
Contributor

@Kerry350 Kerry350 commented Jul 4, 2025

Summary

Implements #224421.

Adds various base / core types for Streamlang. As mentioned in the issue this will not (yet) be a perfect representation of the end product (e.g. processor types will eventually be reduced down to a schema representation that fits the support matrix, types will change with the transpilation code / extension of the conditions code etc), however this is a best effort at keeping PR sizes down.

@Kerry350 Kerry350 self-assigned this Jul 4, 2025
@Kerry350 Kerry350 added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project v8.19.0 v9.2.0 labels Jul 4, 2025

export interface ShorthandUnaryFilterCondition {
field: string;
exists?: true;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could also just model this as exists: boolean and have no notExists, that's probably more natural 🤔

@@ -0,0 +1,64 @@
/*
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is just copied over verbatim from the streams-schema package for now, the schema package will be cleaned up once we've completed the conversion process to Streamlang (for the APIs, UI etc).

@Kerry350 Kerry350 force-pushed the 224421-add-streamlang-types branch from e48eb7b to d46ddc4 Compare July 7, 2025 09:35

import { z } from '@kbn/zod';
import { NonEmptyString } from '@kbn/zod-helpers';
import { createIsNarrowSchema } from '@kbn/streams-schema';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I might need to move these to a shared package for the next batch of work (circular dependencies).

@Kerry350 Kerry350 requested a review from flash1293 July 7, 2025 09:41
@Kerry350 Kerry350 marked this pull request as ready for review July 7, 2025 09:41
@Kerry350 Kerry350 requested a review from a team as a code owner July 7, 2025 09:41
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/streams-schema 231 234 +3
Unknown metric groups

API count

id before after diff
@kbn/streams-schema 240 243 +3

History

cc @Kerry350

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

As you mention, we need to reduce it in some places (e.g. multiple patterns, all the options for date processing), but also extend in others ("not" operator for conditions)

If we don't want to do this here I'm OK with this. Do we need to make a final decision of what features and processors will be supported how in this first version?

@Kerry350
Copy link
Copy Markdown
Contributor Author

Kerry350 commented Jul 8, 2025

If we don't want to do this here I'm OK with this. Do we need to make a final decision of what features and processors will be supported how in this first version?

Yeah, we do at some point, but I wouldn't do it here. I think once we have the call with the ESQL folks, and we know where we're at with requests that need to be made, we can make the final call for V1.

@Kerry350 Kerry350 merged commit b20ba3e into elastic:main Jul 8, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 8, 2025
## Summary

Implements elastic#224421.

Adds various base / core types for Streamlang. As mentioned in the issue
this will not (yet) be a perfect representation of the end product (e.g.
processor types will eventually be reduced down to a schema
representation that fits the support matrix, types will change with the
transpilation code / extension of the conditions code etc), however this
is a best effort at keeping PR sizes down.

(cherry picked from commit b20ba3e)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
8.19

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 Jul 8, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Streams] [Streamlang] Add base / core types
(#226668)](#226668)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Kerry
Gallagher","email":"kerry.gallagher@elastic.co"},"sourceCommit":{"committedDate":"2025-07-08T13:12:41Z","message":"[Streams]
[Streamlang] Add base / core types (#226668)\n\n## Summary\n\nImplements
https://github.com/elastic/kibana/issues/224421.\n\nAdds various base /
core types for Streamlang. As mentioned in the issue\nthis will not
(yet) be a perfect representation of the end product (e.g.\nprocessor
types will eventually be reduced down to a schema\nrepresentation that
fits the support matrix, types will change with the\ntranspilation code
/ extension of the conditions code etc), however this\nis a best effort
at keeping PR sizes
down.","sha":"b20ba3e798266629881e1809f7fe81182e7134dc","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Feature:Streams","v8.19.0","v9.2.0"],"title":"[Streams]
[Streamlang] Add base / core
types","number":226668,"url":"https://github.com/elastic/kibana/pull/226668","mergeCommit":{"message":"[Streams]
[Streamlang] Add base / core types (#226668)\n\n## Summary\n\nImplements
https://github.com/elastic/kibana/issues/224421.\n\nAdds various base /
core types for Streamlang. As mentioned in the issue\nthis will not
(yet) be a perfect representation of the end product (e.g.\nprocessor
types will eventually be reduced down to a schema\nrepresentation that
fits the support matrix, types will change with the\ntranspilation code
/ extension of the conditions code etc), however this\nis a best effort
at keeping PR sizes
down.","sha":"b20ba3e798266629881e1809f7fe81182e7134dc"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226668","number":226668,"mergeCommit":{"message":"[Streams]
[Streamlang] Add base / core types (#226668)\n\n## Summary\n\nImplements
https://github.com/elastic/kibana/issues/224421.\n\nAdds various base /
core types for Streamlang. As mentioned in the issue\nthis will not
(yet) be a perfect representation of the end product (e.g.\nprocessor
types will eventually be reduced down to a schema\nrepresentation that
fits the support matrix, types will change with the\ntranspilation code
/ extension of the conditions code etc), however this\nis a best effort
at keeping PR sizes
down.","sha":"b20ba3e798266629881e1809f7fe81182e7134dc"}}]}] BACKPORT-->

Co-authored-by: Kerry Gallagher <kerry.gallagher@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
## Summary

Implements elastic#224421.

Adds various base / core types for Streamlang. As mentioned in the issue
this will not (yet) be a perfect representation of the end product (e.g.
processor types will eventually be reduced down to a schema
representation that fits the support matrix, types will change with the
transpilation code / extension of the conditions code etc), however this
is a best effort at keeping PR sizes down.
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 Feature:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants