[Snapshot and Restore] Update help text for common repository settings#97652
Conversation
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
jrodewig
left a comment
There was a problem hiding this comment.
LGTM. I left some non-blocking suggestions. Feel free to ignore those if wanted.
Thanks @alisonelizabeth!
…repository_form/type_settings/common/max_restore.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
…repository_form/type_settings/common/max_snapshots.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
…repository_form/type_settings/common/chunk_size.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
…repository_form/type_settings/common/max_snapshots.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
…repository_form/type_settings/s3_settings.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
…repository_form/type_settings/common/max_restore.tsx Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
|
@elasticmachine merge upstream |
sebelga
left a comment
There was a problem hiding this comment.
Great job @alisonelizabeth ! Tested locally and works as expected 👍
I like to see this composition pattern for our settings, it works very well.
|
|
||
| await act(async () => { | ||
| actions.clickSubmitButton(); | ||
| await nextTick(); |
There was a problem hiding this comment.
Great! So we still have some of those nextTick floating around.. 🤔
There was a problem hiding this comment.
Yes, unfortunately. I did not go through all of the tests, so there may be more in SR that need to be addressed.
| text: option, | ||
| })); | ||
|
|
||
| const updateSettings = (e: React.ChangeEvent<HTMLInputElement>, settingsName: string) => { |
There was a problem hiding this comment.
nit: when possible I try to keep the function dependencies as small as possible. Probably a habit from testing where it makes mocking easier. 😊 In this case we only really care about the key|value so I would have probably written
const updateSettings = (name: string, value: string) => { ... }There was a problem hiding this comment.
👍 good point. I updated this.
| example2: <EuiCode>10mb</EuiCode>, | ||
| example3: <EuiCode>5k</EuiCode>, | ||
| example4: <EuiCode>1024B</EuiCode>, | ||
| defaultSize: <EuiCode>40mb</EuiCode>, |
There was a problem hiding this comment.
I wonder if it wouldn't be better to have a constant object exported with the default sizes. We would then have a single source of truth to update them (and a single file to look at). At the same time there are only 3 values... WDYT?
There was a problem hiding this comment.
I considered this as well. I think I'm going to leave as-is for now. The max_snapshots setting has a specific default value, but the other two settings default to unlimited/null.
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Fixes #44454
The original intent of this PR was to update the help text for some common repository settings to include default values. However, once I started working on it, I noticed the common fields are duplicated across the different repository types. I ended up creating common components for
chunk_size,max_restore_bytes_per_sec, andmax_snapshot_bytes_per_sec. I also added tests for each repository type, as we currently only had tests for thefsrepository.Note: there are more common settings that can be extracted (e.g.,
readonly,compressed), but I felt that was out of scope for this PR.How to test
The CITs should cover all repository types changed in this PR. If you would like to view each one, you will need to install the plugins for
s3,gcs,hdfsandazure.yarn es snapshotfrom kibana dir like normal, then exit out of processcd .es/8.0.0from kibana dirbin/elasticsearch-plugin install https://snapshots.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-8.0.0-SNAPSHOT.ziprepository-s3with the plugin you want to install and repeat step 3 for any additional pluginsbin/elasticsearchScreenshots
Release note
The repository form in Snapshot and Restore was updated to include information on default values for common settings.