composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

Report missing packages where patches exist (due to typo in patch package name for example)

Open driskell opened this issue 3 years ago • 2 comments

I've noticed a couple of times where a typo in the patches file meant patches weren't applied at all. Usually you pick it up straight away but I can see it could slip through and you'd not know until you test the impact of the patch.

This adds a last check after install to check for any patches that weren't applied because their package was not installed, and reports it to the console. If exit-on-failure is enabled it will also fail the install (as this is no different to an invalid patch).

It only works at the root level so won't report missing packages that nested dependencies are trying to patch (since the owner of the root package is unlikely to be able to fix it if it did.)

Happy to add the same to the new 2.x branch - I avoided initially as I can see checkPatches is disabled so it's likely not ready yet so would be hard to test - maybe when it's ready I can do the same PR.

driskell avatar Dec 03 '20 11:12 driskell

Hi @cweagans I will have some time to work on this further if there's some bits that need improving. Would be great to hear back. Thanks!

driskell avatar Jan 05 '21 16:01 driskell

@cweagans Do you think this might be looked at soon? Thanks.

driskell avatar Aug 11 '21 12:08 driskell

I've made a note to include this in #447.

cweagans avatar Feb 04 '23 07:02 cweagans

@cweagans Thanks! Would be great to cherry pick and adjust 😄

driskell avatar Feb 04 '23 09:02 driskell