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

[Snapshot and restore] Avoid duplicated error messages #209316

Conversation

SoniaSanzV
Copy link
Contributor

@SoniaSanzV SoniaSanzV commented Feb 3, 2025

Fixes #187065

Summary

In the repository creation endpoint, when the validation failed, we were showing duplicated errors. This was caused by how the validation schema was build. This PR refactors the duplication schema so it doesn't duplicate the nama field.

How to test

  • RunES with yarn es snapshot --license=trial -E path.repo=/tmp/es-backups
  • Navigate to repos list and try creating a new repo
  • Fill the name input with an string longer than 1000 chars.
  • Verify the error message when saving the repo is not duplicated

Screenshot

Screenshot 2025-02-03 at 15 24 27

@SoniaSanzV SoniaSanzV added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) v8.19.0 labels Feb 3, 2025
@SoniaSanzV SoniaSanzV self-assigned this Feb 3, 2025
@SoniaSanzV SoniaSanzV requested a review from a team as a code owner February 3, 2025 14:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@SoniaSanzV SoniaSanzV changed the title Avoid duplicated error messages [Snapshot and restore] Avoid duplicated error messages Feb 3, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #94 / Cases cases list filtering assignees filtering filters cases by the first cases all user assignee
  • [job] [logs] FTR Configs #53 / Security Solution - Telemetry Indices metadata task telemetry @ess @serverless indices metadata should publish data stream events
  • [job] [logs] FTR Configs #72 / serverless search UI index details page - search solution developer search index details page API key details should show api key

Metrics [docs]

✅ unchanged

cc @SoniaSanzV

@mattkime mattkime added the bug Fixes for quality problems that affect the customer experience label Feb 4, 2025
@mattkime
Copy link
Contributor

mattkime commented Feb 4, 2025

Unless this is riskier than it looks, I think this could be backported to all releases with this problem. (at very least 9.0.0 and 8.18.0)

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

code changes look good and work well

@SoniaSanzV SoniaSanzV merged commit 8d46aff into elastic:main Feb 4, 2025
28 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x, 9.0

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

@SoniaSanzV SoniaSanzV deleted the snapshot_restore/avoid_duplicate_error_messages branch February 4, 2025 07:27
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 4, 2025
Fixes elastic#187065

## Summary
In the repository creation endpoint, when the validation failed, we were
showing duplicated errors. This was caused by how the validation schema
was build. This PR refactors the duplication schema so it doesn't
duplicate the nama field.

### How to test

* RunES with yarn es snapshot --license=trial -E
path.repo=/tmp/es-backups
* Navigate to repos list and try creating a new repo
* Fill the name input with an string longer than 1000 chars.
* Verify the error message when saving the repo is not duplicated

### Screenshot
<img width="1032" alt="Screenshot 2025-02-03 at 15 24 27"
src="https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5"
/>

(cherry picked from commit 8d46aff)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 4, 2025
Fixes elastic#187065

## Summary
In the repository creation endpoint, when the validation failed, we were
showing duplicated errors. This was caused by how the validation schema
was build. This PR refactors the duplication schema so it doesn't
duplicate the nama field.

### How to test

* RunES with yarn es snapshot --license=trial -E
path.repo=/tmp/es-backups
* Navigate to repos list and try creating a new repo
* Fill the name input with an string longer than 1000 chars.
* Verify the error message when saving the repo is not duplicated

### Screenshot
<img width="1032" alt="Screenshot 2025-02-03 at 15 24 27"
src="https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5"
/>

(cherry picked from commit 8d46aff)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 4, 2025
Fixes elastic#187065

## Summary
In the repository creation endpoint, when the validation failed, we were
showing duplicated errors. This was caused by how the validation schema
was build. This PR refactors the duplication schema so it doesn't
duplicate the nama field.

### How to test

* RunES with yarn es snapshot --license=trial -E
path.repo=/tmp/es-backups
* Navigate to repos list and try creating a new repo
* Fill the name input with an string longer than 1000 chars.
* Verify the error message when saving the repo is not duplicated

### Screenshot
<img width="1032" alt="Screenshot 2025-02-03 at 15 24 27"
src="https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5"
/>

(cherry picked from commit 8d46aff)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.x
9.0

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 Feb 4, 2025
#209454)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Snapshot and restore] Avoid duplicated error messages
(#209316)](#209316)

<!--- 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":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2025-02-04T07:26:08Z","message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Kibana
Management","release_note:skip","Feature:Snapshot and
Restore","v9.0.0","backport:prev-minor","v8.18.0","v9.1.0","v8.19.0"],"title":"[Snapshot
and restore] Avoid duplicated error
messages","number":209316,"url":"https://github.com/elastic/kibana/pull/209316","mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209316","number":209316,"mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 4, 2025
… (#209453)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Snapshot and restore] Avoid duplicated error messages
(#209316)](#209316)

<!--- 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":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2025-02-04T07:26:08Z","message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Kibana
Management","release_note:skip","Feature:Snapshot and
Restore","v9.0.0","backport:prev-minor","v8.18.0","v9.1.0","v8.19.0"],"title":"[Snapshot
and restore] Avoid duplicated error
messages","number":209316,"url":"https://github.com/elastic/kibana/pull/209316","mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209316","number":209316,"mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 4, 2025
#209455)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Snapshot and restore] Avoid duplicated error messages
(#209316)](#209316)

<!--- 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":"sonia.sanzvivas@elastic.co"},"sourceCommit":{"committedDate":"2025-02-04T07:26:08Z","message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Kibana
Management","release_note:skip","Feature:Snapshot and
Restore","v9.0.0","backport:prev-minor","v8.18.0","v9.1.0","v8.19.0"],"title":"[Snapshot
and restore] Avoid duplicated error
messages","number":209316,"url":"https://github.com/elastic/kibana/pull/209316","mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209316","number":209316,"mergeCommit":{"message":"[Snapshot
and restore] Avoid duplicated error messages (#209316)\n\nFixes
https://github.com/elastic/kibana/issues/187065\n\n## Summary\nIn the
repository creation endpoint, when the validation failed, we
were\nshowing duplicated errors. This was caused by how the validation
schema\nwas build. This PR refactors the duplication schema so it
doesn't\nduplicate the nama field.\n\n### How to test\n\n* RunES with
yarn es snapshot --license=trial -E\npath.repo=/tmp/es-backups\n*
Navigate to repos list and try creating a new repo\n* Fill the name
input with an string longer than 1000 chars.\n* Verify the error message
when saving the repo is not duplicated\n\n### Screenshot\n<img
width=\"1032\" alt=\"Screenshot 2025-02-03 at 15 24
27\"\nsrc=\"https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5\"\n/>","sha":"8d46aff46bb59b7b417d348fd3a1343e560ec413"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sonia Sanz Vivas <sonia.sanzvivas@elastic.co>
drewdaemon pushed a commit to drewdaemon/kibana that referenced this pull request Feb 6, 2025
Fixes elastic#187065

## Summary
In the repository creation endpoint, when the validation failed, we were
showing duplicated errors. This was caused by how the validation schema
was build. This PR refactors the duplication schema so it doesn't
duplicate the nama field.

### How to test

* RunES with yarn es snapshot --license=trial -E
path.repo=/tmp/es-backups
* Navigate to repos list and try creating a new repo
* Fill the name input with an string longer than 1000 chars.
* Verify the error message when saving the repo is not duplicated

### Screenshot
<img width="1032" alt="Screenshot 2025-02-03 at 15 24 27"
src="https://github.com/user-attachments/assets/75231f68-a13e-44bf-8d8a-be488c9f25e5"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Snapshot & Restore] Improve validation errors display
4 participants