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

basic enhancements for import logging #196056

Merged
merged 11 commits into from
Nov 1, 2024

Conversation

kyracho
Copy link
Contributor

@kyracho kyracho commented Oct 14, 2024

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:

  • 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

For maintainers

@kyracho kyracho requested a review from a team as a code owner October 14, 2024 08:15
@kyracho kyracho marked this pull request as draft October 14, 2024 08:27
@kyracho
Copy link
Contributor Author

kyracho commented Oct 15, 2024

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.

@TinaHeiligers TinaHeiligers added Feature:Saved Objects release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.17.0 labels Oct 16, 2024
@TinaHeiligers
Copy link
Contributor

@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor

@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.

@kyracho
Copy link
Contributor Author

kyracho commented Oct 18, 2024

@TinaHeiligers No problem at all, take your time! I’ll look forward to your feedback whenever you have the time. Appreciate it!

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a 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

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

Core provides mocks

@kyracho
Copy link
Contributor Author

kyracho commented Oct 28, 2024

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?

@kyracho kyracho marked this pull request as ready for review October 28, 2024 01:02
@TinaHeiligers
Copy link
Contributor

buildkite test this

@kyracho
Copy link
Contributor Author

kyracho commented Oct 29, 2024

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!

@afharo
Copy link
Member

afharo commented Oct 30, 2024

/ci

@afharo
Copy link
Member

afharo commented Oct 30, 2024

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!

@kyracho, it was autofixed by CI in ad45ea3 (#196056). We just had to re-run CI (I already triggered it in my previous comment). Thanks for your patience.

@afharo
Copy link
Member

afharo commented Oct 30, 2024

/ci

@TinaHeiligers
Copy link
Contributor

buildkite test this

@kyracho
Copy link
Contributor Author

kyracho commented Oct 30, 2024

@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!

@TinaHeiligers TinaHeiligers self-requested a review October 31, 2024 23:00
Copy link
Contributor

@TinaHeiligers TinaHeiligers left a 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.

@TinaHeiligers
Copy link
Contributor

@elasticmachine merge upstream

@TinaHeiligers
Copy link
Contributor

buildkite test this

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) October 31, 2024 23:01
@TinaHeiligers
Copy link
Contributor

@kyracho this PR will merge automatically if CI is green.

@TinaHeiligers TinaHeiligers merged commit 45543a1 into elastic:main Nov 1, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11622237294

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 1, 2024
## 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 1, 2024
# 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]>
nreese pushed a commit to nreese/kibana that referenced this pull request Nov 1, 2024
## 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]>
@kyracho kyracho deleted the enhance_import_logging branch November 3, 2024 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) 💝community Feature:Saved Objects release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants