hey
hey

Reputation: 3242

How to update composer.lock for including a specific patch via composer-patches?

We use composer in our project. I should normally use composer install, when I develop and/or commit anything to the project; updating dependencies is only done occasionally.

We also use https://github.com/cweagans/composer-patches for patches, and I have added a patch by adding some code to the composer.json file, same as my colleagues have done before:

"extra": {
    "patches": {
        "my-vendor/my-extension": {
           "Fix: extension bug.": "patches/T1024-711_feature.patch"
        }
    }
}

This looks good and seems to work, but I receive a warning message:

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.

I do not want to run composer update, because it would update many of the dependencies, and the entire application might have to go through a regression test.

What do I need to do?

Upvotes: 6

Views: 6895

Answers (1)

hey
hey

Reputation: 3242

After reading https://github.com/cweagans/composer-patches/issues/23, I decided to run

composer update --lock

... although I do not know if this is the best way. However, my internal PR has been approved with that, which might be an indicator for the solution being acceptable.

Upvotes: 10

Related Questions