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

Refact: move workspace specific logic to savedObjectWrapper #8

Open
wants to merge 47 commits into
base: feature/setup-workspace-server-api-main
Choose a base branch
from

Conversation

SuZhou-Joe
Copy link
Owner

Description

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

gaobinlong and others added 26 commits September 30, 2023 10:51
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
…oject#189)

* feat: optimize logic when checkConflict and bulkCreate

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add options.workspace check

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: throw error when workspace check error in repository create

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: modify judgement

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: always get objects from DB when create-with-override

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
…tory

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
…tory

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@SuZhou-Joe SuZhou-Joe changed the base branch from main to feature/optional-workspaces-params-in-repository October 18, 2023 08:25
@SuZhou-Joe SuZhou-Joe changed the base branch from feature/optional-workspaces-params-in-repository to feature/setup-workspace-server-api-main October 18, 2023 08:26
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Zhou Su and others added 18 commits October 18, 2023 16:46
…kspace

Signed-off-by: Zhou Su <suzhou@dev-dsk-suzhou-2a-8ce7a7a7.us-west-2.amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: Josh Romero <rmerqg@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@SuZhou-Joe SuZhou-Joe force-pushed the feature/optional-workspaces-params-in-repository-wrapper branch from 292931a to 2a8635e Compare October 18, 2023 08:48
@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2023

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (bdb93cb) 66.79% compared to head (a50d8ff) 66.74%.

Files Patch % Lines
...ore/server/saved_objects/service/lib/repository.ts 66.66% 0 Missing and 5 partials ⚠️
...rc/core/server/saved_objects/routes/bulk_create.ts 0.00% 4 Missing ⚠️
...server/saved_objects/import/validate_references.ts 57.14% 2 Missing and 1 partial ⚠️
src/core/server/saved_objects/routes/find.ts 0.00% 3 Missing ⚠️
src/core/server/saved_objects/routes/import.ts 0.00% 3 Missing ⚠️
...rver/saved_objects/routes/resolve_import_errors.ts 0.00% 3 Missing ⚠️
src/core/server/saved_objects/routes/create.ts 0.00% 2 Missing ⚠️
...ed_objects/export/get_sorted_objects_for_export.ts 50.00% 0 Missing and 1 partial ⚠️
src/core/server/saved_objects/routes/export.ts 0.00% 1 Missing ⚠️
src/core/server/saved_objects/service/lib/utils.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@                             Coverage Diff                             @@
##           feature/setup-workspace-server-api-main       #8      +/-   ##
===========================================================================
- Coverage                                    66.79%   66.74%   -0.05%     
===========================================================================
  Files                                         3288     3288              
  Lines                                        63132    63169      +37     
  Branches                                     10053    10071      +18     
===========================================================================
- Hits                                         42169    42164       -5     
- Misses                                       18489    18602     +113     
+ Partials                                      2474     2403      -71     
Flag Coverage Δ
Linux_1 35.26% <ø> (ø)
Linux_2 ?
Linux_3 43.77% <0.00%> (-0.07%) ⬇️
Linux_4 35.32% <0.00%> (-0.04%) ⬇️
Windows_1 35.27% <ø> (ø)
Windows_2 55.26% <47.05%> (-0.01%) ⬇️
Windows_3 43.78% <0.00%> (-0.06%) ⬇️
Windows_4 35.32% <0.00%> (-0.04%) ⬇️

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.

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
SuZhou-Joe added a commit that referenced this pull request Jun 8, 2024
…t#6105)

* Import sample data to workspace

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Enable workspace ui plugin

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Add changelog for import sample data to current workspace

Signed-off-by: Lin Wang <wonglam@amazon.com>

* feat: register sample data as standalone app (#8)

* feat: register sample data as standalone app

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: optimize code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: use props to pass homeLink

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add unit test

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Retrieve workspace id from request

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Remove workspace id in query

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Move changelog to fragments

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Fix sample data list unit tests

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Remove no need workspaces deps

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Remove manual created changelogs

Signed-off-by: Lin Wang <wonglam@amazon.com>

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

* Enable sample data in workspace overview page (#9)

* enable sample data in workspace overview page

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

* add comments for empty id

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

---------

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

* Add unit tests for getFinalSavedObjects in data sets util file

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Add unit tests for renderImportSampleDataApp destroy

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Address PR comments

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Remove history listen in renderImportSampleDataApp

Signed-off-by: Lin Wang <wonglam@amazon.com>

* Remove Route for workspace import sample data entry point

Signed-off-by: Lin Wang <wonglam@amazon.com>

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Hailong Cui <ihailong@amazon.com>
SuZhou-Joe added a commit that referenced this pull request Jul 1, 2024
…t#6105) (opensearch-project#6826)

* Import sample data to workspace



* Enable workspace ui plugin



* Add changelog for import sample data to current workspace



* feat: register sample data as standalone app (#8)

* feat: register sample data as standalone app



* feat: optimize code



* feat: add comment



* feat: use props to pass homeLink



* feat: add unit test



---------



* Retrieve workspace id from request



* Remove workspace id in query



* Move changelog to fragments



* Fix sample data list unit tests



* Remove no need workspaces deps



* Remove manual created changelogs



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

* Enable sample data in workspace overview page (#9)

* enable sample data in workspace overview page



* add comments for empty id



---------



* Add unit tests for getFinalSavedObjects in data sets util file



* Add unit tests for renderImportSampleDataApp destroy



* Address PR comments



* Remove history listen in renderImportSampleDataApp



* Remove Route for workspace import sample data entry point



---------







(cherry picked from commit 3e9a159)

Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
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: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: Hailong Cui <ihailong@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