Manage Custom Upstream Dependencies
Learn how to manage dependencies for your Custom Upstream.
This section provides information on how to manage dependencies for an existing Custom Upstream.
Add Dependencies to Your Upstream
Clone the Git repository for your Custom Upstream.
Require the Custom Upstream management package if you have not already:
composer require pantheon-systems/upstream-management
Run the
composer upstream:require
command for each dependency:composer upstream-require drupal/pkg-name [--no-update]
Commit and push your changes to your
composer.json
file. Remember to not commit thecomposer.lock
file.
Update Dependencies in Your Upstream
You may need to pin specific versions of your dependencies in your Custom Upstream. This is normally done with the composer.lock
file. However, including the composer.lock
file in the root of the Custom Upstream causes merge conflicts with your downstream sites. You can use the upstream:update-dependencies
composer command to solve this problem.
Run
composer update-upstream-dependencies
in your custom upstream repository. Theupstream:update-dependencies
command will:Create or update a
upstream-configuration/composer.lock
file.Create or update a
upstream-configuration/locked/composer.json
file with all packages fromcomposer.lock
and their pinned versions.Update the top-level
composer.json
repositories section forupstream-configuration
to useupstream-configuration/locked
instead of justupstream-configuration
(if not done previously).
Commit the changes and begin using the pinned versions in your downstream sites. This allows you to make sure that you use specific versions for the packages in your Custom Upstream.