You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: environments/README.md
+72Lines changed: 72 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,78 @@ npm run translate:test
170
170
171
171
**Translation Events 2024 design:** the events routes render the legacy templates unless the new block theme is enabled. To preview it, add `"config": { "TRANSLATION_EVENTS_NEW_DESIGN": true }` to `translate/.wp-env.override.json` and restart.
172
172
173
+
### Support Forums
174
+
175
+
A local instance of the WordPress.org Support Forums with bbPress, the `wporg-support-2024` theme, and the `wporg-bbp-*` supporting plugins. It runs as a multisite network, because the forums read the plugin and theme directories out of sibling sub-sites.
176
+
177
+
**Start:**
178
+
179
+
```bash
180
+
npm run support:env start
181
+
```
182
+
183
+
**Access:**`http://localhost:8888`
184
+
185
+
**Re-seed** (clears the seed flag, then re-runs the seed):
186
+
187
+
```bash
188
+
npm run support:refresh
189
+
```
190
+
191
+
**WP CLI:**
192
+
193
+
```bash
194
+
npm run support:env -- run cli -- wp <command>
195
+
```
196
+
197
+
Add `--url=localhost:8888/rosetta` (or `/plugins`, `/themes`) to target a sub-site.
198
+
199
+
**The network:**
200
+
201
+
| Blog | Path | Purpose |
202
+
|---|---|---|
203
+
| 1 |`/`| The global support forums — the site under development |
204
+
| 2 |`/plugins`| Plugin Directory, a dependency of the `/plugin/<slug>/` forum views |
205
+
| 3 |`/themes`| Theme Directory, a dependency of the `/theme/<slug>/` forum views |
206
+
| 4 |`/rosetta`| A locale ("Rosetta") forum, for the locale-only code paths |
207
+
208
+
The blog IDs are pinned in `.wp-env.json` (`WPORG_PLUGIN_DIRECTORY_BLOGID` and friends), so the seed creates the sub-sites in that order and fails loudly if they come out differently.
209
+
210
+
**Note that the plugin and theme directories here exist only as forum dependencies. Use the Plugin Directory and Theme Directory environments to work on the directories themselves.**
211
+
212
+
On production each locale forum is its own network with `IS_ROSETTA_NETWORK` defined, which a single `wp-config.php` cannot express. `mocks/mu-plugins/wporg-support-env.php` defines it for the blog named by `WPORG_LOCAL_ROSETTA_BLOGID` instead.
213
+
214
+
**Forum IDs:** the `Plugins`, `Themes` and `Reviews` forums are created as the post IDs that `Plugin::PLUGINS_FORUM_ID` and `Support_Compat::HIDDEN_FORUMS` hard-code for production (21261, 21262, 21272, plus two legacy IDs). The directory compat views, the review forum, and the hidden-forum filtering all key off those, so they cannot be left to auto-increment.
215
+
216
+
**What to try:**`hello-dolly` is seeded on the plugin directory with a committer, a contributor and a support rep; `twentytwentyfour` is seeded on the theme directory with an author. Visit `/plugin/hello-dolly/`, `/theme/twentytwentyfour/`, and either followed by `reviews/`. Ratings submitted through the review form persist in the local `ratings` table, so the star filters and rating edits work.
217
+
218
+
**Local boundaries.** The environment deliberately does not reach production:
219
+
220
+
- Badge assignments would otherwise be a live POST to `profiles.wordpress.org`. `Badge_Automation` registers its hooks locally, because `assign_badge()` lives in the mounted `mu-plugins/pub/profile-helpers.php`, and `Profiles\queue()` dispatches synchronously for anything that is not `production` while `api()` only redirects the URL for `staging`. `mocks/mu-plugins/wporg-profiles-local.php` answers those requests and records the associations in local tables.
221
+
- Outbound mail is short-circuited; the forums mail on subscriptions, moderation and reports.
222
+
-`WPORG_Ratings` is a local stand-in. `Ratings_Compat` guards on `class_exists()` alone, so the stub implements every method it calls rather than a subset.
223
+
- SSO, two-factor account management and the rest of the Profiles service are not reproduced.
224
+
225
+
**User accounts:**
226
+
227
+
All accounts use the password `password`.
228
+
229
+
| Username | Role on `/`| Role on `/rosetta`| Notes |
|`keymaster`|`bbp_keymaster`|`bbp_participant`| Top-level forum admin; can manage all forum content |
233
+
|`moderator`|`bbp_moderator`|`bbp_participant`| Can moderate topics and replies |
234
+
|`rosettakeymaster`|`bbp_participant`|`bbp_keymaster`| Keymaster of the locale forum |
235
+
|`rosettamoderator`|`bbp_participant`|`bbp_moderator`| Moderator of the locale forum |
236
+
|`pluginauthor`|`bbp_participant`|`bbp_participant`| Committer on the seeded Hello Dolly plugin |
237
+
|`plugincontributor`|`bbp_participant`|`bbp_participant`| Contributor on the seeded Hello Dolly plugin |
238
+
|`pluginsupport`|`bbp_participant`|`bbp_participant`| Support rep on the seeded Hello Dolly plugin |
239
+
|`themeauthor`|`bbp_participant`|`bbp_participant`| Author of the seeded Twenty Twenty-Four theme |
240
+
|`themesupport`|`bbp_participant`|`bbp_participant`| Theme support rep; no production equivalent yet |
241
+
|`visitor`|`bbp_participant`|`bbp_participant`| Regular forum visitor |
242
+
243
+
**Block editor:** the forums use the block editor through [Blocks Everywhere](https://github.com/Automattic/blocks-everywhere), which is not installed here — it needs a Gutenberg old enough to break against WordPress trunk until [Automattic/blocks-everywhere#211](https://github.com/Automattic/blocks-everywhere/pull/211) lands. `Plugin::__construct()` loads the block support only when that plugin is present, so the environment runs on bbPress' plain editor until then.
244
+
173
245
### WordPress.org SSO
174
246
175
247
A test-only environment for the shared single sign-on code in `common/includes/wporg-sso/`. The SSO is a library rather than a plugin, so it is mounted at `wp-content/wporg-sso` instead of being activated, and its PHPUnit suite runs from there.
0 commit comments