-
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
[Snapshot & Restore] NP migration #59109
[Snapshot & Restore] NP migration #59109
Conversation
[key: string]: React.ReactNode; | ||
}>({}); | ||
|
||
// On sorting and pagination change |
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 re-wrote this component as there was an infinite re-render due to a state being update inside a useEffect
and with the new eslint rule the state being updated had to be put in the array of dependencies.
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
6088592
to
0bfe09a
Compare
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
export const setUiMetricServiceRestore = (_uiMetricService: UiMetricService) => { | ||
uiMetricService = _uiMetricService; | ||
}; | ||
// End hack |
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.
😂 🖐🏻 🎤
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 @sebelga ! I did not find any merge blockers but left some comments for discussion.
this.license = new License(); | ||
} | ||
|
||
public async setup( |
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.
Not sure when, but async
setup is going to be deprecated in the future and it will become sync code only
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.
Ok. Let's wait and see. I guess we'll all have to go and update all our plugins then.
isCloudEnabled: cloud !== undefined && cloud.isCloudEnabled, | ||
isSlmEnabled: pluginConfig.slmUi.enabled, | ||
}, | ||
lib: { |
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.
This is quite cool a cool idea! I hadn't thought of putting commonly used lib (pure) functions in here like this.
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 also find it very useful. If there is a need for another lib, add it to the dependency object and it is available on all routes without needing to add imports. Or if we change the route handler file path, no need to worry to update its imports.
@@ -0,0 +1,113 @@ | |||
/* |
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 wonder if we can get something like this available from core for all tests like this.
It would also be cool to test validation in something like this, there is a similar kind of hackery going on elsewhere (like in upgrade assistant), but I think this iteration is quite clean 👍. Perhaps something we can open an issue for (if there is not one already).
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.
Let see first if more apps need this mock. I had to find a solution for SR as the app had so many written unit tests (and no API integration tests). 👍
Thanks for the review @jloleysens ! |
…re/files-and-filetree * 'master' of github.com:elastic/kibana: (254 commits) Convert discover_page to ts, remove redundunt methods (elastic#59312) [Fix for Vis Editor] Revert setting time field to empty string when it's undefined (elastic#58873) Delete legacy search endpoint (elastic#59341) [Uptime] Improve duration chart (elastic#58404) [Snapshot & Restore] NP migration (elastic#59109) [ML] Add support for date_nanos time field in anomaly job wizard (elastic#59017) Revert "Makes alerting and actions optional properties for interface RequestH… (elastic#59264)" Change remote_clusters ID to remoteClusters (elastic#59246) Makes alerting and actions optional properties for interface RequestH… (elastic#59264) Clean up date histogram agg type. (elastic#58805) [ML] Management: fix license unsubscribe (elastic#59365) Remove documentation for server.cors settings (elastic#59096) Edit alert flyout (elastic#58964) [SIEM] Fix rule delete/duplicate actions (elastic#59306) move mouse to close obstructing tooltip (elastic#59214) Reset page after deleting (elastic#59310) Make sure phrases input filter triggers autosuggestons (elastic#59299) Add loading count source for http requests (elastic#59245) Revert "[ML] Transforms: Deprecate custom KibanaContext. (elastic#59133)" Expose metrics service to public API (elastic#59294) ... # Conflicts: # src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
This PR migrates the Snapshot & Restore app to the NP "plugins" folder.
How to test
Add a repository
Local file system
In order to test the snapshot feature locally we will need to have a folder to store the snapshots.
We can then launch ES and define this path as a known repository
Create an index
We won't be able to restore system indices that are not closed so let's create an index for our snapshot. Go to Console and create an index
Add a policy
Back to the Snapshot and restore app:
Create a snapshot
Restore from snapshot
In order to restore the snapshot we need to close the index we created above.
Disable the app
xpack.snapshot_restore.enabled: false
in yourkibana.dev.yml
fileDisable Snapshot Lifecycle Management
xpack.snapshot_restore.enabled: false
we just added in thekibana.dev.yml
xpack.snapshot_restore.slmUi.enabled: false
in yourkibana.dev.yml
fileNow re-enable SLM
xpack.snapshot_restore.slmUi.enabled: false
we just addedSecurity
A user needs to have the following roles in order to access the Snapshot and Restore app
Additionally, a user needs to have the
"cluster:manage_slm"
AND"cluster:monitor/state"
(this last one is new, I just discovered it when testing) privilege to access the "Policies" tab, even when it is enabled in Kibana configLet's create a role that does not have the minimum privileges to access the app
Disable security
xpack.security.enabled: false
in thekibana.dev.yml
fileAdd a plugin repository
AWS S3
cd .es/8.0.0
yarn es snapshot
!)