-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled #85292
[ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled #85292
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. Tested locally. Great catch on the validation bug! Is there a test that we could add that might have caught this?
message: i18nTexts.editPolicy.errors.maximumSizeRequiredMessage, | ||
}, | ||
]); | ||
return path === ROLLOVER_FORM_PATHS.maxAge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: might be a little easier to read using if...else
instead of a nested ternary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A switch/case could also work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjcenizal in this case the switch statement would look something like:
switch (true) {
case 1 === 1:
return 'ok';
case 2 === 2:
return 'ok then';
default:
return 'not ok';
}
Just curious to hear thoughts on that pattern where we have true
as the deciding condition and predicate expressions per case. IMO it might be less easy to grok for the majority of readers because it is less common - WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My take is it does look pretty neat though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jloleysens I was thinking something more like this unless I'm missing something:
switch (path) {
case ROLLOVER_FORM_PATHS.maxAge:
return {
code: ROLLOVER_EMPTY_VALIDATION,
message: i18nTexts.editPolicy.errors.maximumAgeRequiredMessage,
};
case ROLLOVER_FORM_PATHS.maxDocs:
return {
code: ROLLOVER_EMPTY_VALIDATION,
message: i18nTexts.editPolicy.errors.maximumDocumentsRequiredMessage,
};
default:
return {
code: ROLLOVER_EMPTY_VALIDATION,
message: i18nTexts.editPolicy.errors.maximumSizeRequiredMessage,
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK, I had a different idea. Yours is simpler!
@alisonelizabeth thanks for the review! I've addressed your feedback in my latest commit.
Yes, but I don't think adding a test at the level of this plugin is the correct place. This plugin does specify a test for the validation on rollover showing under expected conditions:
That should theoretically have covered this, but because of how the form lib works with validation on submit, this was not caught. So I pivoted to using the form lib in a way that it does work, we should probably add a test case for this in the form lib - I'll open an issue for it. |
@alisonelizabeth issue here: #85383 |
💚 Build SucceededMetrics [docs]Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
…enabled (elastic#85292) * pivot to different rollover validation mechanism * implement stakeholder feedback to show forcemerge in hot * replace ternary with if..else statements * make rollover validation test more comprehensive
…k-field-to-hot-phase * 'master' of github.com:elastic/kibana: (429 commits) simplify popover open state logic (elastic#85379) [Logs UI][Metrics UI] Move actions to the kibana header (elastic#84648) [Search Source] Do not pick scripted fields if * provided (elastic#85133) [Search] Session SO polling (elastic#84225) [Transform] Replace legacy elasticsearch client (elastic#84932) [Uptime]Refactor header and action menu (elastic#83779) Fix agg select external link (elastic#85380) [ILM] Show forcemerge in hot when rollover is searchable snapshot is enabled (elastic#85292) clear using keyboard (elastic#85042) [GS] add tag and dashboard suggestion results (elastic#85144) [ML] API integration tests - skip GetAnomaliesTableData Add ECS field for event.code. (elastic#85109) [Functional][TSVB] Wait for markdown textarea to be cleaned (elastic#85128) skip flaky suite (elastic#62060) skip flaky suite (elastic#85098) Bump highlight.js to v9.18.5 (elastic#84296) Add `server.publicBaseUrl` config (elastic#85075) [Alerting & Actions ] More debug logging (elastic#85149) [Security Solution][Case] Manual attach alert to a case (elastic#82996) Loosen UUID regex to accept uuidv1 or uuidv4 (elastic#85338) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts # x-pack/plugins/index_lifecycle_management/server/routes/api/policies/register_create_route.ts
Summary
Gif of SS