Skip to content

[Snapshot and Restore] Update help text for common repository settings#97652

Merged
alisonelizabeth merged 12 commits intoelastic:masterfrom
alisonelizabeth:sr/repository_help_text
Apr 23, 2021
Merged

[Snapshot and Restore] Update help text for common repository settings#97652
alisonelizabeth merged 12 commits intoelastic:masterfrom
alisonelizabeth:sr/repository_help_text

Conversation

@alisonelizabeth
Copy link
Copy Markdown
Contributor

@alisonelizabeth alisonelizabeth commented Apr 20, 2021

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, and max_snapshot_bytes_per_sec. I also added tests for each repository type, as we currently only had tests for the fs repository.

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, hdfs and azure.

  1. Run yarn es snapshot from kibana dir like normal, then exit out of process
  2. Run cd .es/8.0.0 from kibana dir
  3. Run bin/elasticsearch-plugin install https://snapshots.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-8.0.0-SNAPSHOT.zip
  4. Replace occurrences of repository-s3 with the plugin you want to install and repeat step 3 for any additional plugins
  5. Run bin/elasticsearch

Screenshots

Screen Shot 2021-04-20 at 9 31 01 AM

Screen Shot 2021-04-20 at 9 30 34 AM

Release note

The repository form in Snapshot and Restore was updated to include information on default values for common settings.

@alisonelizabeth alisonelizabeth added release_note:enhancement v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI labels Apr 20, 2021
@alisonelizabeth alisonelizabeth marked this pull request as ready for review April 21, 2021 13:54
@alisonelizabeth alisonelizabeth requested a review from a team as a code owner April 21, 2021 13:54
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@alisonelizabeth alisonelizabeth requested a review from sebelga April 21, 2021 13:56
@jrodewig jrodewig self-requested a review April 21, 2021 14:33
Copy link
Copy Markdown
Contributor

@jrodewig jrodewig left a comment

Choose a reason for hiding this comment

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

LGTM. I left some non-blocking suggestions. Feel free to ignore those if wanted.

Thanks @alisonelizabeth!

alisonelizabeth and others added 6 commits April 21, 2021 12:41
…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>
@alisonelizabeth
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great! So we still have some of those nextTick floating around.. 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) => { ... }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍 good point. I updated this.

example2: <EuiCode>10mb</EuiCode>,
example3: <EuiCode>5k</EuiCode>,
example4: <EuiCode>1024B</EuiCode>,
defaultSize: <EuiCode>40mb</EuiCode>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
snapshotRestore 176 180 +4

Async chunks

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

id before after diff
snapshotRestore 470.3KB 459.5KB -10.8KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
snapshotRestore 40.8KB 40.6KB -263.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.14.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show default values for repository settings in Snapshot and Restore UI

5 participants