Pin @wordpress/env in CI instead of resolving latest on every run
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start by reading .github/workflows/ci.yml and .github/dependabot.yml, then check .gitignore, .gitattributes, and contributor docs for existing package and wp-env guidance. Add an exact @wordpress/env dev dependency and lockfile, install with npm ci in the phpunit job, and use the local wp-env binary. Done when the CI steps, Dependabot configuration, archive decision, and any affected docs are updated.
Written by the indexing model from the issue text.
Description
Problem
The phpunit job in .github/workflows/ci.yml runs npx @wordpress/env start ... and npx @wordpress/env run .... The repo has no package.json or lockfile, so npx installs whatever version of @wordpress/env (and its whole dependency tree) is latest at the time of each run.
That means:
- CI is not reproducible: a new wp-env release can break the PHPUnit jobs on an unrelated PR.
- Unreviewed code from the npm registry runs in CI on every run.
- Contributors may be running a different wp-env version locally than CI uses.
Proposal
Add a package.json and package-lock.json with @wordpress/env as an exact-version dev dependency, and install it with npm ci.
- Add
package.json("private": true,@wordpress/envpinned exactly indevDependencies) and commit the generatedpackage-lock.json - Add
node_modules/to.gitignoreif not already present - In the
phpunitjob, add annpm cistep after "Set up Node" - Change both wp-env steps from
npx @wordpress/env ...tonpx wp-env ...so they use the locally installed binary - Add an
npmentry to.github/dependabot.ymlso the pin gets updated - Decide whether
package.json/package-lock.jsonshould be excluded from the Composer distribution archive (e.g.export-ignorein.gitattributes) - Update contributor docs if they reference
npx @wordpress/env
Alternative considered
Pin the version inline (npx @wordpress/[email protected] ...). Smaller change, but it only pins the top-level package, leaves transitive dependencies floating, and Dependabot can't update a version inside a run: string.
Context
Follow-up to #42. Deliberately left out of that PR to keep it focused.
- Dominant language
- PHP
- Stars
- 4
- Forks
- 4
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 18
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WordPress/abilities
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
WordPress/abilities#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Registration gating in `register_all()` applies unevenlyPossibly taken @nikmclaughlin claimed this 1 day ago. Open
WordPress/abilities#54 · 1 assignee ·
Maintainers usually reply within 1 day
-
Better enforce core fidelity for canonical backportsPossibly taken @nikmclaughlin claimed this 3 days ago. Open
WordPress/abilities#47 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
Maintainers usually reply within 1 day
All issues in WordPress/abilities
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/blocks-engine#7881 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
magicsunday/webtrees-docker#285 ·
Maintainers usually reply within 1 day
-
area/tests type/bug when/soon
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookPossibly taken @mayankmajeji claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
WordPress/hosting-handbook#521 ·