You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[9.2] [Streams 🌊] Prevent stream partition names from messing up required hierarchy prefix (#241158) (#241447)
# Backport
This will backport the following commits from `main` to `9.2`:
- [[Streams 🌊] Prevent stream partition names from messing up required
hierarchy prefix
(#241158)](#241158)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Alex
Fernandez","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-31T12:03:02Z","message":"[Streams
🌊] Prevent stream partition names from messing up required hierarchy
prefix (#241158)\n\nCloses
[#576](https://github.com/elastic/streams-program/issues/576)\n\n##
Summary\n\nWhen partitioning a wired stream, each partition has
restrictions in\ntheir name by which they must keep the name of their
parent partition(s)\nkeeping the hierarchy separated by dots in each
level.\n\nWhile server-side the restriction is properly enforced, the
input we're\nrendering at UI level does not enforce this restriction.
Instead it\nallows users to alter and/or remove the required prefix.
Even if an\nerror message will be presented should the name not meet
the\nrequirements, it still isn't an ideal UX given the input does allow
you\nto alter the prefix without clearly stating it shouldn't be
modified.\n\nThis PR introduces some fixes to address the issue\n\n##
UI\n### Partition Creation\nDuring creation, the stream name input has
now been split into 2\nsections. The fixed prefix part of the partition
name is now rendered in\na prepend section for the input, making it non
editable. The child part\nof the name remains as a regular text input
allowing users to name the\nnew partition however they wish to, but
keeping the prefix
restrictions.\n\n\n\nhttps://github.com/user-attachments/assets/cbf6df0f-47ee-4959-ad6b-a77da78605a4\n\n\n###
Partition Update\nDuring update, editing the name is not allowed.
However, to keep visual\nconsistency, the prefix will still be separated
and rendered as a\nprepend. The input will not be editable, but it has
been updated from\nusing `disabled` into using `readOnly`.\n\n<img
width=\"1000\" height=\"411\" alt=\"Screenshot 2025-10-29 at 16 20
31\"\nsrc=\"https://github.com/user-attachments/assets/660f22fd-550c-463c-b9a4-d5b219ce361c\"\n/>\n\n##
Gotchas\n### Prefix Truncation\nGiven the nesting nature of partitions,
the prefix can become too long\nto be fully render while keeping enough
space for the partition name\ninput. Generally, we try to render at most
25 prefix characters.\nAnything above that will be truncated. In the
case of narrow screens,\nthe prefix prepend will never be larger than
half the total size of the\nstream name input, regardless of characters,
so anything that doesn't\nfit in this limitation will also be
truncated.\n\n<img width=\"993\" height=\"416\" alt=\"Screenshot
2025-10-29 at 16 26
14\"\nsrc=\"https://github.com/user-attachments/assets/2a4d910a-7fd2-4614-ab40-b6ae2e05d56f\"\n/>\n\n###
Invalid partition names\nAs we've seen before, each partition is
composed of a prefix with the\nname of it's ancestor streams plus the
partition name itself. The way we\nhandle nesting in the prefix is by
separating each partition name from\nit's predecessors with a dot. These
dots are added automatically by the\nsystem when creating partitions and
the hierarchy *must* be kept in the\nname, otherwise the backend will
reject the partition creation.\n\nAt UI level, we didn't enforce this
restriction before which could lead\nusers to attempt to create a
partition with dots on the name, only to be\nmet with an error
description that can be confusing.\n\n<img width=\"333\" height=\"208\"
alt=\"Screenshot 2025-10-30 at 17 02
05\"\nsrc=\"https://github.com/user-attachments/assets/8382b474-ed68-4ca0-b778-79799b2b55af\"\n/>\n\nNotice
how the error states that the parent stream and a dot must be\nincluded,
which the name `log.child.child` name does satisfy. At no\npoint is it
explicit that partition names cannot contain dots\n\nInstead on relaying
on the server side error, this PR introduces\nvalidation at UI level in
order to display a user friendly error message\nletting them know that
dots cannot be used in partition names.\n\n<img width=\"993\"
height=\"431\" alt=\"Screenshot 2025-10-30 at 16 54
28\"\nsrc=\"https://github.com/user-attachments/assets/c9ba3144-fc9f-4b6c-b5f1-3ec1aa103b2a\"\n/>","sha":"7a610b1121f517e3fbfa831845d269556500f406","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-logs","backport:version","Feature:Streams","v9.2.0","v9.3.0"],"title":"[Streams
🌊] Prevent stream partition names from messing up required hierarchy
prefix","number":241158,"url":"https://github.com/elastic/kibana/pull/241158","mergeCommit":{"message":"[Streams
🌊] Prevent stream partition names from messing up required hierarchy
prefix (#241158)\n\nCloses
[#576](https://github.com/elastic/streams-program/issues/576)\n\n##
Summary\n\nWhen partitioning a wired stream, each partition has
restrictions in\ntheir name by which they must keep the name of their
parent partition(s)\nkeeping the hierarchy separated by dots in each
level.\n\nWhile server-side the restriction is properly enforced, the
input we're\nrendering at UI level does not enforce this restriction.
Instead it\nallows users to alter and/or remove the required prefix.
Even if an\nerror message will be presented should the name not meet
the\nrequirements, it still isn't an ideal UX given the input does allow
you\nto alter the prefix without clearly stating it shouldn't be
modified.\n\nThis PR introduces some fixes to address the issue\n\n##
UI\n### Partition Creation\nDuring creation, the stream name input has
now been split into 2\nsections. The fixed prefix part of the partition
name is now rendered in\na prepend section for the input, making it non
editable. The child part\nof the name remains as a regular text input
allowing users to name the\nnew partition however they wish to, but
keeping the prefix
restrictions.\n\n\n\nhttps://github.com/user-attachments/assets/cbf6df0f-47ee-4959-ad6b-a77da78605a4\n\n\n###
Partition Update\nDuring update, editing the name is not allowed.
However, to keep visual\nconsistency, the prefix will still be separated
and rendered as a\nprepend. The input will not be editable, but it has
been updated from\nusing `disabled` into using `readOnly`.\n\n<img
width=\"1000\" height=\"411\" alt=\"Screenshot 2025-10-29 at 16 20
31\"\nsrc=\"https://github.com/user-attachments/assets/660f22fd-550c-463c-b9a4-d5b219ce361c\"\n/>\n\n##
Gotchas\n### Prefix Truncation\nGiven the nesting nature of partitions,
the prefix can become too long\nto be fully render while keeping enough
space for the partition name\ninput. Generally, we try to render at most
25 prefix characters.\nAnything above that will be truncated. In the
case of narrow screens,\nthe prefix prepend will never be larger than
half the total size of the\nstream name input, regardless of characters,
so anything that doesn't\nfit in this limitation will also be
truncated.\n\n<img width=\"993\" height=\"416\" alt=\"Screenshot
2025-10-29 at 16 26
14\"\nsrc=\"https://github.com/user-attachments/assets/2a4d910a-7fd2-4614-ab40-b6ae2e05d56f\"\n/>\n\n###
Invalid partition names\nAs we've seen before, each partition is
composed of a prefix with the\nname of it's ancestor streams plus the
partition name itself. The way we\nhandle nesting in the prefix is by
separating each partition name from\nit's predecessors with a dot. These
dots are added automatically by the\nsystem when creating partitions and
the hierarchy *must* be kept in the\nname, otherwise the backend will
reject the partition creation.\n\nAt UI level, we didn't enforce this
restriction before which could lead\nusers to attempt to create a
partition with dots on the name, only to be\nmet with an error
description that can be confusing.\n\n<img width=\"333\" height=\"208\"
alt=\"Screenshot 2025-10-30 at 17 02
05\"\nsrc=\"https://github.com/user-attachments/assets/8382b474-ed68-4ca0-b778-79799b2b55af\"\n/>\n\nNotice
how the error states that the parent stream and a dot must be\nincluded,
which the name `log.child.child` name does satisfy. At no\npoint is it
explicit that partition names cannot contain dots\n\nInstead on relaying
on the server side error, this PR introduces\nvalidation at UI level in
order to display a user friendly error message\nletting them know that
dots cannot be used in partition names.\n\n<img width=\"993\"
height=\"431\" alt=\"Screenshot 2025-10-30 at 16 54
28\"\nsrc=\"https://github.com/user-attachments/assets/c9ba3144-fc9f-4b6c-b5f1-3ec1aa103b2a\"\n/>","sha":"7a610b1121f517e3fbfa831845d269556500f406"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241158","number":241158,"mergeCommit":{"message":"[Streams
🌊] Prevent stream partition names from messing up required hierarchy
prefix (#241158)\n\nCloses
[#576](https://github.com/elastic/streams-program/issues/576)\n\n##
Summary\n\nWhen partitioning a wired stream, each partition has
restrictions in\ntheir name by which they must keep the name of their
parent partition(s)\nkeeping the hierarchy separated by dots in each
level.\n\nWhile server-side the restriction is properly enforced, the
input we're\nrendering at UI level does not enforce this restriction.
Instead it\nallows users to alter and/or remove the required prefix.
Even if an\nerror message will be presented should the name not meet
the\nrequirements, it still isn't an ideal UX given the input does allow
you\nto alter the prefix without clearly stating it shouldn't be
modified.\n\nThis PR introduces some fixes to address the issue\n\n##
UI\n### Partition Creation\nDuring creation, the stream name input has
now been split into 2\nsections. The fixed prefix part of the partition
name is now rendered in\na prepend section for the input, making it non
editable. The child part\nof the name remains as a regular text input
allowing users to name the\nnew partition however they wish to, but
keeping the prefix
restrictions.\n\n\n\nhttps://github.com/user-attachments/assets/cbf6df0f-47ee-4959-ad6b-a77da78605a4\n\n\n###
Partition Update\nDuring update, editing the name is not allowed.
However, to keep visual\nconsistency, the prefix will still be separated
and rendered as a\nprepend. The input will not be editable, but it has
been updated from\nusing `disabled` into using `readOnly`.\n\n<img
width=\"1000\" height=\"411\" alt=\"Screenshot 2025-10-29 at 16 20
31\"\nsrc=\"https://github.com/user-attachments/assets/660f22fd-550c-463c-b9a4-d5b219ce361c\"\n/>\n\n##
Gotchas\n### Prefix Truncation\nGiven the nesting nature of partitions,
the prefix can become too long\nto be fully render while keeping enough
space for the partition name\ninput. Generally, we try to render at most
25 prefix characters.\nAnything above that will be truncated. In the
case of narrow screens,\nthe prefix prepend will never be larger than
half the total size of the\nstream name input, regardless of characters,
so anything that doesn't\nfit in this limitation will also be
truncated.\n\n<img width=\"993\" height=\"416\" alt=\"Screenshot
2025-10-29 at 16 26
14\"\nsrc=\"https://github.com/user-attachments/assets/2a4d910a-7fd2-4614-ab40-b6ae2e05d56f\"\n/>\n\n###
Invalid partition names\nAs we've seen before, each partition is
composed of a prefix with the\nname of it's ancestor streams plus the
partition name itself. The way we\nhandle nesting in the prefix is by
separating each partition name from\nit's predecessors with a dot. These
dots are added automatically by the\nsystem when creating partitions and
the hierarchy *must* be kept in the\nname, otherwise the backend will
reject the partition creation.\n\nAt UI level, we didn't enforce this
restriction before which could lead\nusers to attempt to create a
partition with dots on the name, only to be\nmet with an error
description that can be confusing.\n\n<img width=\"333\" height=\"208\"
alt=\"Screenshot 2025-10-30 at 17 02
05\"\nsrc=\"https://github.com/user-attachments/assets/8382b474-ed68-4ca0-b778-79799b2b55af\"\n/>\n\nNotice
how the error states that the parent stream and a dot must be\nincluded,
which the name `log.child.child` name does satisfy. At no\npoint is it
explicit that partition names cannot contain dots\n\nInstead on relaying
on the server side error, this PR introduces\nvalidation at UI level in
order to display a user friendly error message\nletting them know that
dots cannot be used in partition names.\n\n<img width=\"993\"
height=\"431\" alt=\"Screenshot 2025-10-30 at 16 54
28\"\nsrc=\"https://github.com/user-attachments/assets/c9ba3144-fc9f-4b6c-b5f1-3ec1aa103b2a\"\n/>","sha":"7a610b1121f517e3fbfa831845d269556500f406"}}]}]
BACKPORT-->
Co-authored-by: Alex Fernandez <[email protected]>
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_routing/edit_routing_stream_entry.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ export function EditRoutingStreamEntry({
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_routing/state_management/stream_routing_state_machine/stream_routing_state_machine.ts
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ import type { MachineImplementationsFrom, ActorRefFrom } from 'xstate5';
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/public/components/data_management/stream_detail_routing/stream_name_form_row.tsx
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/test/scout/ui/tests/data_management/data_routing/create_routing_rules.spec.ts
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/test/scout/ui/tests/data_management/data_routing/edit_routing_rules.spec.ts
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/test/scout/ui/tests/data_management/data_routing/error_handling.spec.ts
Copy file name to clipboardExpand all lines: x-pack/platform/plugins/shared/streams_app/test/scout/ui/tests/data_management/data_routing/routing_data_preview.spec.ts
0 commit comments