-
Notifications
You must be signed in to change notification settings - Fork 846
mu-wpcom: add coming-soon code from ETK #27815
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
Conversation
|
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack Mu wpcom plugin:
|
|
@anomiex I imagine for migrated PHP tests we'd want to use Edit: also merged D94672-code which seemed to work ok. |
|
Using WorDBless would be good if it's possible, it makes it easier for people to run tests locally. OTOH, in CI all plugins are set up inside a copy of WordPress, so if that's what it needs it can use it. |
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/fallback-coming-soon-page.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/test/class-coming-soon-test.php
Outdated
Show resolved
Hide resolved
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/test/class-coming-soon-test.php
Outdated
Show resolved
Hide resolved
|
Just wanted to get a gut-check in regards to deploy:
Does that sound about right to you? |
That sounds like a good plan. I believe that the loading order will be consistent (because plugin load order is alphabetical AFAIK), but what that order will actually be I don't know. And might differ between Simple and Atomic. |
I don't see the cookie being used in JS, so set the $httponly true.
anomiex
left a comment
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.
I'm kind of confused on why the
$blog_idis needed here to begin with if this ETK code is always running via a plugin.
Running via a plugin doesn't matter. The blog ID is needed when it's running on a multi-site, and probably on Simple too.
For the second one, that test is failing because wordbless doesn't support
add_blog_optionas used byadd_option_to_new_site().
More specifically, the relevant file (ABSPATH . '/wp-includes/ms-blogs.php') isn't loaded by default because it's not a multisite site. I don't know whether WorDBless supports being a multisite or not, but it does seem to work if you manually require that file. Or you could just mock the relevant function to call add_option().
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
…ing-soon.php Co-authored-by: Brad Jorsch <[email protected]>
Thanks, I didn't notice what this was doing by hooking into wpmu_new_blog but understand now.
As far as mocking goes, how does bd13825 look? |
Hmm thought it was something to do with the empty changelog, but that didn't seem to help: c50d89e Any idea on what the snag is, or how I can get more helpful error output (e.g., line number)? |
projects/plugins/jetpack-mu-wpcom/src/features/coming-soon/coming-soon.php
Outdated
Show resolved
Hide resolved
| "description": "Enhances your site with features powered by WordPress.com", | ||
| "type": "wordpress-plugin", | ||
| "license": "GPL-2.0-or-later", | ||
| "require": {}, |
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.
Hmm thought it was something to do with the empty changelog, but that didn't seem to help: c50d89e Any idea on what the snag is, or how I can get more helpful error output (e.g., line number)?
I don't know about getting more helpful output, but I suspect it's because of this removal and the code at
jetpack/projects/github-actions/repo-gardening/src/utils/get-affected-changelogger-projects.js
Line 18 in c20c485
| json.require[ 'automattic/jetpack-changelogger' ] || |
For this PR, try adding this back. In a separate PR, we should change that code to use ?. for the accesses so it doesn't error out for something like this.
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.
In a separate PR, we should change that code to use ?. for the access
Nice catch! I'll be sure to follow up on that one 👍
anomiex
left a comment
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.
I haven't tested it, but the code looks good to me.
Copy/paste of the code, will refactor in following commits.
* Add jetpack-mu-wpcom-plugin skeleton * Require the jetpack-mu-wpcom package * Add test bootstrap * Add some initialization handling * Migrate code from /pull/27815 Copy/paste of the code, will refactor in following commits. * changelog * Require wordbless * Update paths and namespaces * Add wordbless to correct composer file * Init main class in test bootstrap * changelogs and validity * Remove plugins/jetpack-mu-wpcom-plugin dir We are using plugins/mu-wpcom-plugin instead. * Backport v1.0.0 version release and init next * Add init for Jetpack_Mu_Wpcom and coming-soon
* Add jetpack-mu-wpcom-plugin skeleton * Require the jetpack-mu-wpcom package * Add test bootstrap * Add some initialization handling * Migrate code from Automattic/jetpack/pull/27815 Copy/paste of the code, will refactor in following commits. * changelog * Require wordbless * Update paths and namespaces * Add wordbless to correct composer file * Init main class in test bootstrap * changelogs and validity * Remove plugins/jetpack-mu-wpcom-plugin dir We are using plugins/mu-wpcom-plugin instead. * Backport v1.0.0 version release and init next * Add init for Jetpack_Mu_Wpcom and coming-soon Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/4107122958
* Add jetpack-mu-wpcom-plugin skeleton * Require the jetpack-mu-wpcom package * Add test bootstrap * Add some initialization handling * Migrate code from Automattic/jetpack/pull/27815 Copy/paste of the code, will refactor in following commits. * changelog * Require wordbless * Update paths and namespaces * Add wordbless to correct composer file * Init main class in test bootstrap * changelogs and validity * Remove plugins/jetpack-mu-wpcom-plugin dir We are using plugins/mu-wpcom-plugin instead. * Backport v1.0.0 version release and init next * Add init for Jetpack_Mu_Wpcom and coming-soon Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/4107122958
* Add jetpack-mu-wpcom-plugin skeleton * Require the jetpack-mu-wpcom package * Add test bootstrap * Add some initialization handling * Migrate code from Automattic/jetpack/pull/27815 Copy/paste of the code, will refactor in following commits. * changelog * Require wordbless * Update paths and namespaces * Add wordbless to correct composer file * Init main class in test bootstrap * changelogs and validity * Remove plugins/jetpack-mu-wpcom-plugin dir We are using plugins/mu-wpcom-plugin instead. * Backport v1.0.0 version release and init next * Add init for Jetpack_Mu_Wpcom and coming-soon Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/4107122958
Changes proposed in this Pull Request:
Migration of coming-soon feature from the ETK plugin.
Other information:
Jetpack product discussion
PT: p9dueE-6jY-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
jetpack-mu-wpcomon sites just yet.bin/jetpack-downloader test jetpack-mu-wpcom add/coming-soon-to-wpcom-mu