-
Notifications
You must be signed in to change notification settings - Fork 842
Core Compat: Site Environment #16338
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
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.
Here are some suggested test cases for this PR.
Gutenberg extensions
- Use Core's block editor
- Use latest stable Gutenberg plugin
Blocks
- Tiled Gallery
- Business Hours
- Calendly
- Form
- Contact Info
- Eventbrite
- Google calendar
- Mailchimp
- Map
- OpenTable
- Podcast player
- Star rating
- Recurring Payments
- Repeat Visitor
- Revue
- Simple Payments
- Slideshow
Extensions
- Publicize
- Likes
Connection
- In-place connection with free plan
- In-place connection with paid plan
- In-place connection with product purchase
- Classic connection. Use Safari, or set a constant
JETPACK_SHOULD_USE_CONNECTION_IFRAMEto false - Disconnect/reconnect connection
- Secondary user connection
- Connection on multisite
If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.
|
Thank you for the great PR description! When this PR is ready for review, please apply the E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16338 Scheduled Jetpack release: August 4, 2020. |
jeherve
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 think that's a good change. I only have one minor remark.
|
I believe the Infinity ping here is for the |
jeherve
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.
Should we update this little utility in the React dashboard as well?
jetpack/_inc/client/state/connection/reducer.js
Lines 223 to 231 in fe5b739
| /** | |
| * Checks if the site is currently in development mode. | |
| * | |
| * @param {Object} state Global state tree | |
| * @return {boolean} True if site is in dev mode. False otherwise. | |
| */ | |
| export function isDevMode( state ) { | |
| return 'dev' === getSiteConnectionStatus( state ); | |
| } |
We also have a few "Unavailable in Dev Mode" strings in the React dashboard that may be worth updating, as well as the "Dev Mode" badge:
| const devNotice = this.props.siteConnectionStatus === 'dev' ? <code>Dev Mode</code> : '', |
05d2298 to
8aa6574
Compare
|
Caution: This PR has changes that must be merged to WordPress.com |
jeherve
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.
Let's add WP_LOCAL_DEV here to avoid an empty message?
jetpack/_inc/client/components/jetpack-notices/index.jsx
Lines 100 to 126 in 8cfd220
| if ( devMode.filter ) { | |
| reasons.push( | |
| __( '{{li}}The jetpack_development_mode filter is active{{/li}}', { | |
| components: { | |
| li: <li />, | |
| }, | |
| } ) | |
| ); | |
| } | |
| if ( devMode.constant ) { | |
| reasons.push( | |
| __( '{{li}}The JETPACK_DEV_DEBUG constant is defined{{/li}}', { | |
| components: { | |
| li: <li />, | |
| }, | |
| } ) | |
| ); | |
| } | |
| if ( devMode.url ) { | |
| reasons.push( | |
| __( '{{li}}Your site URL lacks a dot (e.g. http://localhost){{/li}}', { | |
| components: { | |
| li: <li />, | |
| }, | |
| } ) | |
| ); | |
| } |
When I use the WP_LOCAL_DEV constant, I get both the staging notice and the local one:
Maybe we should set a site as staging only when it has the staging WP environment type?
ab06973 to
676bdce
Compare
676bdce to
c8b38df
Compare
…and list of staging sites. (#16590)
Note that this can not land until after the package update has been released and deployed on WP.com. |
34df120 to
6bb0d46
Compare
|
Sorry folks, I have commited into this branch by mistake. removed the commit and force-pushed the branch |
dereksmart
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.
Found a few things, but could be fixed in separate PRs since this one is already so big.
Found a reference to the old term "Development mode" here

When using WP_LOCAL_DEV constant, I see a notice saying I'm using a staging server (not true). This notice does not appear with the JETPACK_DEV_DEBUG constant.

Everything else seems to work as expected
- Fresh build
- jetpack_development_mode filter
- localhost url
dereksmart
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.
Approving despite the comments above, in case you'd prefer to fix those in separate PR.
Fixed that in #16608
Yes, we may have to discuss this again, since we're not exactly sure how folks are going to be using the different environment types yet (see discussion above). |
Since being added recently in r48856-core we may as well listen for the environment declaring itself `local` explicitly. https://core.trac.wordpress.org/ticket/51064 Relevant prior art: #16338
|
r225659-wpcom |


Fixes #11798
Changes proposed in this Pull Request:
wp_get_environment_typeas the default value for the Status packageis_staging_sitevalue (by way of !== production is a staging site in how we handle them).WP_LOCAL_DEVthat Core site health does check. This activates our "Development Mode".Jetpack product discussion
n/a
Does this pull request change what data or activity we track or use?
n/a
Todo required
If this lands, we need to update documentation. I'm okay doing this in a folllow-up PR or adding a new commit here if this is otherwise approved.
If we're happy with this, I'll coordinate with Quill.
Testing instructions:
define( 'WP_ENVIRONMENT_TYPE', 'staging' );Does this activate staging mode?Proposed changelog entry for your changes: