Pin @wordpress/env in CI instead of resolving latest on every run

Aperta
#43 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, node.js, php, wordpress
Ambito
ci-cd, devops

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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/env pinned exactly in devDependencies) and commit the generated package-lock.json
  • Add node_modules/ to .gitignore if not already present
  • In the phpunit job, add an npm ci step after "Set up Node"
  • Change both wp-env steps from npx @wordpress/env ... to npx wp-env ... so they use the locally installed binary
  • Add an npm entry to .github/dependabot.yml so the pin gets updated
  • Decide whether package.json / package-lock.json should be excluded from the Composer distribution archive (e.g. export-ignore in .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.

Lingua principale
PHP
Stelle
4
Fork
4
Merge medio
1g 23h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WordPress/abilities

Tutte le issue di WordPress/abilities

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.