Problem/Motivation

We've got something wrong in the composer.json / composer.lock file in 8.1.x

Running composer install on 8.2.x

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

Running composer install on 8.0.x and 8.1.x

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess

Proposed resolution

Fix it so warning does not appear.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
Related issues: +#2697637: Update composer.json to have correct version numbers
StatusFileSize
new580 bytes
new580 bytes

This is due to #2697637: Update composer.json to have correct version numbers - now composer.lock has to be managed different for each branch because the composer .json has a different hash.

Patch attached fixes the hash. This is going to be tricky to manage when two branches can have composer changes :(

alexpott’s picture

Issue tags: +Needs tests

This must be testable...

alexpott’s picture

Issue tags: -Needs tests
StatusFileSize
new765 bytes
new1.31 KB

Yep this is testable - so at least we won't miss this in the future.

The last submitted patch, 4: 2707619-4.test-only.patch, failed testing.

webflo’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Composer locker uses a slightly different logic but the test is good enough for our use case.

alexpott’s picture

@webflo yep - I looked at the Composer locker but I didn't want to duplicate the logic in ::getContentHash() - because then we'd have to maintain a copy of that method.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 4: 2707619-4.patch, failed testing.

alexpott’s picture

Version: 8.2.x-dev » 8.1.x-dev
Status: Needs work » Reviewed & tested by the community
StatusFileSize
new765 bytes

Lol so #2712643: Update behat/* to 1.7.1 and fabpot/goutte to 3.1.2 fixed this because it re-generated composer.lock

Given how easy this occurs I think we should add the test to 8.1.x and 8.2.x.

  • catch committed 8772c0f on 8.2.x
    Issue #2707619 by alexpott: Composer install generates warning
    

  • catch committed f926544 on 8.1.x
    Issue #2707619 by alexpott: Composer install generates warning
    
    (cherry...
catch’s picture

Title: Composer install generates warning » Composer install generates warning - add tests
Status: Reviewed & tested by the community » Fixed

Committed f926544 and pushed to 8.1.x. Thanks!

The test will make sure that issue doesn't regress this again when we cherry-pick to 8.1.x - can see if it fails the new test or not now.

Status: Fixed » Closed (fixed)

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