-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[Blueprints]: Skip steps that set the Site Visibility to Live #59579
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
[Blueprints]: Skip steps that set the Site Visibility to Live #59579
Conversation
…mmerce, woocommerce/client/admin
📝 WalkthroughWalkthroughA changelog entry was added documenting that blueprint steps setting Site Visibility to Live are now skipped during import. The Changes
Sequence Diagram(s)sequenceDiagram
participant AdminUser
participant BlueprintUploadDropzone
participant ImportEndpoint
AdminUser->>BlueprintUploadDropzone: Upload Blueprint
BlueprintUploadDropzone->>BlueprintUploadDropzone: Parse Blueprint Steps
loop For each step
BlueprintUploadDropzone->>BlueprintUploadDropzone: Check if options.woocommerce_coming_soon == 'no'
alt If 'no'
BlueprintUploadDropzone-->>BlueprintUploadDropzone: Skip step
else
BlueprintUploadDropzone->>ImportEndpoint: Send step for import
end
end
ImportEndpoint-->>BlueprintUploadDropzone: Import result
BlueprintUploadDropzone-->>AdminUser: Notify completion
📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Size Change: +18 B (0%) Total Size: 5.85 MB |
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 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. |
Testing GuidelinesHi @hayley-king @PanosSynetos , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents import steps from automatically setting the site visibility to Live when importing a Blueprint and updates the TypeScript type for blueprint steps.
- Added an optional
options
field to theBlueprintStep
type. - Skipped any blueprint import steps that set
woocommerce_coming_soon
tono
. - Added a changelog entry for this tweak.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
plugins/woocommerce/client/admin/client/blueprint/components/types.ts | Added options?: Record<string, string> to BlueprintStep . |
plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx | Introduced logic to skip steps that set site visibility to Live. |
plugins/woocommerce/changelog/59579-blueprints-skip-live-site-visibility-option | Changelog entry for skipping Live visibility steps. |
Comments suppressed due to low confidence (1)
plugins/woocommerce/client/admin/client/blueprint/components/BlueprintUploadDropzone.tsx:92
- Add unit or integration tests to cover the new skip logic for steps setting site visibility to Live to ensure it behaves as expected.
if ( step?.options?.woocommerce_coming_soon === 'no' ) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jimjasson - I tested this on Jurassic Ninja and my local site and it worked, I don't see an issue and the import works as expected with no hiccups or strange errors (related to the site going live prematurely).
I also tried with the blueprints that @hayley-king provided on the issue
// Skip steps that set the Site Visibility to Live. | ||
// Admins should have a chance to review their store before it is set to Live. | ||
if ( step?.options?.woocommerce_coming_soon === 'no' ) { | ||
continue; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jimjasson - Initially I thought that this would throw an error, if woocommerce_coming_soon
does not exist. But I chatted with Gemini and shared this
So, if you have
step?.options?.woocommerce_coming_soon === 'no'
, andwoocommerce_coming_soon
simply doesn't exist onstep.options
, the expression will evaluate toundefined === 'no'
, which is false. It will not throw an error at runtime.
So we're good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PanosSynetos I was able to import my hkco-blueprint.json test blueprint into a new Pressable site successfully. If you need additional details or access to the site, let me know.
Submission Review Guidelines:
Changes proposed in this Pull Request:
Taking inspiration from this issue: #59369, we revisited how we deal with import steps that set the Site Visibility to Live.
Blueprint imports are only allowed on Coming Soon sites. However, if the Blueprint was exported from a Live site and then imported to a Coming Soon site, then the latter would automatically be transformed to Live after the import without giving the admin the chance to double-check their configuration. Moreover, since paid plugins/themes are cannot be imported via Blueprints yet, this would potentially lead to a half-finished site, that is not 1-1 the same as the original site and therefore is not ready to be published.
This PR skips all import steps that set the site to Live. It also fixes the type definition of
BlueprintStep
, which was incomplete.Closes #59369
Closes https://linear.app/a8c/issue/WOOPLUG-4871
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
woo-blueprint-live.json
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Skip steps that change the Site Visibility to Live when importing a Blueprint.
Changelog Entry Comment
Comment