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

[Index Management] Fix globalMaxRetention display error in data retention modal #198113

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

viajes7
Copy link
Contributor

@viajes7 viajes7 commented Oct 29, 2024

Summary

Fixes #197314

After fixup:

image

image

@viajes7 viajes7 requested a review from a team as a code owner October 29, 2024 08:12
@viajes7
Copy link
Contributor Author

viajes7 commented Oct 30, 2024

@elasticmachine merge upstream

@@ -7,6 +7,7 @@

import { i18n } from '@kbn/i18n';
import { splitSizeAndUnits } from '../../../../../../common';
import { deserializeGlobalMaxRetention } from '../../../../lib/data_streams';

const convertToMinutes = (value: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this @viajes7! Apart from displaying the correct unit in the modal, we should make sure that the validation also works correctly. However, currently, the validation only supports days, hours, minutes, and seconds, but we should support all of the units that are accepted by Elasticsearch:

return switch (timeUnit) {
            case NANOSECONDS -> duration + "nanos";
            case MICROSECONDS -> duration + "micros";
            case MILLISECONDS -> duration + "ms";
            case SECONDS -> duration + "s";
            case MINUTES -> duration + "m";
            case HOURS -> duration + "h";
            case DAYS -> duration + "d";
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @ElenaStoeva ! I added handling of extraTimeUnits and corresponding changes have been made to the validation.

@ElenaStoeva ElenaStoeva added Feature:Index Management Index and index templates UI 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 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 30, 2024
@elasticmachine
Copy link
Contributor

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

@viajes7
Copy link
Contributor Author

viajes7 commented Oct 31, 2024

@elasticmachine merge upstream

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the validations and adding unit tests! Tested locally and it works well. Changes lgtm.

@ElenaStoeva
Copy link
Contributor

/ci

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
indexManagement 688.3KB 688.6KB +338.0B

@ElenaStoeva
Copy link
Contributor

@elasticmachine run docs-build

@ElenaStoeva ElenaStoeva merged commit 1e7bb1e into elastic:main Oct 31, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Oct 31, 2024
… retention modal (#198113) (#198534)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Index Management] Fix globalMaxRetention display error in data
retention modal
(#198113)](#198113)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jusheng
Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-31T13:52:48Z","message":"[Index
Management] Fix globalMaxRetention display error in data retention modal
(#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After
fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Index
Management","Team:Kibana
Management","release_note:skip","💝community","v9.0.0","backport:prev-minor"],"title":"[Index
Management] Fix globalMaxRetention display error in data retention
modal","number":198113,"url":"https://github.com/elastic/kibana/pull/198113","mergeCommit":{"message":"[Index
Management] Fix globalMaxRetention display error in data retention modal
(#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After
fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198113","number":198113,"mergeCommit":{"message":"[Index
Management] Fix globalMaxRetention display error in data retention modal
(#198113)\n\n## Summary\r\n\r\nFixes #197314 \r\n\r\n**After
fixup:**\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/9fa66906-fa06-4e12-81d8-7bcdaaff3ff3)\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/a7b9ee72-4ce3-4d2b-8c14-483ea2028597)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"1e7bb1ea37e7aa8b1ebb77f22fa34e2f1e3302a0"}}]}]
BACKPORT-->

Co-authored-by: Jusheng Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) 💝community Feature:Index Management Index and index templates 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.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Management] Data stream data retention model only displays max data retention in days
4 participants