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

Handle data sources and advanced settings as global object. #313

Conversation

SuZhou-Joe
Copy link
Collaborator

@SuZhou-Joe SuZhou-Joe commented Apr 3, 2024

Description

Handle data source and config as global objects.

  • Listing data source from global
  • Create data source into global
  • When import, gives error if user tries to import global objects into a workspace.

Issues Resolved

Screenshot

Import data source

image

Copy data source

image

Create data source in workspace(in normal flow, user won't be able to visit data source management page inside workspace)

image

Create advanced settings in workspace(in normal flow, user won't be able to visit advanced settings page inside workspace)

image

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

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2024

Codecov Report

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

Project coverage is 32.89%. Comparing base (0f34d69) to head (b1494b1).
Report is 18 commits behind head on workspace-pr-integr.

Files Patch % Lines
...ver/saved_objects/workspace_id_consumer_wrapper.ts 73.68% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           workspace-pr-integr     #313      +/-   ##
=======================================================
- Coverage                35.17%   32.89%   -2.28%     
=======================================================
  Files                     1885     2243     +358     
  Lines                    36421    45522    +9101     
  Branches                  6672     7153     +481     
=======================================================
+ Hits                     12810    14976    +2166     
- Misses                   22761    29816    +7055     
+ Partials                   850      730     -120     
Flag Coverage Δ
_1 32.89% <73.68%> (?)
_4 ?

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.

@SuZhou-Joe SuZhou-Joe marked this pull request as ready for review April 10, 2024 08:16
@SuZhou-Joe SuZhou-Joe changed the title List data source without workspace Handle data sources and advanced settings as global object. Apr 10, 2024
Signed-off-by: SuZhou-Joe <[email protected]>
Copy link
Owner

@ruanyl ruanyl left a comment

Choose a reason for hiding this comment

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

Does it sound more logical if we put these changes to the workspace conflict check wrapper?

@SuZhou-Joe
Copy link
Collaborator Author

Does it sound more logical if we put these changes to the workspace conflict check wrapper?

Exactly, I forgot why I wrote the logic into workspace_id_consumer. We should put these logic into conflict wrapper. Done for that.

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit a821167 into ruanyl:workspace-pr-integr Apr 18, 2024
43 checks passed
ruanyl pushed a commit that referenced this pull request Apr 22, 2024
…t. (opensearch-project#6524)

* Handle data sources and advanced settings as global object. (#313)

* 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]>

* feat: remove workspaces when listing data sources

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

* feat: remove useless code change

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

* feat: throw error if the type is not allowed

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

* feat: add unit test

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

* feat: add integration test

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

* feat: change the implementation

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

* feat: remove useless change

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

* feat: remove useless change

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

* feat: add integration test

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

* fix: unit test

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

* feat: add error message

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

* fix: integration test

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

* fix: integration test

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

* feat: remove useless change

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

* feat: add test case and add restrict on create method

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

* feat: change type

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

* feat: change comment

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

* feat: optimize test

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

* refactor: move logic to conflict check wrapper

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

* feat: remove useless change

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

* fix: unit test

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

* fix: unit test

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

---------

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

* Changeset file for PR opensearch-project#6524 created/updated

* Apply suggestions from code review

Co-authored-by: Lu Yu <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize based on comment

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

* feat: remove useless default value

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

---------

Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Lu Yu <[email protected]>
ruanyl pushed a commit that referenced this pull request May 17, 2024
…t. (opensearch-project#6524) (opensearch-project#6611)

* Handle data sources and advanced settings as global object. (#313)

* feat: POC implementation



* feat: add some comment



* feat: revert dependency



* feat: update comment



* feat: address one TODO



* feat: address TODO



* feat: add unit test



* feat: some special logic on specific operation



* feat: add integration test



* feat: declare workspaces as empty array for advanced settings



* feat: unified workspaces parameters when parsing from router



* feat: improve code coverage



* feat: declare workspaces as null



* feat: use unified types



* feat: update comment



* feat: remove null



* feat: address comments



* feat: use request app to store request workspace id



* feat: use app state to store request workspace id



* feat: remove workspaces when listing data sources



* feat: remove useless code change



* feat: throw error if the type is not allowed



* feat: add unit test



* feat: add integration test



* feat: change the implementation



* feat: remove useless change



* feat: remove useless change



* feat: add integration test



* fix: unit test



* feat: add error message



* fix: integration test



* fix: integration test



* feat: remove useless change



* feat: add test case and add restrict on create method



* feat: change type



* feat: change comment



* feat: optimize test



* refactor: move logic to conflict check wrapper



* feat: remove useless change



* fix: unit test



* fix: unit test



---------



* Changeset file for PR opensearch-project#6524 created/updated

* Apply suggestions from code review




* feat: optimize based on comment



* feat: remove useless default value



---------




(cherry picked from commit da88296)

Signed-off-by: SuZhou-Joe <[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>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Lu Yu <[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.

6 participants