-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Workspace] Add optional workspaces parameter to all saved objects API #185
[Workspace] Add optional workspaces parameter to all saved objects API #185
Conversation
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Codecov Report
@@ Coverage Diff @@
## workspace-pr-integr #185 +/- ##
=======================================================
- Coverage 66.49% 66.47% -0.03%
=======================================================
Files 3408 3408
Lines 65149 65222 +73
Branches 10431 10457 +26
=======================================================
+ Hits 43323 43355 +32
- Misses 19237 19344 +107
+ Partials 2589 2523 -66
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 30 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
feat: update snapshot
…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>
[Feature]Add unit test
@@ -625,6 +625,27 @@ describe('#getQueryParams', () => { | |||
]); | |||
}); | |||
}); | |||
|
|||
describe('when using workspace search', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add cases for searching multiple workspaces? We need to test the OR logic among workspaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add later when we start supporting share case, currently we should only have one workspace.
src/core/server/saved_objects/service/lib/search_dsl/query_params.ts
Outdated
Show resolved
Hide resolved
src/core/server/saved_objects/service/lib/search_dsl/query_params.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
The backport to
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-185-to-workspace
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c05b434ec10726e6e1034a97d215887372ff8c51
# Push it to GitHub
git push --set-upstream origin backport/backport-185-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 |
…PI (#185) * [Workspace] Add workspaces parameters to all saved objects API Signed-off-by: gaobinlong <gbinlong@amazon.com> * feat: update snapshot Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize logic when checkConflict and bulkCreate (#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> * feat: call get when create with override Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test according to count Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add integration test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * fix: unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: regenerate ids when import Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add more unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: minor changes logic on repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimization according to comments Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize code Signed-off-by: SuZhou-Joe <suzhou@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
…PI (#185) * [Workspace] Add workspaces parameters to all saved objects API Signed-off-by: gaobinlong <gbinlong@amazon.com> * feat: update snapshot Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize logic when checkConflict and bulkCreate (#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> * feat: call get when create with override Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test according to count Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add integration test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * fix: unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: regenerate ids when import Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add more unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: minor changes logic on repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimization according to comments Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize code Signed-off-by: SuZhou-Joe <suzhou@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
…PI (#185) * [Workspace] Add workspaces parameters to all saved objects API Signed-off-by: gaobinlong <gbinlong@amazon.com> * feat: update snapshot Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize logic when checkConflict and bulkCreate (#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> * feat: call get when create with override Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test according to count Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add integration test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * fix: unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: regenerate ids when import Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: add more unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: minor changes logic on repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update unit test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimization according to comments Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: update test Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: optimize code Signed-off-by: SuZhou-Joe <suzhou@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Description
The main change of this PR are:
workspaces
field to the mappings of the OSD index(.kibana)workspaces
parameter to all the saved objects APICheck List
yarn test:jest
yarn test:jest_integration
yarn test:ftr