Add my.woo.ai to known Calypso origins#47181
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Pull request overview
This PR adds support for the new Woo AI platform (my.woo.ai) by adding it and its local development equivalent to the list of trusted Calypso origins. This enables the Woo AI platform to properly integrate with Jetpack-connected WordPress sites.
Changes:
- Add
https://my.woo.aiandhttp://my.woo.localhost:3000to the allowed Calypso origins inwpcom_get_calypso_origin() - Add changelog entry documenting the new origins
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/packages/jetpack-mu-wpcom/src/utils.php | Adds two new origins to the allowed Calypso origins allowlist |
| projects/packages/jetpack-mu-wpcom/changelog/DOTMSD-1094-calypso-origins | Documents the change in the changelog |
| 'http://my.woo.localhost:3000', | ||
| 'https://my.woo.ai', |
There was a problem hiding this comment.
Consider adding unit tests for the wpcom_get_calypso_origin function to verify that the new origins are properly recognized and that invalid origins are correctly rejected. This would help prevent regressions if the allowlist is modified in the future.
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Calypso Origins: add my.woo.ai and my.woo.localhost to known origins. |
There was a problem hiding this comment.
The changelog entry should use imperative mood with the first word capitalized. Change "add" to "Add" to match the project's changelog conventions.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
Tryna get copilot to make the change it suggested ... don't know how long i'm supposed to wait
There was a problem hiding this comment.
🤣🤣🤣🤣 it literally capitalised the first word. I figured it would fix the "mood" too
fushar
left a comment
There was a problem hiding this comment.
Nice, I forgot about this. So many sets of origins!
Haven't actually tested the changes, but visually, the changes are looking good.
Code Coverage SummaryCoverage changed in 1 file.
|
MGS is our friend 😄 |
|
@p-jackson I've opened a new pull request, #47182, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
I tested this by
|
| 'http://my.woo.localhost:3000', | ||
| 'https://my.woo.ai', |
There was a problem hiding this comment.
The wpcom_get_calypso_origin() function validates origins for security purposes but lacks test coverage. Consider adding unit tests to verify that:
- Only allowed origins are accepted
- Disallowed origins fall back to the default 'https://wordpress.com'
- The strict comparison in
in_array()works correctly
This would help prevent regressions when adding or modifying allowed origins.
Fixes https://linear.app/a8c/issue/DOTMSD-1094
Proposed changes:
https://my.woo.aiandhttp://my.woo.localhost:3000to the known Calypso origins allowlist inwpcom_get_calypso_origin().This is used in the block editor when linking back to the dashboard.
Other information:
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
?calypso_origin=https://my.woo.aito a Jetpack-connected sitehttps://wordpress.com)Changelog