Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review
FileSize
283 bytes

Trivial patch attached.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Not sure what I can add as a comment here. The patch looks good :)

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
632 bytes

People who manage their environment via composer should not be surprised after they "successfully" run composer update!

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Ah yes, that should help indeed. Good idea @mkalkbrenner!

drunken monkey’s picture

People who manage their environment via composer should not be surprised after they "successfully" run composer update!

Can you explain in detail which scenario you’re trying to prevent?
Drupal’s packagist repository will already use data from .info.yml files to enrich the Composer information of its packages. So, it will already be impossible to install the latest Search API dev version (or 1.14, once that’s out) together with Drupal 8.5. (You can try with Drupal 8.4 and Search API 1.9+.)

If adding this explicit conflict directive would indeed help for some cases, I’d find it a lot better if Drupal’s Packagist engine already added that automatically. Doesn’t seem sensible to do this manually for all packages with a minimum Core version.

drunken monkey’s picture

mkalkbrenner’s picture

Can you explain in detail which scenario you’re trying to prevent?
Drupal’s packagist repository will already use data from .info.yml files to enrich the Composer information of its packages. So, it will already be impossible to install the latest Search API dev version (or 1.14, once that’s out) together with Drupal 8.5. (You can try with Drupal 8.4 and Search API 1.9+.)

You're right that you can't install it. But you since the requirements and conflicts are not auto-generated . This is the generated composer.json of Search API 1.13:

{
  "name": "drupal/search_api",
  "description": "Provides a generic framework for modules offering search capabilities.",
  "type": "drupal-module",
  "homepage": "https://www.drupal.org/project/search_api",
  "authors": [
    {
      "name": "Thomas Seidl",
      "homepage": "https://www.drupal.org/u/drunken-monkey"
    },
    {
      "name": "Nick Veenhof",
      "homepage": "https://www.drupal.org/u/nick_vh"
    },
    {
      "name": "See other contributors",
      "homepage":"https://www.drupal.org/node/790418/committers"
    }
  ],
  "support": {
    "issues": "https://www.drupal.org/project/issues/search_api",
    "irc": "irc://irc.freenode.org/drupal-search-api",
    "source": "http://git.drupal.org/project/search_api.git"
  },
  "license": "GPL-2.0+",
  "require-dev": {
    "drupal/search_api_autocomplete": "@dev"
  },
  "suggest": {
    "drupal/facets": "Adds the ability to create faceted searches.",
    "drupal/search_api_autocomplete": "Allows adding autocomplete suggestions to search fields.",
    "drupal/search_api_solr": "Adds support for using Apache Solr as a backend."
  },
  "extra": {
    "drush": {
      "services": {
        "drush.services.yml": "^9"
      }
    }
  }
}

it misses the conflict for drupal cores before 8.5 as declared in the generated search_api.info.yml:

type: module
name: 'Search API'
description: 'Provides a generic framework for modules offering search capabilities.'
package: Search
# core: 8.x
configure: search_api.overview
dependencies:
  - drupal:system (>=8.5)

# Information added by Drupal.org packaging script on 2019-05-07
version: '8.x-1.13'
core: '8.x'
project: 'search_api'
datestamp: 1557244700

So if you install any outdated core, composer installs drupal/search_api:^1.13 perfectly. But you'll run into issues when you try to install search_api afterwards or run drush updb.

drunken monkey’s picture

So if you install any outdated core, composer installs drupal/search_api:^1.13 perfectly. But you'll run into issues when you try to install search_api afterwards or run drush updb.

As said, I cannot reproduce this:

$ composer init
$ composer config repositories.0 composer https://packages.drupal.org/8
$ composer require drupal/core:8.4.x
$ composer require drupal/search_api:1.13
Your requirements could not be resolved to an installable set of packages.
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

I cannot reproduce this either.

  • drunken monkey committed 4f40fb1 on 8.x-1.x
    Issue #3053200 by drunken monkey, mkalkbrenner, borisson_: Increased...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great to hear, thanks a lot for verifying, Joris!
Committed.
Markus: Also note that we didn’t use this until now, either, and never had a complaint like that (as far as I remember).
Anyways, thanks again, everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.