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 DataSourcePoller footer error on upgrade downgrade #45892

Merged
merged 3 commits into from Mar 27, 2024

Conversation

ilyasfoo
Copy link
Contributor

@ilyasfoo ilyasfoo commented Mar 25, 2024

Changes proposed in this Pull Request:

Fixes fatal error caused by DataSourcePoller class refactor p1711334228664619/1711312760.121469-slack-C05JQBR78RW

The issue originates from an existing version of WooCommerce is run while it is being upgraded/downgraded.

In this instance, my observation is the WCPayPromotionDataSourcePoller file is the new version while being called from a previous version WC (currently 8.7.0 in a standard Woo Express site). As a result, Automattic\WooCommerce\Admin\RemoteSpecs\DataSourcePoller doesn't exists since it's introduced in 8.8.0.

My fix will simply use the old DataSourcePoller path which is handled properly in previous versions since the file's inception and 8.8.0.

How to test the changes in this Pull Request:

Upgrade test

  1. Follow the instructions in p1711313371293309/1711312760.121469-slack-C05JQBR78RW to create Woo Express site
  2. Go to /wp-admin/plugin-install.php
  3. Upload WooCommerce with the zipfile in this PR (artifact, or woocommerce.zip)
  4. Go to WooCommerce > Status > Logs and look for fatal-errors-* log
  5. Observe no fatal error CRITICAL Uncaught Error: Class "Automattic\WooCommerce\Admin\RemoteSpecs\DataSourcePoller" not found in /srv/htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/WCPayPromotion/WCPayPromotionDataSourcePoller.php:9

Downgrade test

  1. Go back to /wp-admin/plugin-install.php
  2. Upload WooCommerce 8.7.0
  3. Go to WooCommerce > Status > Logs and look for fatal-errors-* log
  4. Observe no similar fatal error

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 25, 2024
Copy link
Contributor

github-actions bot commented Mar 25, 2024

Test Results Summary

Commit SHA: 6854e2d

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests362001103738m 54s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@ilyasfoo ilyasfoo marked this pull request as ready for review March 25, 2024 15:20
@ilyasfoo ilyasfoo requested review from a team, psealock and rjchow March 25, 2024 15:21
Copy link
Contributor

github-actions bot commented Mar 25, 2024

Hi @chihsuan, @moon0326, @woocommerce/ghidorah

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@ilyasfoo ilyasfoo removed request for a team, psealock and rjchow March 25, 2024 15:56
@ilyasfoo ilyasfoo requested review from a team, chihsuan and moon0326 March 26, 2024 03:43
@ilyasfoo ilyasfoo added this to the 8.8.0 milestone Mar 26, 2024
@github-actions github-actions bot removed this from the 8.8.0 milestone Mar 26, 2024
Copy link
Member

@chihsuan chihsuan left a comment

Choose a reason for hiding this comment

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

LGTM and tested well. 🚢

@ilyasfoo ilyasfoo merged commit 7a70a93 into trunk Mar 27, 2024
37 checks passed
@ilyasfoo ilyasfoo deleted the fix/wcpaypromotion-footer-error-on-upgrade-downgrade branch March 27, 2024 03:35
@ilyasfoo ilyasfoo added this to the 8.8.0 milestone Mar 27, 2024
@github-actions github-actions bot modified the milestones: 8.8.0, 8.9.0 Mar 27, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Mar 27, 2024
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
* Add fix

* Changelog

* Change fix approach since it's crashing on 8.7.0
@alopezari alopezari added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Mar 27, 2024
@alopezari alopezari added the status: analysis complete Indicates if a PR has been analysed by Solaris label Mar 27, 2024
@Stojdza Stojdza modified the milestones: 8.9.0, 8.8.0 Mar 28, 2024
Stojdza added a commit that referenced this pull request Mar 28, 2024
Delete changelog files based on PR #45892
Stojdza added a commit that referenced this pull request Mar 28, 2024
Delete changelog files based on PR #45892
moon0326 pushed a commit that referenced this pull request Mar 29, 2024
moon0326 pushed a commit that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants