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

WCA Test helper - add remote inbox notification staging importer #48735

Merged
merged 30 commits into from
Jun 25, 2024

Conversation

moon0326
Copy link
Contributor

@moon0326 moon0326 commented Jun 21, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR adds a new tool to the WCA Test Helper that helps import remote inbox notifications from staging or production for testing purposes. Since this tool cover functionalities from Admin notes tool, I've retired it.

Import from staging requires Automattic proxy connected.

Screen Shot 2024-06-21 at 7 20 06 PM

Screen Shot 2024-06-21 at 7 20 29 PM

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Checkout this branch locally.
  2. cd to plugins/woocommerce-beta-tester and run pnpm run build:zip
  3. Create a new JN site with the latest WooCommerce
  4. Upload and activate woocommerce-beta-tester.zip
  5. Go to Tools -> WCA Test Helper -> Remote Inbox Notifications
  6. Click on Import from staging
  7. Confirm it throws an error.
  8. Connect to Automattic Proxy.
  9. Click on Import from staging again.
  10. Confirm it works and notifications from https://staging.woocommerce.com/wp-json/wccom/inbox-notifications/1.0/notifications.json have been imported.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

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

Adds a new tool to the WCA Test Helper that helps import remote inbox notifications from staging or production for testing purposes

Changelog Entry Comment

Comment

@github-actions github-actions bot added the plugin: woocommerce beta tester Issues related to the WooCommerce Beta Tester plugin. label Jun 21, 2024
@moon0326 moon0326 marked this pull request as ready for review June 21, 2024 22:47
Copy link
Contributor

Hi @ilyasfoo, @chihsuan,

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

1 similar comment
Copy link
Contributor

Hi @ilyasfoo, @chihsuan,

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

Copy link
Contributor

github-actions bot commented Jun 21, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

github-actions bot commented Jun 21, 2024

Size Change: +31 B (0%)

Total Size: 2.49 MB

compressed-size-action

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jun 22, 2024
@moon0326 moon0326 marked this pull request as draft June 22, 2024 02:33
@moon0326 moon0326 marked this pull request as ready for review June 23, 2024 00:44
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.

I encountered an error when trying to delete all notes.

Screen.Recording.2024-06-24.at.16.43.46.mov

Other than that, tested well and the tool is working as expected.

setNotice,
} ) {
const importFromEnv = async ( env ) => {
const urls = {
Copy link
Member

Choose a reason for hiding this comment

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

It would be helpful if we could also allow users to use a custom URL for the import. This way, we can test some functionalities unavailable in staging or production and fetch notes from a gist URL to test PR changes. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea!

Copy link
Contributor Author

@moon0326 moon0326 Jun 24, 2024

Choose a reason for hiding this comment

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

Added in 7e628ac

Screen Shot 2024-06-24 at 3 48 09 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I encountered an error when trying to delete all notes.

It seems like JN does not like DELETE methods. I've changed DELETE to POST. Please try again.

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

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

I think this is a much better solution compared to the previous one, great work
@moon0326!

I have a few comments, but everything is testing well except for the delete all similar to @chihsuan.

I'm curious if difference between button placement is different than in the PR description, is it intended? (screenshot)

moon0326 and others added 2 commits June 24, 2024 12:15
…/class-wca-test-helper-remote-inbox-notifications.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
…valuator.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
moon0326 and others added 3 commits June 24, 2024 12:15
…/class-wca-test-helper-remote-inbox-notifications.php

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
@github-actions github-actions bot removed the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jun 24, 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.

Nice work, tested well. 👍

ilyasfoo and others added 5 commits June 25, 2024 11:12
…mote-notification-importer

Fix filename typo
Fix changelog filename typo
It seems the new CI is automatically creating a changelog based on branch name 43d6abe
Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for adding the public function as utilities! Tests well, LGTM! 🚢

@moon0326 moon0326 merged commit a09522d into trunk Jun 25, 2024
13 checks passed
@moon0326 moon0326 deleted the feature/remote-notiifcation-importer branch June 25, 2024 06:32
@moon0326 moon0326 mentioned this pull request Jun 26, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce beta tester Issues related to the WooCommerce Beta Tester plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants