[wp-trac] [WordPress Trac] #50992: Consider removing the ability to alter the list of environment types
WordPress Trac
noreply at wordpress.org
Thu Aug 13 20:04:43 UTC 2020
#50992: Consider removing the ability to alter the list of environment types
----------------------------+--------------------------
Reporter: johnbillion | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.5.1
Component: Bootstrap/Load | Version: 5.5
Severity: normal | Keywords: dev-feedback
Focuses: |
----------------------------+--------------------------
In #33161 the concept of environment types was added to core. This is a
welcome addition and introduces a means of toggling functionality
dependent on whether the environment type is development, staging, or
production.
The intention of this feature is to provide a consistent means of
identifying the environment ''type'', not of identifying a specific
environment. There was discussion on #33161 around which types to
introduce, including UAT, QA, etc, and ultimately it was decided to stick
with `development`, `staging`, and `production` as this covers the types
that plugins and themes might be concerned about when toggling
functionality. Actual environments should fit within one of those
''types'' (eg. a UAT site can be classified as either development or
staging, as you see fit).
After spending time investigating ways to implement this feature, it's
become apparent that the ability for the environment ''types'' to be
altered via the `WP_ENVIRONMENT_TYPES` environment variable or constant is
a mistake, as it nullifies the consistency that this feature otherwise
introduces. Due to the ability to override the environment types, there's
no guarantee that the type of any given environment will be one of
`development`, `staging`, or `production`.
I recently discussed this with the folks at WordPress.com VIP and they
agreed that introducing new types isn't the intention of this feature:
https://github.com/Automattic/vip-go-mu-plugins/pull/1703
I would like to recommend that support for the `WP_ENVIRONMENT_TYPES`
environment variable and constant is removed, and for the list of
environment types to remain static.
This would be a breaking change but hopefully not one with great impact.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50992>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list