Skip to content

Stop composer install when a patch does not apply - #411

Open
turegjorup wants to merge 1 commit into
developfrom
feature/exit-on-patch-failure
Open

turegjorup wants to merge 1 commit into
developfrom
feature/exit-on-patch-failure

Conversation

@turegjorup

Copy link
Copy Markdown

Stop composer install when a composer patch does not apply.

Changes

  • Add "composer-exit-on-patch-failure": true to extra in composer.json.
  • Update the content-hash in composer.lock. No package changes.
  • Add a CHANGELOG entry.

Why

Without this setting, cweagans/composer-patches 1.x writes "Could not apply patch! Skipping" and continues. The install, CI and the deploy succeed, and the site runs without the fix from the patch. On doner-din-stemme a core patch did not apply for some time, and nobody saw it.

With this setting, a failed patch stops composer install. CI and the deploy then fail, and the problem is visible.

Checked locally: composer reinstall of all patched packages (drupal/core drupal/entity_print drupal/flag drupal/masquerade drupal/openid_connect drupal/toc_api) applies all 8 patches with the setting on.

@turegjorup turegjorup self-assigned this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant