-
Notifications
You must be signed in to change notification settings - Fork 849
Connection: Replace Error_Handler use in External_Storage #46646
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
base: trunk
Are you sure you want to change the base?
Connection: Replace Error_Handler use in External_Storage #46646
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
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.
Pull request overview
This PR deprecates the Error_Handler integration in External_Storage as phase 1 of enabling proper error handling. The changes introduce a static cache to prevent duplicate logging within the same request and add deprecation notices for methods that will be replaced by a provider-based error reporting mechanism.
Changes:
- Add static cache to External_Storage to prevent duplicate event logging within the same request
- Deprecate Error_Handler integration methods (should_report_for_environment, should_report_empty_state) and disable remote error reporting
- Mark external_storage_empty and external_storage_error codes as deprecated in Error_Handler
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/packages/connection/src/class-external-storage.php | Adds static cache for logged events, deprecates Error_Handler integration methods, and disables remote error reporting |
| projects/packages/connection/src/class-error-handler.php | Marks external storage error codes as deprecated |
| projects/packages/connection/tests/php/External_Storage_Test.php | Updates tests to reset static cache in tearDown and adds test for static cache behavior |
| projects/packages/connection/changelog/remove-remove-deprecate-error-handling-external-storage | Adds changelog entry for the deprecation |
projects/packages/connection/changelog/remove-remove-deprecate-error-handling-external-storage
Outdated
Show resolved
Hide resolved
projects/packages/connection/changelog/remove-remove-deprecate-error-handling-external-storage
Outdated
Show resolved
Hide resolved
…-error-handling-external-storage Co-authored-by: Copilot <[email protected]>
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
projects/packages/connection/changelog/remove-remove-deprecate-error-handling-external-storage
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Refactors External_Storage to remove the unused Error_Handler integration and introduces a host-agnostic provider-based error reporting system. Storage providers can now optionally implement error handling methods to report errors to their own monitoring systems.
Related CONNECT-81
Proposed changes:
External_Storage (class-external-storage.php)
Storage Provider Interface (interface-storage-provider.php)
Error_Handler (class-error-handler.php)
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: