-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
basic enhancements for import logging #196056
Conversation
Hi @TinaHeiligers , I've made some progress on the follow-up PR, but it's still a draft and could use a bit of guidance. Would appreciate your input when you have time! Thanks. |
@elasticmachine merge upstream |
@kyracho Thanks for following up on this, I'm a bit swamped right now but I'll get to it, although probably only next week. |
@TinaHeiligers No problem at all, take your time! I’ll look forward to your feedback whenever you have the time. Appreciate it! |
...bjects/core-saved-objects-import-export-server-internal/src/import/saved_objects_importer.ts
Outdated
Show resolved
Hide resolved
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.
We need to combine logs with the same log level to reduce logging noise.
Logging needs to be within importSavedObjectsFromStream
...bjects/core-saved-objects-import-export-server-internal/src/import/saved_objects_importer.ts
Outdated
Show resolved
Hide resolved
...bjects/core-saved-objects-import-export-server-internal/src/import/saved_objects_importer.ts
Outdated
Show resolved
Hide resolved
...bjects/core-saved-objects-import-export-server-internal/src/import/saved_objects_importer.ts
Outdated
Show resolved
Hide resolved
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.
Core provides mocks
...cts/core-saved-objects-import-export-server-internal/src/import/import_saved_objects.test.ts
Outdated
Show resolved
Hide resolved
Thanks again for the detailed explanations, @TinaHeiligers . I really appreciate your patience. I addressed your suggestions. Just to confirm, we're not aiming to specifically test the logging behavior, right? |
buildkite test this |
Could someone with Buildkite access please share the details of the linting errors? Or, would it be possible for ElasticMachine to post the error details? Thank you! |
/ci |
@kyracho, it was autofixed by CI in |
/ci |
buildkite test this |
@TinaHeiligers @afharo TYSM! ❤️ If things are ok for this PR, I'd like to choose another Kibana issue to work on. That is, unless you have any suggestions for the next issue! |
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.
LGTM on CI green. Logging enhancements are ongoing.
@elasticmachine merge upstream |
buildkite test this |
@kyracho this PR will merge automatically if CI is green. |
Starting backport for target branches: 8.x |
💚 Build Succeeded
Metrics [docs]
History
|
## Summary Hello, this is a follow up PR to elastic#192234 . The previous PR added simplistic logging to the saved objects importer. The goal now is to enhance the logs with information on the saved objects being imported, how they are imported, and by displaying any errors. #### `import_saved_objects.ts`: - Logs specific types being imported - Logs size limit and overwrite status - Logs Success/Fail messages #### Changes to `saved_objects_importer.ts`: - Passes the logger to `importSavedObjectsFromStream` - Removes "starting import" #### Changes to `import_saved_objects.test.ts`: - Updates it for the new logger parameter #### Changes to `import.test.ts`: - Uses the mock logger provided by core, instead of using a custom one ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alejandro Fernández Haro <[email protected]> (cherry picked from commit 45543a1)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [basic enhancements for import logging (#196056)](#196056) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kyra Cho","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-01T00:50:21Z","message":"basic enhancements for import logging (#196056)\n\n## Summary\r\nHello, this is a follow up PR to #192234 . The previous PR added\r\nsimplistic logging to the saved objects importer. The goal now is to\r\nenhance the logs with information on the saved objects being imported,\r\nhow they are imported, and by displaying any errors.\r\n\r\n#### `import_saved_objects.ts`:\r\n- Logs specific types being imported\r\n- Logs size limit and overwrite status\r\n- Logs Success/Fail messages\r\n\r\n#### Changes to `saved_objects_importer.ts`:\r\n- Passes the logger to `importSavedObjectsFromStream` \r\n- Removes \"starting import\"\r\n\r\n#### Changes to `import_saved_objects.test.ts`:\r\n- Updates it for the new logger parameter\r\n\r\n#### Changes to `import.test.ts`:\r\n- Uses the mock logger provided by core, instead of using a custom one\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alejandro Fernández Haro <[email protected]>","sha":"45543a12a6ce7c32d0a14b45a24eccceca23d9d0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Saved Objects","release_note:skip","💝community","v9.0.0","backport:prev-minor","v8.17.0"],"title":"basic enhancements for import logging","number":196056,"url":"https://github.com/elastic/kibana/pull/196056","mergeCommit":{"message":"basic enhancements for import logging (#196056)\n\n## Summary\r\nHello, this is a follow up PR to #192234 . The previous PR added\r\nsimplistic logging to the saved objects importer. The goal now is to\r\nenhance the logs with information on the saved objects being imported,\r\nhow they are imported, and by displaying any errors.\r\n\r\n#### `import_saved_objects.ts`:\r\n- Logs specific types being imported\r\n- Logs size limit and overwrite status\r\n- Logs Success/Fail messages\r\n\r\n#### Changes to `saved_objects_importer.ts`:\r\n- Passes the logger to `importSavedObjectsFromStream` \r\n- Removes \"starting import\"\r\n\r\n#### Changes to `import_saved_objects.test.ts`:\r\n- Updates it for the new logger parameter\r\n\r\n#### Changes to `import.test.ts`:\r\n- Uses the mock logger provided by core, instead of using a custom one\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alejandro Fernández Haro <[email protected]>","sha":"45543a12a6ce7c32d0a14b45a24eccceca23d9d0"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196056","number":196056,"mergeCommit":{"message":"basic enhancements for import logging (#196056)\n\n## Summary\r\nHello, this is a follow up PR to #192234 . The previous PR added\r\nsimplistic logging to the saved objects importer. The goal now is to\r\nenhance the logs with information on the saved objects being imported,\r\nhow they are imported, and by displaying any errors.\r\n\r\n#### `import_saved_objects.ts`:\r\n- Logs specific types being imported\r\n- Logs size limit and overwrite status\r\n- Logs Success/Fail messages\r\n\r\n#### Changes to `saved_objects_importer.ts`:\r\n- Passes the logger to `importSavedObjectsFromStream` \r\n- Removes \"starting import\"\r\n\r\n#### Changes to `import_saved_objects.test.ts`:\r\n- Updates it for the new logger parameter\r\n\r\n#### Changes to `import.test.ts`:\r\n- Uses the mock logger provided by core, instead of using a custom one\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n- [ ] This will appear in the **Release Notes** and follow the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Alejandro Fernández Haro <[email protected]>","sha":"45543a12a6ce7c32d0a14b45a24eccceca23d9d0"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kyra Cho <[email protected]> Co-authored-by: Alejandro Fernández Haro <[email protected]>
## Summary Hello, this is a follow up PR to elastic#192234 . The previous PR added simplistic logging to the saved objects importer. The goal now is to enhance the logs with information on the saved objects being imported, how they are imported, and by displaying any errors. #### `import_saved_objects.ts`: - Logs specific types being imported - Logs size limit and overwrite status - Logs Success/Fail messages #### Changes to `saved_objects_importer.ts`: - Passes the logger to `importSavedObjectsFromStream` - Removes "starting import" #### Changes to `import_saved_objects.test.ts`: - Updates it for the new logger parameter #### Changes to `import.test.ts`: - Uses the mock logger provided by core, instead of using a custom one ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Alejandro Fernández Haro <[email protected]>
Summary
Hello, this is a follow up PR to #192234 . The previous PR added simplistic logging to the saved objects importer. The goal now is to enhance the logs with information on the saved objects being imported, how they are imported, and by displaying any errors.
import_saved_objects.ts
:Changes to
saved_objects_importer.ts
:importSavedObjectsFromStream
Changes to
import_saved_objects.test.ts
:Changes to
import.test.ts
:Checklist
For maintainers