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

[8.x] Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management (#196527) #197685

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…x_lifecycle_management (elastic#196527)

Closes [elastic#110417 ](elastic#110417)
## Summary
In the Ingest Node Pipelines section, when the users created a new
pipeline selecting de Community ID processor the users could set a
non-integer number in this field. Then, they received a server side
error when tried to create a pipeline. For fixing this, a validation
must be added in the client.

We didn't have a reusable validation for this case, but we did have a
custom validation for integer values in the Index lifecycle management
plugin. We also had the necessary translation in that plugin. So I went
forward with:

* I created a new integer validator in the `es_ui_shared` package as it
is a fairly common validation and we could take advantage of it in the
future. Also added a couple of unit test there for this validator.

* I reused in the `ingest_pipelines` plugin the strings that already
existed in `index_lifecycle_management`.

* I added the new validation in the Community ID form in the
`ingest_pipelines` plugin. Also added some test verifying that the
processor doesn't create when the seeds validation fails.

* Changed the method in the `index_lifecycle_management` validator so
now it uses the reusable one.

Now the Ingest pipeline forms shows the validation when the number is
not an integer:
![Screenshot 2024-10-16 at 12 16
47](https://github.com/user-attachments/assets/1db9ad22-b144-44a5-9012-d3ebd5a19b6f)

And the `index_lifecycle_management` still shows the validations as
expected:

<img width="756" alt="Screenshot 2024-10-16 at 11 49 53"
src="https://github.com/user-attachments/assets/680886a5-355e-4637-9da9-4b93b396e751">

(cherry picked from commit 5a42e58)
@kibanamachine kibanamachine merged commit b6d993f into elastic:8.x Oct 24, 2024
23 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
esUiShared 220 221 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
indexLifecycleManagement 165.9KB 166.0KB +120.0B
indexManagement 688.1KB 688.1KB -49.0B
ingestPipelines 404.5KB 404.7KB +202.0B
total +273.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
esUiShared 106.7KB 106.9KB +235.0B

cc @SoniaSanzV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants