-
Notifications
You must be signed in to change notification settings - Fork 917
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]Validate features parameter in workspace create and update API #7884
[Workspace]Validate features parameter in workspace create and update API #7884
Conversation
Signed-off-by: Lin Wang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7884 +/- ##
==========================================
- Coverage 64.33% 64.33% -0.01%
==========================================
Files 3676 3677 +1
Lines 81196 81206 +10
Branches 12944 12946 +2
==========================================
+ Hits 52235 52241 +6
Misses 25751 25751
- Partials 3210 3214 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
0852bcd
to
1d9bf60
Compare
'all', | ||
'observability', | ||
'security-analytics', | ||
'analytics', | ||
'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 we get the ids from default_nav_group.ts?
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.
Sure, I got an error Unexpected path "../../../../core/utils" imported in restricted zone. Plugins may only import from src/core/server and src/core/public @osd/eslint/no-restricted-paths
when commit changes . But after I change to import { DEFAULT_NAV_GROUPS } from '../../../../core/public';
, the commit goes well. Will update this.
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
…date-API Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
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-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7884-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 76de9a30abece503cecd7ce355a8c9bacbfabcff
# Push it to GitHub
git push --set-upstream origin backport/backport-7884-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x Then, create a pull request where the |
… API (#7884) * Add validate for features field in workspace create and update API Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR #7884 created/updated * Changeset file for PR #7884 created/updated * Move router outside align with other plugins Signed-off-by: Lin Wang <[email protected]> * Add ut and fix integration tests Signed-off-by: Lin Wang <[email protected]> * Import use case id from default nav groups Signed-off-by: Lin Wang <[email protected]> * Fix workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Share feature config generator between publicn and server Signed-off-by: Lin Wang <[email protected]> * Fix osd server crashed due to import from public Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 76de9a3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
… API (opensearch-project#7884) * Add validate for features field in workspace create and update API Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR opensearch-project#7884 created/updated * Changeset file for PR opensearch-project#7884 created/updated * Move router outside align with other plugins Signed-off-by: Lin Wang <[email protected]> * Add ut and fix integration tests Signed-off-by: Lin Wang <[email protected]> * Import use case id from default nav groups Signed-off-by: Lin Wang <[email protected]> * Fix workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Share feature config generator between publicn and server Signed-off-by: Lin Wang <[email protected]> * Fix osd server crashed due to import from public Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* [Workspace]Validate features parameter in workspace create and update API (#7884) * Add validate for features field in workspace create and update API Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR #7884 created/updated * Changeset file for PR #7884 created/updated * Move router outside align with other plugins Signed-off-by: Lin Wang <[email protected]> * Add ut and fix integration tests Signed-off-by: Lin Wang <[email protected]> * Import use case id from default nav groups Signed-off-by: Lin Wang <[email protected]> * Fix workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Share feature config generator between publicn and server Signed-off-by: Lin Wang <[email protected]> * Fix osd server crashed due to import from public Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> * [Workspace]Fix dynamicConfigServiceMock import path in workspace routes UT (#7954) * Fix dynamicConfigServiceMock import path in workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR #7954 created/updated --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* [Workspace]Validate features parameter in workspace create and update API (#7884) * Add validate for features field in workspace create and update API Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR #7884 created/updated * Changeset file for PR #7884 created/updated * Move router outside align with other plugins Signed-off-by: Lin Wang <[email protected]> * Add ut and fix integration tests Signed-off-by: Lin Wang <[email protected]> * Import use case id from default nav groups Signed-off-by: Lin Wang <[email protected]> * Fix workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Share feature config generator between publicn and server Signed-off-by: Lin Wang <[email protected]> * Fix osd server crashed due to import from public Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> * [Workspace]Fix dynamicConfigServiceMock import path in workspace routes UT (#7954) * Fix dynamicConfigServiceMock import path in workspace routes UT Signed-off-by: Lin Wang <[email protected]> * Changeset file for PR #7954 created/updated --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --------- Signed-off-by: Lin Wang <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit d3ce40f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* [Workspace]Validate features parameter in workspace create and update API (#7884) * Add validate for features field in workspace create and update API * Changeset file for PR #7884 created/updated * Changeset file for PR #7884 created/updated * Move router outside align with other plugins * Add ut and fix integration tests * Import use case id from default nav groups * Fix workspace routes UT * Share feature config generator between publicn and server * Fix osd server crashed due to import from public --------- * [Workspace]Fix dynamicConfigServiceMock import path in workspace routes UT (#7954) * Fix dynamicConfigServiceMock import path in workspace routes UT * Changeset file for PR #7954 created/updated --------- --------- (cherry picked from commit d3ce40f) Signed-off-by: Lin Wang <[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>
Description
This PR is for adding validate features field logic in workspace create and update API to align with the workspace create and update form. In current implementation, each workspace should have one use case.
Issues Resolved
#7907
Screenshot
No UI changes
Testing the changes
Prepare
yarn osd bootstrap --single-version ignore
config/opensearch_dashboards.yml
yarn start --no-base-path
Test with UI
Test features parameter validation
Can reference with unit test files:
src/plugins/workspace/server/routes/index.test.ts
Changelog
Check List
yarn test:jest
yarn test:jest_integration