From a12d851027c06c6caee128110d1687b9e16764a6 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 7 Jan 2022 14:05:34 -0600 Subject: [PATCH 1/6] Add mglaman/drupal-check as a composer dependency, since it doesn't conflict with Phing dependencies anymore. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c3aa7bfe..62e6299a 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "cweagans/composer-patches": "^1.7", "drupal/coder": "^8.3.6", "drush/drush": "^9 || ^10", + "mglaman/drupal-check": "^1.2", "palantirnet/phing-drush-task": "^1.1", "pear/http_request2": "^2.3", "pear/versioncontrol_git": "@dev", From 56d3efd76fecf26f48e1da7b63015809d22d57ef Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 7 Jan 2022 14:06:48 -0600 Subject: [PATCH 2/6] Use the drupal-check bin installed by Composer. --- defaults.yml | 8 ++++---- defaults/install/build.xml | 3 ++- defaults/install/the-build/build.circleci.yml | 3 --- defaults/install/the-build/build.yml | 7 ------- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/defaults.yml b/defaults.yml index db2dc04d..00b3f969 100644 --- a/defaults.yml +++ b/defaults.yml @@ -267,11 +267,11 @@ phpmd: # Configuration for checking the site with the Drupal Checker code linter. # # @see https://github.com/mglaman/drupal-check -# These values are used in the defaults/build.xml template. +# @see defaults/build.xml drupal-check: - # Location of the drupal-check script. This script is currently installed globally - # because of repository-level composer conflicts. - bin: "~/bin/drupal-check" + # Location of the drupal-check script. This shouldn't need to be overridden, + # but it is used in the defaults/build.xml template. + bin: "vendor/bin/drupal-check" # Comma separated list of directories directories: "${drupal.root}/modules/custom/,${drupal.root}/themes/custom/" diff --git a/defaults/install/build.xml b/defaults/install/build.xml index c5267f3c..67e33f15 100644 --- a/defaults/install/build.xml +++ b/defaults/install/build.xml @@ -134,8 +134,9 @@ diff --git a/defaults/install/the-build/build.circleci.yml b/defaults/install/the-build/build.circleci.yml index 4acab1ed..e122e1af 100644 --- a/defaults/install/the-build/build.circleci.yml +++ b/defaults/install/the-build/build.circleci.yml @@ -13,6 +13,3 @@ drupal: behat: args: "--profile=circleci --suite=default --strict --format=junit --out=/tmp/artifacts --tags=~@skipci" - -drupal-check: - bin: "/home/circleci/bin/drupal-check" diff --git a/defaults/install/the-build/build.yml b/defaults/install/the-build/build.yml index 29486bb0..b8aeda31 100644 --- a/defaults/install/the-build/build.yml +++ b/defaults/install/the-build/build.yml @@ -53,13 +53,6 @@ drupal: behat: args: "--suite=default --strict" -# Configuration for checking the site with the Drupal Checker code linter. -drupal-check: - # Location of the drupal-check script. This script is currently installed globally - # on the-vagrant because of repository-level composer conflicts. - bin: "~/bin/drupal-check" - - # To build an artifact from your code, add the URL to your artifact git repository. # @see https://github.com/palantirnet/the-build/blob/release-2.0/defaults.yml # From 3299e4b0a30274cea86d60d055b72fd8b32cec89 Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 7 Jan 2022 14:07:58 -0600 Subject: [PATCH 3/6] We no longer need to install drupal-check on CircleCI, because we can add it as a composer dependency. --- .circleci/config.yml | 12 ------------ defaults/install/.circleci/config.yml | 14 -------------- 2 files changed, 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ade03a5a..cedbac37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,18 +39,6 @@ jobs: name: Configure URL in /etc/hosts command: echo 127.0.0.1 example.ddev.site | sudo tee -a /etc/hosts - # Note: phing and drupal-check have mutually exclusive requirements. - # It'd be better to add drupal-check as a dependency of the drupal project - # rather than as part of the virtual environment, but this will have to do - # for now. Also note, drupal-check is added as part of the-vagrant so it - # is available to run within our VM. - # Note 2: drupal-check is pinned to a known stable version. - - run: - name: Install drupal-check - command: | - composer global require mglaman/drupal-check - ln -s ~/.config/composer/vendor/bin ~/bin - # Composer package cache - restore_cache: keys: diff --git a/defaults/install/.circleci/config.yml b/defaults/install/.circleci/config.yml index 96d54944..0ccc84a9 100644 --- a/defaults/install/.circleci/config.yml +++ b/defaults/install/.circleci/config.yml @@ -45,20 +45,6 @@ jobs: name: Configure URL in /etc/hosts command: echo 127.0.0.1 ${CIRCLE_PROJECT_REPONAME}.local | sudo tee -a /etc/hosts - # Note: phing and drupal-check have mutually exclusive requirements. - # It'd be better to add drupal-check as a dependency of the drupal project - # rather than as part of the virtual environment, but this will have to do - # for now. Also note, drupal-check is added as part of the-vagrant so it - # is available to run within our VM. - # Note 2: drupal-check is pinned to a known stable version. - - run: - name: Install drupal-check - command: | - curl -O -L https://github.com/mglaman/drupal-check/releases/download/1.0.9/drupal-check.phar - mkdir --parents ~/bin - mv drupal-check.phar ~/bin/drupal-check - chmod +x ~/bin/drupal-check - # Composer package cache - restore_cache: keys: From c13bc2e6030e034293e10f9572666388ef70fb7a Mon Sep 17 00:00:00 2001 From: Bec White Date: Fri, 7 Jan 2022 14:33:18 -0600 Subject: [PATCH 4/6] When testing the-build on CircleCI, use composer require in order to get updated composer dependencies. --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cedbac37..57990ea4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,10 +58,7 @@ jobs: # Use this copy of the-build - run: name: Replace the default version of the-build with this one - command: rm -r vendor/palantirnet/the-build - - - checkout: - path: ~/example/vendor/palantirnet/the-build + command: composer require --dev palantirnet/the-build:dev-${CIRCLE_BRANCH} # Source cache - update when branch changes - save_cache: From a74f7672646b21e9f6aea3acb811a628d7db995c Mon Sep 17 00:00:00 2001 From: Byron Duvall Date: Tue, 1 Feb 2022 11:32:11 -0500 Subject: [PATCH 5/6] add required drupal-check dependency --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 62e6299a..8b0355a5 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "pear/http_request2": "^2.3", "pear/versioncontrol_git": "@dev", "phing/phing": "^2.14", - "phpmd/phpmd": "^2.4" + "phpmd/phpmd": "^2.4", + "phpspec/prophecy-phpunit": "^2" }, "autoload": { "psr-0": { From 52215075e3aaae2bb0cd813e037e7e5029d53e8a Mon Sep 17 00:00:00 2001 From: byrond Date: Fri, 25 Feb 2022 13:39:46 -0500 Subject: [PATCH 6/6] allow composer to up/downgrade dependencies when installing the-build --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57990ea4..f7318bcc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: # Use this copy of the-build - run: name: Replace the default version of the-build with this one - command: composer require --dev palantirnet/the-build:dev-${CIRCLE_BRANCH} + command: composer require --dev --with-all-dependencies palantirnet/the-build:dev-${CIRCLE_BRANCH} # Source cache - update when branch changes - save_cache: