-
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][Feature] Import sample data to workspace #210
[Workspace][Feature] Import sample data to workspace #210
Conversation
Signed-off-by: Lin Wang <wonglam@amazon.com>
* refactor: simplify sample data saved object id prefix logic Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * fix: align the prefix order of sample data install and uninstall rename appendPrefix to addPrefix Signed-off-by: Yulong Ruan <ruanyl@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Codecov Report
@@ Coverage Diff @@
## workspace-pr-integr #210 +/- ##
=======================================================
+ Coverage 66.46% 66.49% +0.02%
=======================================================
Files 3408 3412 +4
Lines 65222 65253 +31
Branches 10457 10460 +3
=======================================================
+ Hits 43353 43390 +37
+ Misses 19265 19263 -2
+ Partials 2604 2600 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 26 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
savedObjectList: SavedObject[], | ||
workspaceId?: string | ||
) => { | ||
savedObjectList = cloneDeep(savedObjectList); |
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.
I am a little bit confused here, should we assign the copied object to a new variable?
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.
There are too many attributes update work in overrideSavedObjectId
. It's all based references, it will take huge effects if we want to use new variables.
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.
I guess @SuZhou-Joe want to say: shall we do const savedObjectListCopy = cloneDeep(savedObjectList);
?
if (workspaceId) { | ||
savedObjectsList = getWorkspaceIntegratedSavedObjects(savedObjectsList, workspaceId); | ||
} | ||
if (dataSourceId) { | ||
savedObjectsList = getDataSourceIntegratedSavedObjects(savedObjectsList, dataSourceId); | ||
} |
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.
Should we take the order of these two if
s into account?
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.
Yes, it will cause different id after condition switched.
savedObjectList: SavedObject[], | ||
workspaceId?: string | ||
) => { | ||
savedObjectList = cloneDeep(savedObjectList); |
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.
I guess @SuZhou-Joe want to say: shall we do const savedObjectListCopy = cloneDeep(savedObjectList);
?
Signed-off-by: Lin Wang <wonglam@amazon.com>
Shall we add some integration_test for the functionality? |
* feat: import sample data saved objects to workspace Signed-off-by: Lin Wang <wonglam@amazon.com> * refactor: simplify sample data saved object id prefix logic (#1) * refactor: simplify sample data saved object id prefix logic Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * fix: align the prefix order of sample data install and uninstall rename appendPrefix to addPrefix Signed-off-by: Yulong Ruan <ruanyl@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * refactor: assigned copied saved objects to new variables Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
* feat: import sample data saved objects to workspace Signed-off-by: Lin Wang <wonglam@amazon.com> * refactor: simplify sample data saved object id prefix logic (#1) * refactor: simplify sample data saved object id prefix logic Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * fix: align the prefix order of sample data install and uninstall rename appendPrefix to addPrefix Signed-off-by: Yulong Ruan <ruanyl@amazon.com> --------- Signed-off-by: Yulong Ruan <ruanyl@amazon.com> * refactor: assigned copied saved objects to new variables Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: Yulong Ruan <ruanyl@amazon.com> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Description
Import sample data to specific workspace
Issues Resolved
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr