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

Delete saved object when deleting workspace #84

Merged
merged 11 commits into from
Sep 12, 2023

Conversation

Hailong-am
Copy link
Collaborator

Description

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 Aug 11, 2023

Codecov Report

Merging #84 (ceb93ec) into workspace (0bd03df) will decrease coverage by 5.10%.
Report is 3 commits behind head on workspace.
The diff coverage is 12.82%.

@@              Coverage Diff              @@
##           workspace      #84      +/-   ##
=============================================
- Coverage      65.75%   60.66%   -5.10%     
=============================================
  Files           3336     2898     -438     
  Lines          64555    56652    -7903     
  Branches       10292     9084    -1208     
=============================================
- Hits           42450    34366    -8084     
- Misses         19523    20290     +767     
+ Partials        2582     1996     -586     
Flag Coverage Δ
Linux_1 34.74% <ø> (?)
Linux_2 54.66% <12.82%> (?)
Linux_3 42.51% <0.00%> (?)
Windows_1 ?
Windows_2 ?
Windows_3 ?
Windows_4 ?

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

Files Changed 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 75.88% <11.11%> (-4.01%) ⬇️
...rver/saved_objects/service/saved_objects_client.ts 54.54% <33.33%> (-2.13%) ⬇️

... and 705 files 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 August 15, 2023 08:27
* entirely. This method and [`addToWorkspaces`]{@link SavedObjectsRepository.addToWorkspaces} are the only ways to change which workspace a
* saved object is shared to.
*/
async deleteFromWorkspaces(
Copy link
Owner

Choose a reason for hiding this comment

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

It looks this function has not yet used, I guess we should always call this function when deleting object within a workspace, am I right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not used for now. when we should call this function that depends on the UX flow of share. The delete method is used for all saved objects deletion and should works well before share is implemented.

@Hailong-am Hailong-am force-pushed the feature/delete_from_workspace branch from 9a578e4 to 24c2f91 Compare September 11, 2023 03:02
@Hailong-am Hailong-am merged commit f465403 into ruanyl:workspace Sep 12, 2023
45 of 47 checks passed
opensearch-workspace-development bot pushed a commit that referenced this pull request Sep 13, 2023
* remove objects from workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* fix osd bootstrap issue

Signed-off-by: Hailong Cui <[email protected]>

* add force option to delete saved objects when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* remove force delete option

Signed-off-by: Hailong Cui <[email protected]>

* redirect only delete workspace successfuly

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* Add more unit test cases

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
(cherry picked from commit f465403)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Hailong-am pushed a commit that referenced this pull request Sep 13, 2023
* remove objects from workspace



* delete saved object when deleting workspace



* fix osd bootstrap issue



* add force option to delete saved objects when deleting workspace



* remove force delete option



* redirect only delete workspace successfuly



* delete saved object when deleting workspace



* delete saved object when deleting workspace



* Add more unit test cases



---------


(cherry picked from commit f465403)

Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Sep 15, 2023
* remove objects from workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* fix osd bootstrap issue

Signed-off-by: Hailong Cui <[email protected]>

* add force option to delete saved objects when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* remove force delete option

Signed-off-by: Hailong Cui <[email protected]>

* redirect only delete workspace successfuly

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* Add more unit test cases

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
SuZhou-Joe pushed a commit that referenced this pull request Sep 16, 2023
* remove objects from workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* fix osd bootstrap issue

Signed-off-by: Hailong Cui <[email protected]>

* add force option to delete saved objects when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* remove force delete option

Signed-off-by: Hailong Cui <[email protected]>

* redirect only delete workspace successfuly

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* delete saved object when deleting workspace

Signed-off-by: Hailong Cui <[email protected]>

* Add more unit test cases

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
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.

3 participants