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

Add workspaces parameter to resolve_import_errors API #133

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented Sep 6, 2023

Description

When importing saved objects from a nd.json file, if there are some objects have missing references or conflicts, import API will return both the invalid objects and valid object, and do not import anything. In current UI, we call another API resolve_import_errors to resolve the errors and then import the saved objects, but we didn't add workspaces parameter to that API currently, so we need to add it so that users can see the imported saved objects in current workspace, if not users cannot see them.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: gaobinlong <gbinlong@amazon.com>
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.

Approved, but can you check @wanglam 's comment before merge the PR?

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2023

Codecov Report

Merging #133 (6731425) into workspace (c6037d5) will decrease coverage by 0.01%.
Report is 2 commits behind head on workspace.
The diff coverage is 50.00%.

@@              Coverage Diff              @@
##           workspace     #133      +/-   ##
=============================================
- Coverage      65.76%   65.76%   -0.01%     
=============================================
  Files           3336     3336              
  Lines          64496    64498       +2     
  Branches       10267    10268       +1     
=============================================
+ Hits           42413    42414       +1     
- Misses         19503    19504       +1     
  Partials        2580     2580              
Flag Coverage Δ
Linux_3 42.63% <0.00%> (-0.01%) ⬇️
Windows_1 34.77% <0.00%> (ø)
Windows_2 54.73% <0.00%> (-0.01%) ⬇️
Windows_3 42.64% <0.00%> (-0.01%) ⬇️
Windows_4 34.74% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...rver/saved_objects/import/resolve_import_errors.ts 96.42% <ø> (ø)
...rver/saved_objects/routes/resolve_import_errors.ts 23.07% <0.00%> (-1.93%) ⬇️
...cts_management/public/lib/resolve_import_errors.ts 85.18% <50.00%> (ø)
...gement_section/objects_table/components/flyout.tsx 71.19% <100.00%> (+0.15%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@yuye-aws yuye-aws left a comment

Choose a reason for hiding this comment

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

I have also added some comments, please take a look, thanks!

Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
@gaobinlong gaobinlong merged commit 1250357 into ruanyl:workspace Sep 11, 2023
37 of 39 checks passed
opensearch-workspace-development bot pushed a commit that referenced this pull request Sep 11, 2023
* Add workspaces parameter to resolve_import_errors API

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Simplify some code

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
(cherry picked from commit 1250357)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
yuye-aws pushed a commit that referenced this pull request Sep 12, 2023
* Add workspaces parameter to resolve_import_errors API



* Fix bug



* Simplify some code



---------


(cherry picked from commit 1250357)

Signed-off-by: gaobinlong <gbinlong@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>
ruanyl pushed a commit that referenced this pull request Sep 15, 2023
* Add workspaces parameter to resolve_import_errors API

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Simplify some code

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
SuZhou-Joe pushed a commit that referenced this pull request Sep 16, 2023
* Add workspaces parameter to resolve_import_errors API

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Simplify some code

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@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.

6 participants