Skip to content

chore(n): add setup-repos to clone + build managed plugins#183

Draft
adekbadek wants to merge 1 commit into
mainfrom
worktree-clone-managed-repos
Draft

chore(n): add setup-repos to clone + build managed plugins#183
adekbadek wants to merge 1 commit into
mainfrom
worktree-clone-managed-repos

Conversation

@adekbadek
Copy link
Copy Markdown
Member

All Submissions:

Changes proposed in this Pull Request:

Adds a thin bootstrapper so a fresh checkout can pull in the two plugins that can't live in this monorepo because they're in separate private repos: newspack-manager and newspack-manager-admin. Previously these had to be cloned by hand, with no convention.

n setup-repos clones both into repos/plugins/ via the GitHub CLI (so its auth covers the private repos), skipping any that are already present, then builds each through the existing standalone-repo path (the same one n build <name> uses) and symlinks them into the running site via link-repos.sh. They show up in the plugins list ready to activate, no restart needed. Pass --env <name> to build and link into an isolated environment instead of the main site.

This builds on the existing repos/{plugins,themes} convention, the ./repos:/newspack-repos mount, and link-repos.sh symlinking (#177/#178). It also adds the ./repos mount to the isolated-env compose template, which was the one place that mount was missing, so the repos/ convention now works in isolated envs too.

How to test the changes in this Pull Request:

  1. Ensure the GitHub CLI is authenticated for the private Automattic repos (gh auth status).
  2. From the workspace root, run n start and n install (or use an existing running site).
  3. Run n setup-repos. Confirm it clones newspack-manager and newspack-manager-admin into repos/plugins/, builds each, and symlinks both into wp-content/plugins/.
  4. In wp-admin (or via wp plugin list), confirm both plugins appear and activate with no fatals (with newspack-plugin active). Confirm the homepage still loads.
  5. Run n setup-repos again and confirm it reports both as already present and skips the clone (idempotent).
  6. Isolated env: n env create managed-test --up, then n setup-repos --env managed-test. Confirm the env container mounts /newspack-repos, both plugins symlink into the env's wp-content/plugins/, and activate with no fatals. Tear down with n env destroy managed-test.
  7. Run n setup-repos without gh installed/authenticated and confirm it fails fast with a clear error before attempting any build.

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?
  • Have you successfully run tests with your changes locally?

Copy link
Copy Markdown
Contributor

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

Adds an n setup-repos bootstrap command to standardize cloning and wiring up the two private “managed” plugins (newspack-manager, newspack-manager-admin) into the workspace repos/plugins/ convention, including isolated env support.

Changes:

  • Add n setup-repos [--env <name>] to clone managed plugins on the host (via gh), then build + symlink them inside the target container.
  • Introduce bin/setup-repos.sh and a managed_plugins list in bin/repos.sh to drive the bootstrap flow.
  • Mount ./repos into isolated env containers (/newspack-repos) and document the workflow in AGENTS.md.

Reviewed changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
n Adds setup-repos command wiring (clone on host, build/link in container) and updates help output.
bin/setup-repos.sh New host-side script to clone the private managed plugin repos into repos/plugins/.
bin/repos.sh Adds a managed_plugins array used by n setup-repos/setup-repos.sh.
bin/env.sh Adds the ./repos:/newspack-repos mount to isolated environment compose generation.
AGENTS.md Documents n setup-repos in first-time setup and the repos/ convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@adekbadek adekbadek force-pushed the worktree-clone-managed-repos branch from 4179132 to 5bc0cfe Compare June 1, 2026 21:51
@adekbadek adekbadek changed the title feat(n): add setup-repos to clone + build managed plugins chore(n): add setup-repos to clone + build managed plugins Jun 1, 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.

2 participants