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

Support workspace in saved objects client in server side. #293

Conversation

SuZhou-Joe
Copy link
Collaborator

@SuZhou-Joe SuZhou-Joe commented Mar 13, 2024

Description

Support workspace in saved objects client in server side to unified the way to append workspace id in request payload. Some key points need to check:

  • Add a plugin state inside request to bypass workspace id.

Issues Resolved

Screenshot

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • 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 Mar 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 66.94%. Comparing base (0f34d69) to head (d5ccfad).

Files Patch % Lines
...ore/server/saved_objects/import/check_conflicts.ts 0.00% 0 Missing and 1 partial ⚠️
...rc/core/server/saved_objects/routes/bulk_create.ts 0.00% 1 Missing ⚠️
src/core/server/saved_objects/routes/create.ts 0.00% 1 Missing ⚠️
src/core/server/saved_objects/routes/export.ts 0.00% 1 Missing ⚠️
src/core/server/saved_objects/routes/find.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           workspace-pr-integr     #293       +/-   ##
========================================================
+ Coverage                35.17%   66.94%   +31.77%     
========================================================
  Files                     1885     2603      +718     
  Lines                    36421    49239    +12818     
  Branches                  6672     8898     +2226     
========================================================
+ Hits                     12810    32964    +20154     
+ Misses                   22761    14106     -8655     
- Partials                   850     2169     +1319     
Flag Coverage Δ
_2 55.35% <0.00%> (?)
_3 43.48% <0.00%> (?)
_4 35.16% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wanglam
Copy link
Collaborator

wanglam commented Mar 22, 2024

@SuZhou-Joe It seems the CI was failed. Could you fix them first?

@SuZhou-Joe SuZhou-Joe force-pushed the feature/current-workspace-in-server-side branch 3 times, most recently from 78286c2 to 357efa8 Compare March 28, 2024 02:21
@SuZhou-Joe SuZhou-Joe force-pushed the feature/current-workspace-in-server-side branch from 1690013 to 1b32316 Compare April 1, 2024 09:14
@SuZhou-Joe SuZhou-Joe merged commit 4fc9e70 into ruanyl:workspace-pr-integr Apr 8, 2024
43 checks passed
ruanyl pushed a commit that referenced this pull request Apr 15, 2024
…opensearch-project#6365)

* Support workspace in saved objects client in server side. (#293)

* feat: POC implementation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add some comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: revert dependency

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address one TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: some special logic on specific operation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as empty array for advanced settings

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: unified workspaces parameters when parsing from router

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve code coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use unified types

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address comments

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use request app to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use app state to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* refact: update types declaration

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: import error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use consts and add comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: change the priority value

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
SuZhou-Joe added a commit that referenced this pull request Apr 15, 2024
…objects client in server side (opensearch-project#6365) (#327)

* [Workspace] Support workspace in saved objects client in server side.  (opensearch-project#6365)

* Support workspace in saved objects client in server side. (#293)

* feat: POC implementation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add some comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: revert dependency

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address one TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: some special logic on specific operation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as empty array for advanced settings

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: unified workspaces parameters when parsing from router

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve code coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use unified types

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address comments

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use request app to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use app state to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* refact: update types declaration

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: import error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use consts and add comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: change the priority value

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove useless code

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
ruanyl pushed a commit that referenced this pull request May 17, 2024
…opensearch-project#6365) (opensearch-project#6573)

* Support workspace in saved objects client in server side. (#293)

* feat: POC implementation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add some comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: revert dependency

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address one TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address TODO

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: some special logic on specific operation

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as empty array for advanced settings

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: unified workspaces parameters when parsing from router

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve code coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: declare workspaces as null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use unified types

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove null

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: address comments

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use request app to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use app state to store request workspace id

Signed-off-by: SuZhou-Joe <[email protected]>

* refact: update types declaration

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: import error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add integration test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use consts and add comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: change the priority value

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
(cherry picked from commit 3b03fa9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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.

5 participants