Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] Create a common Int Validator and use it in ingest_pipelines an…
…d Index_lifecycle_management (#196527) (#197685) # Backport This will backport the following commits from `main` to `8.x`: - [Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management (#196527)](#196527) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sonia Sanz Vivas","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T16:09:38Z","message":"Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management (#196527)\n\nCloses [#110417 ](https://github.com/elastic/kibana/issues/110417)\r\n## Summary\r\nIn the Ingest Node Pipelines section, when the users created a new\r\npipeline selecting de Community ID processor the users could set a\r\nnon-integer number in this field. Then, they received a server side\r\nerror when tried to create a pipeline. For fixing this, a validation\r\nmust be added in the client.\r\n\r\nWe didn't have a reusable validation for this case, but we did have a\r\ncustom validation for integer values in the Index lifecycle management\r\nplugin. We also had the necessary translation in that plugin. So I went\r\nforward with:\r\n\r\n* I created a new integer validator in the `es_ui_shared` package as it\r\nis a fairly common validation and we could take advantage of it in the\r\nfuture. Also added a couple of unit test there for this validator.\r\n\r\n* I reused in the `ingest_pipelines` plugin the strings that already\r\nexisted in `index_lifecycle_management`.\r\n\r\n* I added the new validation in the Community ID form in the\r\n`ingest_pipelines` plugin. Also added some test verifying that the\r\nprocessor doesn't create when the seeds validation fails.\r\n\r\n* Changed the method in the `index_lifecycle_management` validator so\r\nnow it uses the reusable one.\r\n\r\nNow the Ingest pipeline forms shows the validation when the number is\r\nnot an integer:\r\n![Screenshot 2024-10-16 at 12 16\r\n47](https://github.com/user-attachments/assets/1db9ad22-b144-44a5-9012-d3ebd5a19b6f)\r\n\r\nAnd the `index_lifecycle_management` still shows the validations as\r\nexpected:\r\n\r\n<img width=\"756\" alt=\"Screenshot 2024-10-16 at 11 49 53\"\r\nsrc=\"https://github.com/user-attachments/assets/680886a5-355e-4637-9da9-4b93b396e751\">","sha":"5a42e5861dc53911e10a3140d8cb5366fea98ff7","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana Management","release_note:skip","v9.0.0","Feature:Ingest Node Pipelines","backport:prev-minor","v8.17.0"],"title":"Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management","number":196527,"url":"https://github.com/elastic/kibana/pull/196527","mergeCommit":{"message":"Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management (#196527)\n\nCloses [#110417 ](https://github.com/elastic/kibana/issues/110417)\r\n## Summary\r\nIn the Ingest Node Pipelines section, when the users created a new\r\npipeline selecting de Community ID processor the users could set a\r\nnon-integer number in this field. Then, they received a server side\r\nerror when tried to create a pipeline. For fixing this, a validation\r\nmust be added in the client.\r\n\r\nWe didn't have a reusable validation for this case, but we did have a\r\ncustom validation for integer values in the Index lifecycle management\r\nplugin. We also had the necessary translation in that plugin. So I went\r\nforward with:\r\n\r\n* I created a new integer validator in the `es_ui_shared` package as it\r\nis a fairly common validation and we could take advantage of it in the\r\nfuture. Also added a couple of unit test there for this validator.\r\n\r\n* I reused in the `ingest_pipelines` plugin the strings that already\r\nexisted in `index_lifecycle_management`.\r\n\r\n* I added the new validation in the Community ID form in the\r\n`ingest_pipelines` plugin. Also added some test verifying that the\r\nprocessor doesn't create when the seeds validation fails.\r\n\r\n* Changed the method in the `index_lifecycle_management` validator so\r\nnow it uses the reusable one.\r\n\r\nNow the Ingest pipeline forms shows the validation when the number is\r\nnot an integer:\r\n![Screenshot 2024-10-16 at 12 16\r\n47](https://github.com/user-attachments/assets/1db9ad22-b144-44a5-9012-d3ebd5a19b6f)\r\n\r\nAnd the `index_lifecycle_management` still shows the validations as\r\nexpected:\r\n\r\n<img width=\"756\" alt=\"Screenshot 2024-10-16 at 11 49 53\"\r\nsrc=\"https://github.com/user-attachments/assets/680886a5-355e-4637-9da9-4b93b396e751\">","sha":"5a42e5861dc53911e10a3140d8cb5366fea98ff7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196527","number":196527,"mergeCommit":{"message":"Create a common Int Validator and use it in ingest_pipelines and Index_lifecycle_management (#196527)\n\nCloses [#110417 ](https://github.com/elastic/kibana/issues/110417)\r\n## Summary\r\nIn the Ingest Node Pipelines section, when the users created a new\r\npipeline selecting de Community ID processor the users could set a\r\nnon-integer number in this field. Then, they received a server side\r\nerror when tried to create a pipeline. For fixing this, a validation\r\nmust be added in the client.\r\n\r\nWe didn't have a reusable validation for this case, but we did have a\r\ncustom validation for integer values in the Index lifecycle management\r\nplugin. We also had the necessary translation in that plugin. So I went\r\nforward with:\r\n\r\n* I created a new integer validator in the `es_ui_shared` package as it\r\nis a fairly common validation and we could take advantage of it in the\r\nfuture. Also added a couple of unit test there for this validator.\r\n\r\n* I reused in the `ingest_pipelines` plugin the strings that already\r\nexisted in `index_lifecycle_management`.\r\n\r\n* I added the new validation in the Community ID form in the\r\n`ingest_pipelines` plugin. Also added some test verifying that the\r\nprocessor doesn't create when the seeds validation fails.\r\n\r\n* Changed the method in the `index_lifecycle_management` validator so\r\nnow it uses the reusable one.\r\n\r\nNow the Ingest pipeline forms shows the validation when the number is\r\nnot an integer:\r\n![Screenshot 2024-10-16 at 12 16\r\n47](https://github.com/user-attachments/assets/1db9ad22-b144-44a5-9012-d3ebd5a19b6f)\r\n\r\nAnd the `index_lifecycle_management` still shows the validations as\r\nexpected:\r\n\r\n<img width=\"756\" alt=\"Screenshot 2024-10-16 at 11 49 53\"\r\nsrc=\"https://github.com/user-attachments/assets/680886a5-355e-4637-9da9-4b93b396e751\">","sha":"5a42e5861dc53911e10a3140d8cb5366fea98ff7"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sonia Sanz Vivas <[email protected]>
- Loading branch information