Problem/Motivation

composer require drupal/jsonapi_extras
Using version ^3.5 for drupal/jsonapi_extras                       
./composer.json has been updated
Gathering patches for root package.
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
    - Conclusion: remove drupal/core 8.7.0-beta1
    - Conclusion: don't install drupal/core 8.7.0-beta1
    - drupal/jsonapi_extras 3.x-dev requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.5.0 requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.x-dev requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.5.0 requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - don't install drupal/jsonapi 2.x-dev|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.4.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.3.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.2.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.1.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.x-dev|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.4.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.3.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.2.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.1.0|don't install drupal/core 8.7.0-beta1
    - Installation request for drupal/core ^8.7@beta -> satisfiable by drupal/core[8.7.0-beta1].
    - Installation request for drupal/jsonapi_extras ^3.5 -> satisfiable by drupal/jsonapi_extras[3.x-dev, 3.5.0].


Installation failed, reverting ./composer.json to its original content.

Also when executing tests in the issue queue we want to ensure that Drupal CI uses drupal core's JSON:API project for D8.7 and D8.8, but not for D8.6.

Proposed resolution

Alter the module dependency declarations to see if this is possible.

CommentFileSizeAuthor
#2 3043975--alter-dependencies--2.patch590 bytese0ipso

Comments

e0ipso created an issue. See original summary.

e0ipso’s picture

Status: Active » Needs review
StatusFileSize
new590 bytes

First attempt.

jibran’s picture

@e0ipso I'd suggest committing this patch to 3043975-dev branch so that testbot can pick it up run this and show results in the sidebar then we can review/commit it.

jibran’s picture

Priority: Normal » Critical

This critical because I can't use this module with core jsonapi module.

composer require drupal/jsonapi_extras
Using version ^3.5 for drupal/jsonapi_extras                       
./composer.json has been updated
Gathering patches for root package.
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
    - Conclusion: remove drupal/core 8.7.0-beta1
    - Conclusion: don't install drupal/core 8.7.0-beta1
    - drupal/jsonapi_extras 3.x-dev requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.5.0 requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.x-dev requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - drupal/jsonapi_extras 3.5.0 requires drupal/jsonapi ^2.1 -> satisfiable by drupal/jsonapi[2.x-dev, 2.4.0, 2.3.0, 2.2.0, 2.1.0].
    - don't install drupal/jsonapi 2.x-dev|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.4.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.3.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.2.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.1.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.x-dev|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.4.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.3.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.2.0|don't install drupal/core 8.7.0-beta1
    - don't install drupal/jsonapi 2.1.0|don't install drupal/core 8.7.0-beta1
    - Installation request for drupal/core ^8.7@beta -> satisfiable by drupal/core[8.7.0-beta1].
    - Installation request for drupal/jsonapi_extras ^3.5 -> satisfiable by drupal/jsonapi_extras[3.x-dev, 3.5.0].


Installation failed, reverting ./composer.json to its original content.
e0ipso’s picture

Woah! I didn't know that @jibran. 👏🏽👏🏽👏🏽👏🏽

e0ipso’s picture

It seems that this failed. Any ideas @jibran?

jibran’s picture

  [InvalidArgumentException]                                                          
  Could not find package drupal/jsonapi_extras in a version matching dev-3043975-dev  

Seems like drupal composer point is not picking up the branch.

jibran’s picture

Let me try this branch locally.

jibran’s picture

Ah! the branch name shouldn't start from dev-* or ends with *-dev. My bad for suggesting that name. It is confusing the composer. Let's rename it. Naming convention can be found at https://www.drupal.org/node/2823818 and if you are not aware of the feature then there is more details here https://www.drupal.org/node/2823818.

jibran’s picture

Title: Allow tets runner to test JSON:API Extras with core JSON:API » Unable to install JSON:API Extras with core JSON:API using composer
Issue summary: View changes
jibran’s picture

Status: Needs review » Reviewed & tested by the community

If I use composer require drupal/jsonapi_extras:3043975-dev-dev then it works and installs without an issue.

jibran’s picture

composer require drupal/jsonapi_extras:3043975-dev-dev
    Finished: success: 1, skipped: 0, failure: 0, total: 1
./composer.json has been updated                                   
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies (including require-dev)                      
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/jsonapi_extras (dev-3043975-dev 4be688f): Cloning 4be688f0ad from cache
Writing lock file
Generating optimized autoload files

  • e0ipso committed 0603467 on 8.x-3.x
    Issue #3043975 by e0ipso, jibran: Unable to install JSON:API Extras with...
e0ipso’s picture

Status: Reviewed & tested by the community » Fixed
naveenvalecha’s picture

+++ b/jsonapi_extras.info.yml
@@ -5,5 +5,4 @@ core: 8.x
+  - jsonapi

A minor tweak need to addressed drupal:jsonapi

e0ipso’s picture

@naveenvalecha that was intentional as we want this to work with both contrib and core.

jibran’s picture

The good news is I can run composer require drupal/jsonapi_extras dev-3.x on both drupal/core ^8.6 and drupal/core ^8.7@beta. Site is working without any issues.

This is how Drupal packagist is interpreting the info file.

        {
            "name": "drupal/jsonapi_extras",
            "version": "dev-3.x",
            "source": {
                "type": "git",
                "url": "https://git.drupalcode.org/project/jsonapi_extras",
                "reference": "0603467b926fcc56e04b434685f4a61ecfa6b9c7"
            },
            "require": {
                "drupal/core": "~8.0",
                "drupal/jsonapi": "*",
                "e0ipso/shaper": "^1"
            },
            "require-dev": {
                "drupal/jsonapi": "*"
            },
            "type": "drupal-module",
            "extra": {
                "branch-alias": {
                    "dev-3.x": "3.x-dev"
                },
                "drupal": {
                    "version": "8.x-3.5+0-dev",
                    "datestamp": "1553751185",
                    "security-coverage": {
                        "status": "not-covered",
                        "message": "Dev releases are not covered by Drupal security advisories."
                    }
                }
            },
            "notification-url": "https://packages.drupal.org/8/downloads",
            "license": [
                "GPL-2.0+"
            ],
            "authors": [
                {
                    "name": "Mateu Aguiló Bosch",
                    "homepage": "https://www.drupal.org/user/550110",
                    "email": "mateu.aguilo.bosch@gmail.com"
                },
                {
                    "name": "Martin Kolar",
                    "homepage": "https://www.drupal.org/u/mkolar"
                },
                {
                    "name": "Karel Majzlik",
                    "homepage": "https://www.drupal.org/u/karlos007"
                }
            ],
            "description": "JSON:API Extras provides a means to override and provide limited configurations to the default zero-configuration implementation provided by the JSON:API module.",
            "homepage": "https://www.drupal.org/project/jsonapi_extras",
            "support": {
                "source": "http://cgit.drupalcode.org/jsonapi_extras"
            },
            "time": "2019-03-30T17:30:28+00:00"
        },
naveenvalecha’s picture

#16
Cool. I didn't know about how the drupal data is exposed to drupal packages.json

wim leers’s picture

Issue tags: +API-First Initiative

Good catch!

Status: Fixed » Closed (fixed)

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