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

Jetpack: Deprecate Errors class #37451

Merged
merged 11 commits into from
May 22, 2024
Merged

Conversation

bindlegirl
Copy link
Contributor

@bindlegirl bindlegirl commented May 20, 2024

Fixes https://github.com/Automattic/vulcan/issues/333

Proposed changes:

  • Deprecated catch_errors() method in Errors class which effectively deprecates the class itself.
  • Deprecated catch_errors_on_shutdown() since 'php_errors' state wasn't used anywhere.
  • Removed the code calling the method (modules activation).

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Load Jetpack and see if enabling or disabling modules still works.
  • Try breaking a module (eg. Carousel) and toggling it on using the settings page. You should see the error notification pop up but Jetpack should still work. The error will be logged to debug.log depending on wp-config.settings.

Copy link
Contributor

github-actions bot commented May 20, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the remove/deprecate-errors-class branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack remove/deprecate-errors-class
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin remove/deprecate-errors-class
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Package] Status [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress labels May 20, 2024
Copy link
Contributor

github-actions bot commented May 20, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for June 4, 2024 (scheduled code freeze on June 3, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Migration plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Inspect plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Automattic For agencies client plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Classic Theme helper plugin plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. label May 20, 2024
@bindlegirl bindlegirl removed the [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. label May 21, 2024
@bindlegirl bindlegirl force-pushed the remove/deprecate-errors-class branch from c672257 to 948bcf7 Compare May 21, 2024 07:48
@bindlegirl bindlegirl self-assigned this May 21, 2024
@github-actions github-actions bot added [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Classic Theme Helper Plugin [Plugin] Inspect [Plugin] Migration [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. labels May 21, 2024
@bindlegirl bindlegirl marked this pull request as ready for review May 21, 2024 07:57
@bindlegirl bindlegirl requested a review from a team May 21, 2024 07:57
@bindlegirl bindlegirl added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] In Progress labels May 21, 2024
Copy link
Contributor

@darssen darssen left a comment

Choose a reason for hiding this comment

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

Thanks for the changes @bindlegirl!

I reviewed the code and it did look good except for a comment I left that I would like to discuss.

I did test and things seem to work fine.

projects/plugins/jetpack/class.jetpack.php Show resolved Hide resolved
@bindlegirl bindlegirl requested a review from darssen May 21, 2024 12:48
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

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

LGTM. Suggesting a few additional @deprecated inline.

projects/packages/status/src/class-errors.php Show resolved Hide resolved
projects/plugins/jetpack/class.jetpack.php Show resolved Hide resolved
@bindlegirl bindlegirl enabled auto-merge (squash) May 21, 2024 14:11
@@ -2,6 +2,7 @@
/**
* An errors utility class for Jetpack.
*
* @deprecated since $$next-version$$
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant the comment below on lines 16–18 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah 😊 Changed in 859b7bf

@bindlegirl bindlegirl disabled auto-merge May 21, 2024 15:19
anomiex
anomiex previously approved these changes May 21, 2024
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

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

LGTM. Haven't tested beyond searching to confirm there aren't any missed calls to catch_errors or catch_errors_on_shutdown.

@bindlegirl bindlegirl enabled auto-merge (squash) May 21, 2024 15:29
darssen
darssen previously approved these changes May 22, 2024
Copy link
Contributor

@darssen darssen left a comment

Choose a reason for hiding this comment

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

Looks and tests good. Thanks for the changes

@bindlegirl bindlegirl dismissed stale reviews from darssen and anomiex via 875bccc May 22, 2024 06:46
@bindlegirl bindlegirl merged commit 7d31c77 into trunk May 22, 2024
72 checks passed
@bindlegirl bindlegirl deleted the remove/deprecate-errors-class branch May 22, 2024 07:04
@github-actions github-actions bot removed the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Status [Plugin] Automattic For Agencies Client [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Classic Theme Helper Plugin [Plugin] Inspect [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants