Skip to content

Conversation

@dmagalhaes-godaddy
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Closes #31470.

How to test the changes in this Pull Request:

  1. Navigate to Products > Reviews
    • Product reviews and review replies are displayed on a list table
    • You can filter (by Type, Rating, and Product) the reviews
    • You can sort the reviews
    • You can search the reviews
    • You can moderate the reviews
  2. Navigate to the WordPress Comments page
    • Product reviews and review replies are not displayed
  3. Navigate to the WooCommerce > Home page and expand the reviews section
    • The Manage all reviews link redirects to the new Products > Reviews page

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
    Added on the corresponding issue.
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you created a changelog file by running pnpm nx affected --target=changelog?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@unfulvio-godaddy
Copy link
Contributor

@barryhughes good catch, what do you think of b0f5746?

@barryhughes
Copy link
Member

Perfect, thank you @unfulvio-godaddy.

barryhughes
barryhughes previously approved these changes Jun 2, 2022
Copy link
Member

@barryhughes barryhughes 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 all the work here!

@barryhughes
Copy link
Member

Sorry, all. We have one last set of tasks to do, to resolve the remaining CI fails:

Update test class WC_Admin_Tests_Install

Version numbers and callback counts need to be revised to the following (this may not be ideal but, for the time being, a quick update here is the fastest path forward):

	public function db_update_version_provider() {
		return array(
			// [DB Update version string, # of expected pending jobs]
			array( '3.9.0', 35 ),
			array( '4.0.0', 28 ),
			array( '4.4.0', 24 ),
			array( '4.5.0', 22 ),
			array( '5.0.0', 18 ),
			array( '5.6.0', 16 ),
			array( '6.0.0', 9 ),
			array( '6.3.0', 6 ),
			array( '6.4.0', 3 ),
			array( '6.5.0', 2 ),
			array( '6.6.0', 1 ),
			array( '6.7.0', 0 ),
		);
	}
Add a changelog file

This can go in the plugins/woocommerce/changelog directory. We have a tool for this (invoke via pnpm nx affected --target=changelog) or you can form the changelog file directly:

Significance: minor
Type: add

Add a new Product Reviews admin screen, and remove reviews from the existing Comments admin screen.
Rebase on trunk

Rebasing will solve a further test fail (we have another test that hinges on the WooCommerce::$version being set appropriately, and that has changed since this branch was created).

I would have handled this myself to save you the trouble, but unfortunately in this case I cannot update the PR directly.

@unfulvio-godaddy
Copy link
Contributor

unfulvio-godaddy commented Jun 3, 2022

@barryhughes no worries! sorry about this, and thanks for the instructions: please check the latest commits - does everything look alright to you? happy to get this to the finish line! :)

@barryhughes
Copy link
Member

Thanks, @unfulvio-godaddy!

I triggered a re-run of our checks so let's see what comes back—though I think we need more changes to the test in WC_Admin_Tests_Install (if you look back at the snippet in my last comment, the counts were updated for previous versions, too ... which I realize isn't ideal and perhaps not intuitive).

@unfulvio-godaddy
Copy link
Contributor

sorry -- so, 0839232 ?

@barryhughes
Copy link
Member

Thanks, that looks right to me 👍

Triggered a re-run of CI.

@barryhughes
Copy link
Member

barryhughes commented Jun 3, 2022

1) Automattic\WooCommerce\Tests\Internal\Admin\ProductReviews\ReviewsListTableTest::test_current_action with data set "neither deletes are set" (false, false, false)
Failed asserting that 'woocommerce_update_api_key' is identical to false.

I re-ran in case the issue was sporadic, but the above test (introduced via this change) is failing—seemingly only under PHP 7.2 and WP 5.8. Not immediately sure why that would be 🤔

@unfulvio-godaddy
Copy link
Contributor

@barryhughes based on that error message, I think what happened is that the current_action from the parent page which is fetching the $_REQUEST variable was being overwritten by other code internally while tests were being run. Unfortunately the tests are not always in isolation in the test suite because they're more integration tests than unit tests. I tried to edit the test to ignore that and just focus on the logic introduced by ReviewsListTable::current_action() in 74c9039 - i hope this fixes it

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

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

Yep, we don't have perfect isolation between tests. At any rate, thank you for persevering—LGTM :-)

@barryhughes barryhughes merged commit c4e068b into woocommerce:trunk Jun 5, 2022
@github-actions github-actions bot added this to the 6.7.0 milestone Jun 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2022

Hi @barryhughes, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin. release: add testing instructions PRs that have not had testing instructions added to the wiki. [auto]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Product review page in WooCommerce Core

9 participants