Skip to content

Browse Happy Environment#666

Closed
JamieBradders wants to merge 7 commits into
WordPress:trunkfrom
JamieBradders:chore/create-env-folder-for-browsehappy
Closed

Browse Happy Environment#666
JamieBradders wants to merge 7 commits into
WordPress:trunkfrom
JamieBradders:chore/create-env-folder-for-browsehappy

Conversation

@JamieBradders
Copy link
Copy Markdown

I have created a folder with wp-env environment configuration for the Browse Happy website (https://browsehappy.com). As part of this change I have also included an after start script to preset the theme and change the title/description in the environment.

I have created a folder with wp-env environment configuration for
the Browse Happy website (https://browsehappy.com). As part of this
change I have also included an after start script to preset the
theme and change the title/description in the environment.
Copilot AI review requested due to automatic review settings June 4, 2026 11:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @JamieBradders.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props paulkevan.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new wp-env configuration to spin up a local Browse Happy site, including bootstrap setup and usage docs.

Changes:

  • Add a new browsehappy:env npm script for starting the Browse Happy environment.
  • Introduce environments/browsehappy/.wp-env.json and an afterStart lifecycle script to configure the site on startup.
  • Document how to start and access the Browse Happy environment.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
environments/package.json Adds browsehappy:env script entry (and re-formats JSON).
environments/browsehappy/bin/after-start.sh Adds post-start bootstrap steps (site options + theme activation).
environments/browsehappy/.wp-env.json Defines the wp-env setup for Browse Happy (core/php/theme + lifecycle script).
environments/README.md Documents how to start/access the Browse Happy environment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +8
"lifecycleScripts": {
"afterStart": "bash browsehappy/bin/after-start.sh"
},
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is a valid suggestion becausebin/after-start.sh is not a valid path. To be sure, I tested it and got the error:

✖ afterStart Error:
bash: bin/after-start.sh: No such file or directory

I also followed the same convention as that from the jobs/ environment config.

Comment thread environments/README.md Outdated
Copilot AI review requested due to automatic review settings June 4, 2026 12:20
@pkevan
Copy link
Copy Markdown
Contributor

pkevan commented Jun 4, 2026

AI review:

  Summary

  A clean, well-scoped addition of a browsehappy wp-env environment that closely mirrors the existing jobs setup. The config paths and theme slug all resolve correctly. The issues are mostly polish/consistency
  rather than functional bugs.

  Findings

  1. Misleading copy-pasted comment in after-start.sh (medium)

  environments/browsehappy/bin/after-start.sh:3
  # Runs after wp-env start. Sets up permalinks, creates pages, job categories, and sample jobs.
  This is lifted verbatim from jobs/bin/after-start.sh, but the Browse Happy script does none of that — it only sets the title/description and activates the theme. The comment will mislead the next person. Replace
  with something like:
  # Runs after wp-env start. Sets the site title/description and activates the Browse Happy theme.
  
  2. package.json wholesale reformatted from tabs → 2-space (medium, noise)

  environments/package.json
  The only real change is adding one line ("browsehappy:env": ...), but the entire file was re-indented from tabs to 2 spaces, turning a 1-line change into a 17-line diff. The repo convention here is tabs (the
  original file, plus jobs/.wp-env.json and plugin-directory/.wp-env.json all use tabs). Recommend reverting the reformat and adding only the single new script line to keep the diff reviewable and consistent.

  3. New .wp-env.json uses spaces while siblings use tabs (low)
  
  environments/browsehappy/.wp-env.json
  The new config is 2-space indented; jobs/.wp-env.json and plugin-directory/.wp-env.json use tabs. Minor, but worth matching for consistency.

  4. Missing trailing newline (low)

  environments/browsehappy/bin/after-start.sh:16 — \ No newline at end of file. Trivial, but some linters/pre-commit hooks flag it.

  5. No explicit port → 8888 collision (low / note only)

  The config omits a port, so it defaults to 8888 — the same as the other environments. Browse Happy can't run simultaneously alongside jobs/plugins. This is a pre-existing limitation shared by all the envs here,
  so it's only worth a heads-up, not necessarily a fix.

  Things I checked that are correct (not bugs)

  - Theme path ../browsehappy.com/public_html resolves to the repo-root browsehappy.com/public_html (which exists and is a standalone theme — no parent Template: dependency). This mirrors how jobs references
  ../jobs.wordpress.net/..., with sources resolved relative to the environments/ working dir.
  - wp theme activate public_html is right: wp-env mounts the source by basename, so the theme slug is public_html (ugly, but correct — same mechanism as jobs → jobswp).
  - The --config wiring in after-start.sh matches the working jobs pattern.

  Net: no functional blockers. I'd ask for #1 (misleading comment) and #2 (revert the package.json reformat) before merge; the rest are nice-to-haves.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

"core": "WordPress/WordPress#master",
"phpVersion": "8.4",
"testsEnvironment": false,
"themes": ["../browsehappy.com/public_html"],
Comment on lines +1 to +12
{
"core": "WordPress/WordPress#master",
"phpVersion": "8.4",
"testsEnvironment": false,
"themes": ["../browsehappy.com/public_html"],
"lifecycleScripts": {
"afterStart": "bash browsehappy/bin/after-start.sh"
},
"config": {
"WP_DEBUG": true
}
}
Removed the irrelevant comments from the after-start.sh script and
reverted the tabs -> spaces change in package.json
Added extra detail to the comments for activating the browse happy
theme to avoid confusion in the future.
Copilot AI review requested due to automatic review settings June 4, 2026 12:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

@@ -0,0 +1,12 @@
{
"core": "WordPress/WordPress#master",
Copilot AI review requested due to automatic review settings June 4, 2026 13:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +1 to +12
{
"core": "WordPress/WordPress#master",
"phpVersion": "8.4",
"testsEnvironment": false,
"themes": ["../browsehappy.com/public_html"],
"lifecycleScripts": {
"afterStart": "bash browsehappy/bin/after-start.sh"
},
"config": {
"WP_DEBUG": true
}
}
Comment thread environments/README.md
Comment on lines +84 to 86
**Access:** `http://localhost:8888`

### Handbook (in-plugin)
@pkevan
Copy link
Copy Markdown
Contributor

pkevan commented Jun 4, 2026

hmm, I think I might have broken this by attempting to update the branch myself (and without permissions on your fork @JamieBradders )

@pkevan
Copy link
Copy Markdown
Contributor

pkevan commented Jun 4, 2026

Superseded by #668, which recreates this work (with props to @JamieBradders) on a branch in the main repo so it can be merged from there. Closing in favour of #668.

@pkevan pkevan closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants