-
Notifications
You must be signed in to change notification settings - Fork 19
Testing branches and PRs
Sometimes we need to test a pull request that requires an installation with composer to gather new or changed composer dependencies.
To install the project from scratch, we'll assume we're following the suggested steps at https://github.com/localgovdrupal/localgov/blob/2.x/README.md#installing-localgov-drupal-locally-with-composer
We'll assume we're using Lando, so it is recommended to us composer inside lando for consistency of composer and php versions and modules.
lando composer require "localgovdrupal/localgov_directories:dev-feature/2.x/149-new-directory-page as 2.x-dev" -W
If not using Lando, just drop the lando
command to use composer directly on the host.
If we have a pull request on a specific branch on a specific repository, we might want to test that a full fresh build and install works as expected.
To do this we can require that branch as a composer alias.
For example, if we want to test the localgov_directories project on the feature/2.x/149-new-directory-page branch, we can run the following require command from the composer root.
lando composer require "localgovdrupal/localgov_directories:dev-feature/2.x/149-new-directory-page as 2.x-dev" -W
This will require the head of the feature/2.x/149-new-directory-page branch of https://github.com/localgovdrupal/localgov_directories.
The pattern is:
lando composer require "[PROJECT-NAME]:dev-[BRANCH-NAME] as [TAG-ALIAS]" -W
Notes:
- the branch name needs to be prefixed with
dev-
- for dev versions of the tag alias, composer likes us to ad
-dev
. So for the 2.x branch, we writeas 2.x-dev
So if we wanted the latest HEAD of the dev branch of localgov_paragraphs, but wanted the rest of composer to think we had the 2.1.1 release, we could do:
composer require "localgovdrupal/localgov_paragraphs:2.x-dev as 2.1.1" -W