-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Support max primary shard size rollover field #96545
[ILM] Support max primary shard size rollover field #96545
Conversation
- fixed behaviour to show missing value for rollover - updated jest snapshots
@elasticmachine merge upstream |
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.
Great work @jloleysens ! I tested locally and works as expected.
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
|
||
<MaxPrimaryShardSizeField /> |
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.
Thanks for splitting it up in separate components!
(validation) => validation.code === ROLLOVER_VALUE_REQUIRED_VALIDATION_CODE | ||
) | ||
); | ||
}, [form, formData]); |
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: to be slightly more precise and avoid triggering the effect whenever the form state changes you could just provide the getFields
handler in the dependency and not the complete form
object.
} | ||
}; | ||
|
||
export const integerValidator: ValidationFunc<FormInternal, string, string> = (arg) => { | ||
export const integerValidator: ValidationFunc<any, string, string> = (arg) => { |
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.
I see why you've added the any
here. I solved this kind of problem by not typing the schema
// schema.ts (L136)
export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
So I could correctly type here the validation.
…ax_primary_shard_size * 'master' of github.com:elastic/kibana: (99 commits) added missing optional chain for bracket notation (elastic#96939) [Discover][DocViewer] Fix toggle columns from doc viewer table tab (elastic#95748) [TSVB] Fix per-request caching of index patterns (elastic#97043) [Datatable] Fix filter cell flakiness (elastic#96934) Unskip heatmap suite and fixes flakiness (elastic#96941) [Fleet] Improve performance of data stream API (elastic#97058) [ML] Data Frame Analytics: remove beta badge (elastic#96977) [App Search] Migrate expanded rows for meta engines table in Engines Overview (elastic#96251) Instances latency distribution chart tooltips and axis fixes (elastic#95577) [Monitoring] Using primary average shard size (elastic#96177) [Workplace Search] Hide Kibana chrome on 3rd party connector redirects (elastic#97028) ## [Security Solution] Fixes `Exit full screen` and `Copy to cliboard` styling issues (elastic#96676) Index pattern field editor - Add warning on name or type change (elastic#95528) [App Search] Add small engine breadcrumb utility helper (elastic#96917) Copy esArchiver commands from ./reassign.ts to fix tests (elastic#97012) [Security Solution][Detections] Updates MITRE Tactics, Techniques, and Subtechniques for 7.13 (elastic#97011) Index patterns server - throw correct error on field caps 404 (elastic#95879) Use `EuiThemeProvider` in lists plugin tests and stories (elastic#96129) [npm] upgrade caniuse database (elastic#97002) chore(NA): moving @kbn/apm-utils into bazel (elastic#96227) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts
@@ -0,0 +1,13 @@ | |||
.ilmFieldDeprecationWarning { |
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.
I'll take a look locally, but these negative margins have me wondering how well this will hold up over time/cross-browser/responsively. Perhaps we could avoid floating the icon to the left of the input by using a prepend or append? https://elastic.github.io/eui/#/forms/form-controls#prepend-and-append
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.
After checking this out a bit more, I do think we should take a different approach here. At smaller sizes (granted its not the most common use case) the warning is not visible. Further, since this triggers for any value, then we should just show it by default / all the time. The prepend or append approach achieves this result.
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.
Hey @ryankeairns ! Thanks for the review and checking out the code locally, happy to make adjustments per your recommendations.
Further, since this triggers for any value, then we should just show it by default / all the time
I was considering this in the initial implementation, but I was concerned that always having the yellow alert logo visible would draw the users attention where it may not be needed. I'd be curious to get your thoughts on this:
We could also show the prepend when the user enters a value since I don't think the pop in effect is particularly disorientating in this case:
CC @mdefazio
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.
Thanks for trying this out. I'll defer to DeFazio on the final adjustments.
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.
See comments below about handling the warning/icon in a different way. Thanks
@@ -0,0 +1,13 @@ | |||
.ilmFieldDeprecationWarning { |
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.
After checking this out a bit more, I do think we should take a different approach here. At smaller sizes (granted its not the most common use case) the warning is not visible. Further, since this triggers for any value, then we should just show it by default / all the time. The prepend or append approach achieves this result.
@jloleysens @mdefazio @ryankeairns Would this use case be aided by elastic/eui#1200, which requests support for warning and success styles for form row error messages? |
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.
Just a couple minor changes. Otherwise LGTM.
'xpack.indexLifecycleMgmt.hotPhase.maximumIndexSizeDeprecationMessage', | ||
{ | ||
defaultMessage: | ||
'Maximum index size is deprecated and will be removed in future versions of the Elastic stack. Please use maximum primary shard size instead.', |
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.
'Maximum index size is deprecated and will be removed in future versions of the Elastic stack. Please use maximum primary shard size instead.', | |
'Maximum index size is deprecated and will be removed in a future version. Use maximum primary shard size instead.', |
@@ -107,7 +108,7 @@ export const HotPhase: FunctionComponent = () => { | |||
<EuiSpacer size="s" /> | |||
<FormattedMessage | |||
id="xpack.indexLifecycleMgmt.editPolicy.hotPhase.rolloverDefaultsTipContent" | |||
defaultMessage="Rollover when an index is 30 days old or reaches 50 gigabytes." | |||
defaultMessage="Rollover when an index is 30 days old or the primary shard reaches 50 gigabytes." |
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.
An index can have multiple primary shards.
defaultMessage="Rollover when an index is 30 days old or the primary shard reaches 50 gigabytes." | |
defaultMessage="Roll over when an index is 30 days old or any primary shard reaches 50 gigabytes." |
Apologies for the slow response on this. We took this opportunity to go through this as an example PR with @dborodyansky . @cjcenizal I think that approach could definitely work. We'll have to see if there are any spacing / length issues because these are 2 form fields next to each, so would the help text from one form field be able to extend under the next one (maybe i'm missing an easy implementation here, but this sounds difficult). So we'd likely have a line break in this text and it take up a lot of space. Maybe that's ok though. If we go with the prepend approach, a few thoughts:
I'm showing the example if we keep the icon persistent A few other things that may or may not be relevant for this PR, but wanted to note:
|
Another option would be to just change the label to |
- implmented always showing the warning icon and updated the color - cleaned up test helpers
by reducing the gutter size before defazios feedback - fixed alignment issue between numeric rollover inputs and their unit select field by adding flex-end styling to the groups
@mdefazio @ryankeairns @debadair @cjcenizal Thank you all for the great feedback! I believe this PR is ready for another round of review. After some thought, I landed on the following approach:
This approach reduces code changes (we don't have additional states to track) so if we ever want to change this it will be really simple. Additionally, I opted for the prepended icon tip instead of adding (Screenshots with flex align and gutter sizing adjustments) @sebelga not sure whether you want to go over the code again, I'm quite confident we have not introduced regressions since your last review since conditional logic has been removed. |
Reviewed your commits from yesterday and today and LGTM! 👍 |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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.
LGTM!
I am going to go ahead and merge this PR since I think we have addressed all outstanding questions regarding the deprecated field (including requested copy changes). |
* added max primary shard size rollover field * large-ish refactor of the hot phase component to move the rollover fields to their own components * added comment * address i18n issue * - fixed jest tests - fixed behaviour to show missing value for rollover - updated jest snapshots * added field deprecation component * added test for whether deprecation icon is visible * remove unused import, remove type generic from FormSchema * fixed getting "getFields" from incorrect object * wip!!! * - removed FieldDeprecationWarning component and associated tests - implmented always showing the warning icon and updated the color - cleaned up test helpers * - more tightly grouped the numeric inputs with their unit selects by reducing the gutter size before defazios feedback - fixed alignment issue between numeric rollover inputs and their unit select field by adding flex-end styling to the groups Co-authored-by: Kibana Machine <[email protected]>
* added max primary shard size rollover field * large-ish refactor of the hot phase component to move the rollover fields to their own components * added comment * address i18n issue * - fixed jest tests - fixed behaviour to show missing value for rollover - updated jest snapshots * added field deprecation component * added test for whether deprecation icon is visible * remove unused import, remove type generic from FormSchema * fixed getting "getFields" from incorrect object * wip!!! * - removed FieldDeprecationWarning component and associated tests - implmented always showing the warning icon and updated the color - cleaned up test helpers * - more tightly grouped the numeric inputs with their unit selects by reducing the gutter size before defazios feedback - fixed alignment issue between numeric rollover inputs and their unit select field by adding flex-end styling to the groups Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Fixes #92037
Screenshots
How to test
yarn es snapshot; yarn start
For copy review
x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/components/max_index_size_field.tsx
x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx
Release note
The ILM policy configuration UI now supports the new maximum primary index size field in the rollover action.
Checklist