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

Remove the patterns_ai_data post from DB when resetting the CYS #43499

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

albarin
Copy link
Contributor

@albarin albarin commented Jan 11, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

This PR adds a call to the /wc/private/ai/patterns endpoint to remove the patterns_ai_data post from the DB which resets the patterns to the default patterns.

How to test the changes in this Pull Request:

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

  1. On a WooExpress site, install this version of the WooCommerce Beta Tester plugin
    woocommerce-beta-tester.zip or in this branch run pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester build:zip and install the resulting zip.
  2. Head over to WooCommerce -> Home and click on "Start Customizing".
  3. Click the Design with AI button.
  4. Fill out a business description and proceed.
  5. Make sure the store is generated and all the patterns and products are AI generated.
  6. Go to Tools > WCA Test Helper > Tools and click on the Run button on the Reset Customize Your Store row.
  7. Create a new page or post and insert a WooCommerce pattern (for example the Hero Product Chessboard).
  8. Make sure the images and the copy is the default one and not the AI-generated one you got after the customization process on steps 1-5.

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

Remove the patterns_ai_data post from DB when resetting the CYS.

Comment

@github-actions github-actions bot added the plugin: woocommerce beta tester Issues related to the WooCommerce Beta Tester plugin. label Jan 11, 2024
Copy link
Contributor

github-actions bot commented Jan 11, 2024

Test Results Summary

Commit SHA: 40ff54d

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests254002502793m 53s

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.

@albarin albarin marked this pull request as ready for review January 11, 2024 13:25
@woocommercebot woocommercebot requested review from a team and gigitux and removed request for a team January 11, 2024 13:26
Copy link
Contributor

github-actions bot commented Jan 11, 2024

Hi @chihsuan, @gigitux, @nefeline,

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
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.

Thanks, looks good and tested well. 🚢

yield apiFetch( {
path: '/wc/private/ai/patterns',
method: 'DELETE',
} );
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could consider using Promise.all for these fetch calls.

@albarin albarin merged commit be1c794 into trunk Jan 12, 2024
27 checks passed
@albarin albarin deleted the remove-ai-post-from-db branch January 12, 2024 12:58
samueljseay pushed a commit that referenced this pull request Jan 16, 2024
…3499)

* Call the `/wc/private/ai/patterns` to remove the `patterns_ai_data` post from the db

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester

---------

Co-authored-by: github-actions <github-actions@github.com>
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

2 participants