Skip to content
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

[API] Delete saved objects by workspace #216

Conversation

Hailong-am
Copy link
Collaborator

Description

  1. Delete saved objects by workspace

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2023

Codecov Report

Merging #216 (82c812b) into workspace-pr-integr (0906bf4) will increase coverage by 0.00%.
The diff coverage is 88.88%.

@@                 Coverage Diff                  @@
##           workspace-pr-integr     #216   +/-   ##
====================================================
  Coverage                66.48%   66.48%           
====================================================
  Files                     3412     3412           
  Lines                    65231    65240    +9     
  Branches                 10456    10459    +3     
====================================================
+ Hits                     43367    43377   +10     
  Misses                   19259    19259           
+ Partials                  2605     2604    -1     
Flag Coverage Δ
Linux_ ?
_1 34.82% <ø> (ø)
_2 55.46% <88.88%> (+0.01%) ⬆️
_3 44.49% <0.00%> (-0.01%) ⬇️
_4 34.84% <11.11%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/core/server/index.ts 100.00% <ø> (ø)
...erver/saved_objects/service/lib/repository.mock.ts 100.00% <ø> (ø)
...ore/server/saved_objects/service/lib/repository.ts 92.33% <100.00%> (+0.09%) ⬆️
...rver/saved_objects/service/saved_objects_client.ts 61.53% <66.66%> (+0.66%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Hailong-am Hailong-am marked this pull request as ready for review October 10, 2023 07:21
body: {
script: {
source: `
if (!ctx._source.containsKey('workspaces')) {
Copy link
Owner

Choose a reason for hiding this comment

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

Q: will the results contain object without workspaces field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Base on current implementation, it won't.

Signed-off-by: Hailong Cui <ihailong@amazon.com>

fix osd boostrap

Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
@Hailong-am Hailong-am merged commit 7773811 into ruanyl:workspace-pr-integr Oct 13, 2023
36 checks passed
@opensearch-workspace-development

The backport to workspace failed:

The process '/usr/bin/git' failed with exit code 128

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-workspace workspace
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-workspace
# Create a new branch
git switch --create backport/backport-216-to-workspace
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 77738118758626f30aa8ae5517e25e739a884cbd
# Push it to GitHub
git push --set-upstream origin backport/backport-216-to-workspace
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-workspace

Then, create a pull request where the base branch is workspace and the compare/head branch is backport/backport-216-to-workspace.

wanglam pushed a commit that referenced this pull request Feb 26, 2024
* Delete saved objects by workspace

Signed-off-by: Hailong Cui <ihailong@amazon.com>

fix osd boostrap

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix can't delete workspace due to invalid permission

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
ruanyl pushed a commit that referenced this pull request Mar 15, 2024
* [API] Delete saved objects by workspace (#216)

* Delete saved objects by workspace

Signed-off-by: Hailong Cui <ihailong@amazon.com>

fix osd boostrap

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix can't delete workspace due to invalid permission

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update test case

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* Add change log

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update change log format

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update method comments to make it more clear

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
SuZhou-Joe pushed a commit that referenced this pull request Mar 18, 2024
* Delete saved objects by workspace

Signed-off-by: Hailong Cui <ihailong@amazon.com>

fix osd boostrap

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix can't delete workspace due to invalid permission

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
ruanyl pushed a commit that referenced this pull request Apr 16, 2024
…rch-project#6424)

* [Workspace] Delete saved objects by workspace (opensearch-project#6013)

* [API] Delete saved objects by workspace (#216)

* Delete saved objects by workspace

Signed-off-by: Hailong Cui <ihailong@amazon.com>

fix osd boostrap

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add unit test

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* fix can't delete workspace due to invalid permission

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update test case

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* Add change log

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update change log format

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* update method comments to make it more clear

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
(cherry picked from commit 735424b)

* Update CHANGELOG.md

Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants