Skip to content

fix(env): provision plugin vendor/ on env up to avoid activation fatal#411

Open
jason10lee wants to merge 2 commits into
mainfrom
fix/env-vendor-provisioning
Open

fix(env): provision plugin vendor/ on env up to avoid activation fatal#411
jason10lee wants to merge 2 commits into
mainfrom
fix/env-vendor-provisioning

Conversation

@jason10lee

@jason10lee jason10lee commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

A fresh isolated environment (n env up) links the monorepo plugins but never installs their Composer vendor/ — so activating a plugin that requires its autoloader (e.g. newspack-plugin, newspack-popups) fatals on a missing vendor/autoload.php. This adds a bin/ensure-vendor.sh step at env-up that runs a runtime-only (--no-dev) per-plugin Composer install — all plugin activation needs, without dev dependencies or the slow JS build — so a fresh env is never vendorless. (Dev dependencies for running a plugin's tests still come from n build / n ci-build.)

  • Idempotent. Skips any plugin whose vendor/autoload.php is already present, so warm starts stay instant.
  • Non-fatal. If a Composer install fails, it warns actionably and leaves the env usable rather than tearing down an otherwise-working environment.

Only monorepo plugins are provisioned; standalone repos/ checkouts manage their own dependencies.

How to test the changes in this Pull Request:

  1. n env up <name> on a fresh environment; confirm the [ensure-vendor] step installs Composer deps for the monorepo plugins.
  2. Activate a plugin that requires its autoloader (e.g. newspack-plugin) — it activates without a fatal about a missing vendor/autoload.php.
  3. Re-run n env up <name> — confirm ensure-vendor skips already-provisioned plugins (no redundant installs).
  4. Force a Composer failure for one plugin — confirm env-up reports the failure (including how many other plugins were provisioned) but still completes and the env stays usable.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable? — no bin/ test harness in this repo.
  • Have you successfully run tests with your changes locally? — verified in an isolated environment: ensure-vendor ran at env-up across the monorepo plugins, with error propagation + graceful degradation confirmed. No CI coverage for bin/ here, so verification is manual.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 16:58
@jason10lee jason10lee self-assigned this Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jason10lee jason10lee marked this pull request as ready for review June 24, 2026 20:37
@jason10lee jason10lee requested a review from a team as a code owner June 24, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants