Skip to content
This repository was archived by the owner on Oct 28, 2026. It is now read-only.

Auto-install composer and npm dependencies on checkout - #26

Merged
Zippybonzo merged 1 commit into
mainfrom
claude/shim-dependency-install-nipl1d
Aug 5, 2026
Merged

Zippybonzo merged 1 commit into
mainfrom
claude/shim-dependency-install-nipl1d

Conversation

@Zippybonzo

@Zippybonzo Zippybonzo commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Add automatic dependency installation to deployment operations. When git-checkout, git-pull, repo-register, rsync-local, or rsync-remote complete, the shim now runs composer install and npm install if composer.json or package.json files are present in the affected checkout(s).

Key Changes

  • New dependency installation functions: Added install_dependencies() to run composer/npm in a single directory, and install_dependencies_for_sync() to handle rsync operations that may affect multiple paths
  • Updated git operations: git-checkout and git-pull now install dependencies after pulling code
  • Updated repo registration: repo-register installs dependencies after initial clone
  • Updated rsync operations: Both rsync-local and rsync-remote install dependencies in path-restricted checkouts (or the destination root for full-tree syncs)
  • Result reporting: All affected commands now include an installed field in their response payload listing which dependency managers ran
  • Documentation updates: Updated OPERATIONS.md and SALT-INTEGRATION.md to reflect new requirements for composer and npm on staging/appservers, and updated sudoers configuration
  • CI updates: Added Node.js setup and composer to CI dependencies for test execution

Implementation Details

  • Composer is run with --no-dev --no-interaction --optimize-autoloader flags to exclude test dependencies and handle non-interactive environments
  • Both tools run as the web user (www-data) with a 900-second timeout
  • For rsync operations without a --path restriction, only the destination root is checked (not a recursive walk), avoiding unnecessary dependency installs in unrelated subdirectories
  • The installed field is only added to response payloads when dependencies were actually installed

https://claude.ai/code/session_01WvaajqC8EkbxnuexsBHSGa

Summary by CodeRabbit

  • New Features

    • Deployments now automatically install Composer and npm dependencies when supported manifest files are detected.
    • Dependency installation is supported during checkouts, updates, repository registration, and synchronized file deployments.
    • Deployment results include details of installed dependencies.
  • Documentation

    • Updated operational and integration requirements to include Composer, Node.js, and npm.
  • Tests

    • Added coverage for dependency installation across deployment workflows and restricted synchronization paths.

git-checkout, git-pull and repo-register now run composer install / npm
install in the checkout whenever it has a composer.json / package.json,
since vendor/ and node_modules/ are gitignored and a bare checkout isn't
loadable without them. rsync-local and rsync-remote do the same in
whichever path(s) they synced (or the destination root for a full-tree
sync), so a deploy doesn't rely solely on those directories having been
carried over by the transfer.

Updates the ops docs and CI workflow for the new composer/nodejs/npm
dependency on staging and appservers.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 15a05aa6-045a-4b9d-ae1d-d0092e632ae3

📥 Commits

Reviewing files that changed from the base of the PR and between c1940b4 and bbf2f58.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • docs/OPERATIONS.md
  • docs/SALT-INTEGRATION.md
  • shim/mwdeploy_shim.py
  • shim/tests/test_mwdeploy_shim.py

📝 Walkthrough

Walkthrough

Changes

Dependency installation

Layer / File(s) Summary
Dependency helpers and Git flows
shim/mwdeploy_shim.py, shim/tests/test_mwdeploy_shim.py
The shim installs Composer and npm dependencies when manifests exist during checkout, pull, and repository registration. Tests cover manifest and manifest-free repositories.
Rsync dependency installation
shim/mwdeploy_shim.py, shim/tests/test_mwdeploy_shim.py
Local and remote rsync operations install dependencies for selected destinations. Tests cover restricted and unrestricted synchronization.
Deployment requirements and test environment
.github/workflows/ci.yml, docs/OPERATIONS.md, docs/SALT-INTEGRATION.md
CI and deployment documentation now list Composer and Node/npm requirements, sudo permissions, and automatic installation behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: claude

Sequence Diagram(s)

sequenceDiagram
  participant DeploymentOperation
  participant DependencyInstaller
  participant ComposerNpm
  participant CheckoutOrDestination
  DeploymentOperation->>CheckoutOrDestination: update or synchronize files
  DeploymentOperation->>DependencyInstaller: inspect manifests
  DependencyInstaller->>ComposerNpm: install declared dependencies
  ComposerNpm-->>DependencyInstaller: command results
  DependencyInstaller-->>DeploymentOperation: installation details
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/shim-dependency-install-nipl1d

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Zippybonzo
Zippybonzo merged commit b267baf into main Aug 5, 2026
3 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants