The Drupal-Install Borg-Cube: "We seek peaceful coexistence ..."

Events happening in the community are now at Drupal community events on www.drupal.org.
Anonymous's picture

... of Composer & Drush, anyway.

Composer may be the NewDrupalWay(tm), but Drush is still indispensible for much workflow. Working with both is a necessity.

So what's a Drone to do?

Here's a scenario from a (intended to be) Composer-only install. The how-to was cobbled together from the 1000-or-so blog posts, etc that keep telling us to "Get off the island" ... If anyone cares to share a/the "Definitive Current Composer HowTo for Drupal8", please pipe in!

(1) Install Drupal

  composer create-project --keep-vcs drupal/drupal d8 8.0.3
  cd d8

(2) Install a bunch of modules

  composer require \
  drupal/admin_toolbar:8.1.14 \
  drupal/backup_db:dev-8.x-1.x \
     drupal/big_pipe:8.1.0-beta3 \
  drupal/coffee:8.1.0-beta1 \
    drupal/deploy:8.1.0-alpha5 \
   drupal/imagemagick:8.1.0-alpha1 \
  drupal/pathauto:8.1.0-alpha1 \
     drupal/purge:8.3.0-beta1 \
     drupal/search_api:8.1.0-alpha12 \
  drupal/search_api_solr:8.1.0-alpha2 \
  drupal/security_review:dev-8.x-1.x \
   drupal/smtp:dev-8.x-1.x \
  drupal/toolbar_anti_flicker:8.1.1 \
    drupal/ultimate_cron:dev-8.x-2.x \
     drupal/zurb_foundation:dev-8.x-6.x

(3) update

  composer update

So should be all current, right?

(4) Just for fun, check to see if there are updates.

Err ... how exactly?

Afaict, there's no built in composer tool, so let's try

(a) drush ups

  Checking available update data ...                                                    [ok]
Checking available update data for Drupal.                                            [ok]
Checking available update data for Admin Toolbar (admin_toolbar).                     [ok]
Checking available update data for BigPipe (big_pipe).                                [ok]
Checking available update data for Coffee (coffee).                                   [ok]
Checking available update data for Chaos tools (ctools).                              [ok]
Checking available update data for Deploy (deploy).                                   [ok]
Checking available update data for ImageMagick (imagemagick).                         [ok]
Checking available update data for Multiversion (multiversion).                       [ok]
Checking available update data for Pathauto (pathauto).                               [ok]
Checking available update data for Purge (purge).                                     [ok]
Checking available update data for RELAXed Web Services (relaxed).                    [ok]
Checking available update data for Search API (search_api).                           [ok]
Checking available update data for Solr search (search_api_solr).                     [ok]
Checking available update data for Token (token).                                     [ok]
Checking available update data for Toolbar Anti-flicker (toolbar_anti_flicker).       [ok]
  Name                                Installed Version  Proposed version  Message
   Backup Database (backup_db)         Unknown            Unknown           Project was not packaged by drupal.org but obtained from git. You need to enable git_deploy module
   Security Review (security_review)   Unknown            Unknown           Project was not packaged by drupal.org but obtained from git. You need to enable git_deploy module
   SMTP Authentication Support (smtp)  Unknown            Unknown           Project was not packaged by drupal.org but obtained from git. You need to enable git_deploy module
   ZURB Foundation (zurb_foundation)   Unknown            Unknown           Project was not packaged by drupal.org but obtained from git. You need to enable git_deploy module

Strange that there are needed updates IMMEDIATELY after an install

Don't really want to deploy a non-composer module to update a composer-only install

(b) root around in the Composer drawer until finding this

  https://packagist.org/packages/spekulatius/composer-package-update-checker

Looks promising. Install

  composer global require "spekulatius/composer-package-update-checker:dev-master"

Check for updates

  cd <drupal root>
$COMPOSER_HOME/vendor/spekulatius/composer-package-update-checker/composer-package-update-checker

and we get

  BE CAREFUL!
    You need to do this with the same PHP version as on your production system,
    otherwise the composer update might resolve to a different set of packages.

   Your PHP version is:
  PHP 7.0.4-dev (cli) (built: Feb  6 2016 21:28:35) ( NTS )
  Copyright (c) 1997-2016 The PHP Group
  Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
      with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

   Would you like to continue? (y/N):
y
  drupal/backup_db is on a dev branch. This can cause issues during later deployments.
   drupal/security_review is on a dev branch. This can cause issues during later deployments.
drupal/smtp is on a dev branch. This can cause issues during later deployments.
    drupal/ultimate_cron is on a dev branch. This can cause issues during later deployments.
   drupal/zurb_foundation is on a dev branch. This can cause issues during later deployments.
Loading composer repositories with package information
Updating dependencies (including require-dev)
  Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - Installation request for drupal/drupal No version set (parsed as 1.0.0) -> satisfiable by drupal/drupal[No version set (parsed as 1.0.0)].
        - drupal/pathauto 8.1.0-alpha1 requires drupal/path 8.* -> satisfiable by drupal/core[8.0.0, 8.0.0-beta12, 8.0.0-beta13, 8.0.0-beta14, 8.0.0-beta15, 8.0.0-beta16, 8.0.0-rc1, 8.0.0-rc2, 8.0.0-rc3, 8.0.0-rc4, 8.0.1, 8.0.2, 8.0.3, 8.0.x-dev].
     - don't install drupal/core 8.0.0|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.0-beta12|remove drupal/drupal No version set (parsed as 1.0.0)
        - don't install drupal/core 8.0.0-beta13|remove drupal/drupal No version set (parsed as 1.0.0)
        - don't install drupal/core 8.0.0-beta14|remove drupal/drupal No version set (parsed as 1.0.0)
        - don't install drupal/core 8.0.0-beta15|remove drupal/drupal No version set (parsed as 1.0.0)
        - don't install drupal/core 8.0.0-beta16|remove drupal/drupal No version set (parsed as 1.0.0)
        - don't install drupal/core 8.0.0-rc1|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.0-rc2|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.0-rc3|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.0-rc4|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.1|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.2|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.3|remove drupal/drupal No version set (parsed as 1.0.0)
       - don't install drupal/core 8.0.x-dev|remove drupal/drupal No version set (parsed as 1.0.0)
       - Installation request for drupal/pathauto 8.1.0-alpha1 -> satisfiable by drupal/pathauto[8.1.0-alpha1].

   composer/installers is up to date.
wikimedia/composer-merge-plugin is up to date.
drupal/admin_toolbar is up to date.
    drupal/backup_db is up to date.
    drupal/big_pipe is up to date.
drupal/coffee is up to date.
   drupal/deploy is up to date.
   drupal/imagemagick is up to date.
  drupal/pathauto is up to date.
drupal/purge is up to date.
    drupal/search_api is up to date.
   drupal/search_api_solr is up to date.
  drupal/security_review is up to date.
  drupal/smtp is up to date.
drupal/toolbar_anti_flicker is up to date.
drupal/ultimate_cron is up to date.
    drupal/zurb_foundation is up to date.

Not sure what to do with THAT.

Take a leap of faith here, and trust that I can find other glaring inconsistencies -- in my understanding, if not in the actual best-practice way-of-things.

Obviously, my update workflow needs some "corrective actions".

Anybody care to deinitively clarify what/how? Better yet, point to any docs?

Other than THIS group, I'm not even sure where to start dealing with this issue ... drush app? drupal core? composer github? individual module issue queues?

It'd be REALLY HELPFUL if there was some guidance on best-practices here. At least that'd allow mere-mortals to work/test, and find real bugs. Ideally, an 'official' "Do-This" landing page; the current state of information is just way too scattered about.

Comments?

Comments

You did install composer

derhasi's picture

You did install composer dependencies with specific version numbers. In that case "composer update" cannot work as you wish. You have to provide a version constraint that allows updating, like drupal/big_pipe:>=8.1.0-beta3 or drupal/big_pipe:8.1.*.

With composer you should not need to use drush for any source code action (download, update, remove). Composer does handle that very well. I suggest you look at https://github.com/drupal-composer/drupal-project for some more detail on a working scaffold.

I also recommend going through https://getcomposer.org/doc/01-basic-usage.md an the rest of the documentation for getting a better understanding of Composer.

Composer

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: