-
Notifications
You must be signed in to change notification settings - Fork 915
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
[Workspace] Delete saved objects by workspace #6013
Conversation
* Delete saved objects by workspace Signed-off-by: Hailong Cui <[email protected]> fix osd boostrap Signed-off-by: Hailong Cui <[email protected]> * add unit test Signed-off-by: Hailong Cui <[email protected]> * fix can't delete workspace due to invalid permission Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6013 +/- ##
==========================================
- Coverage 67.14% 67.12% -0.02%
==========================================
Files 3324 3324
Lines 64309 64318 +9
Branches 10341 10344 +3
==========================================
- Hits 43182 43176 -6
- Misses 18604 18618 +14
- Partials 2523 2524 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
A quick question that it seems all the changes are happening on server side, will we add a new public method like deleteByWorkspace in public/workspace.client? |
No, this's part of delete workspace logic at server side. There will have a public method |
* @returns {promise} - { took, timed_out, total, deleted, batches, version_conflicts, noops, retries, failures } | ||
*/ | ||
async deleteByWorkspace( | ||
workspace: string, |
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.
Is it taking the workspace name or id as the param ?
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.
if it's actually taking the id maybe let's try to name like workspaceId
or add the detail in the comment
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.
make sense. As we are using workspace everywhere to reference as its id, to make the name consistent, let me add this to parameter comment.
link check failed due to http://fakenews.co/opensearch-dashboards-test/v6.8.2.json is not reachable in this file
|
@@ -30,6 +30,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- [Multiple Datasource] Add Vega support to MDS by specifying a data source name in the Vega spec ([#5975](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5975)) | |||
- [Workspace] Consume workspace id in saved object client ([#6014](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6014)) | |||
|
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: useless empty line
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6013-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 735424bcaabfc752453c4d514ddd5d4b4f1b6d6d
# Push it to GitHub
git push --set-upstream origin backport/backport-6013-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
* [API] Delete saved objects by workspace (opensearch-project#216) * Delete saved objects by workspace Signed-off-by: Hailong Cui <[email protected]> fix osd boostrap Signed-off-by: Hailong Cui <[email protected]> * add unit test Signed-off-by: Hailong Cui <[email protected]> * fix can't delete workspace due to invalid permission Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> * update test case Signed-off-by: Hailong Cui <[email protected]> * Add change log Signed-off-by: Hailong Cui <[email protected]> * update change log format Signed-off-by: Hailong Cui <[email protected]> * update method comments to make it more clear Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> (cherry picked from commit 735424b)
* [Workspace] Delete saved objects by workspace (#6013) * [API] Delete saved objects by workspace (#216) * Delete saved objects by workspace Signed-off-by: Hailong Cui <[email protected]> fix osd boostrap Signed-off-by: Hailong Cui <[email protected]> * add unit test Signed-off-by: Hailong Cui <[email protected]> * fix can't delete workspace due to invalid permission Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> * update test case Signed-off-by: Hailong Cui <[email protected]> * Add change log Signed-off-by: Hailong Cui <[email protected]> * update change log format Signed-off-by: Hailong Cui <[email protected]> * update method comments to make it more clear Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> (cherry picked from commit 735424b) * Update CHANGELOG.md Co-authored-by: SuZhou-Joe <[email protected]> Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-6013-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 735424bcaabfc752453c4d514ddd5d4b4f1b6d6d
# Push it to GitHub
git push --set-upstream origin backport/backport-6013-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
Description
Add delete saved objects by workspace functionality. When delete workspace we need delete all saved objects under this workspace.
Issues Resolved
Partial of #4944
Closes #6016
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration