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

Fix "Export Everything" to properly constrain types #21402

Merged
merged 1 commit into from
Jul 30, 2018

Conversation

legrego
Copy link
Member

@legrego legrego commented Jul 30, 2018

This fixes the "Export Everything" button on the Saved Objects Management screen so that the export properly constrains the saved object types returned.

Previously, this endpoint was incorrectly returning objects that were not requested (such as the config object). This behavior is exacerbated with Spaces because the export button would incorrectly export the Space objects, which in turn do not make sense to import.

@legrego legrego mentioned this pull request Jul 30, 2018
33 tasks
@@ -49,7 +49,7 @@ export function registerScrollForExportRoute(server) {
const savedObjectsClient = req.getSavedObjectsClient();
const objects = await findAll(savedObjectsClient, {
perPage: 1000,
typesToInclude: req.payload.typesToInclude
type: req.payload.typesToInclude
Copy link
Contributor

Choose a reason for hiding this comment

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

This is directly related to #19231 right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, this is definitely related, although if I understand this correctly, this issue was present before that PR -- it looks like the original implementation before #19231 was passing includeTypes through to the find method, rather than typesToInclude

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

LGTM!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kobelb
Copy link
Contributor

kobelb commented Jul 30, 2018

@chrisronline should we be considering this as a 6.4 blocker?

@legrego
Copy link
Member Author

legrego commented Jul 30, 2018

I opened an issue to track/describe the bug itself. I'm going to merge this PR to master and 6.x while we figure out what to do for 6.4

6.x: #21417

@legrego legrego merged commit ea2e3b0 into elastic:master Jul 30, 2018
@legrego legrego deleted the fix-export-all branch July 30, 2018 15:54
legrego added a commit to legrego/kibana that referenced this pull request Jul 30, 2018
This fixes the "Export Everything" button on the Saved Objects Management screen so that the export properly constrains the saved object types returned.

Previously, this endpoint was incorrectly returning objects that were not requested (such as the `config` object). This behavior is exacerbated with [Spaces](elastic#18948) because the export button would incorrectly export the Space objects, which in turn do not make sense to import.
@chrisronline
Copy link
Contributor

@kobelb I'll let @bmcconaghy weigh in, but it doesn't feel like a blocker as the import should just skip those.

@kobelb
Copy link
Contributor

kobelb commented Jul 30, 2018

@chrisronline it's a regression from 6.3 though, right?

legrego added a commit that referenced this pull request Jul 30, 2018
…21417)

Backports the following commits to 6.x:
 - Fix "Export Everything" to properly constrain types  (#21402)
@chrisronline
Copy link
Contributor

@kobelb Yes, most likely (should be verified)

@legrego
Copy link
Member Author

legrego commented Jul 30, 2018

@chrisronline
I verified against a 6.3.0 installation -- clicking "Export Everything" excludes the config document from the download, whereas 6.4 includes it.

@kobelb
Copy link
Contributor

kobelb commented Jul 30, 2018

If it's a verified regression, and it's affecting a commonly used feature of our software, as far as I'm aware it meets all of the definitions of a blocker, so I'd recommend treating it as such.

@legrego legrego restored the fix-export-all branch July 30, 2018 18:39
legrego added a commit that referenced this pull request Jul 31, 2018
Fixes #21416 - this is identical to #21402, but adds testing to prevent a regression.

@chrisronline in the interest of speed, time, and stability for 6.4, I opted not to do a full functional test, but rather an API test to ensure that the API endpoint was interacting with the Saved Objects Client as expected.
legrego added a commit to legrego/kibana that referenced this pull request Jul 31, 2018
Fixes elastic#21416 - this is identical to elastic#21402, but adds testing to prevent a regression.

@chrisronline in the interest of speed, time, and stability for 6.4, I opted not to do a full functional test, but rather an API test to ensure that the API endpoint was interacting with the Saved Objects Client as expected.
legrego added a commit to legrego/kibana that referenced this pull request Jul 31, 2018
Fixes elastic#21416 - this is identical to elastic#21402, but adds testing to prevent a regression.

@chrisronline in the interest of speed, time, and stability for 6.4, I opted not to do a full functional test, but rather an API test to ensure that the API endpoint was interacting with the Saved Objects Client as expected.
legrego added a commit that referenced this pull request Jul 31, 2018
Fixes #21416 - this is identical to #21402, but adds testing to prevent a regression.

@chrisronline in the interest of speed, time, and stability for 6.4, I opted not to do a full functional test, but rather an API test to ensure that the API endpoint was interacting with the Saved Objects Client as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants