Skip to content

Commit

Permalink
ISSUE-370: improve documentatio
Browse files Browse the repository at this point in the history
  • Loading branch information
beto-aveiga committed Oct 4, 2024
1 parent c34bfef commit 0f9280d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/scripts/ComposerChecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,58 @@ check_composer_install_contents() {
fi
}

# Exit on patch failure.
# Exit on patch failure: not set, warning expected.
ddev composer config --unset extra.composer-exit-on-patch-failure
check_composer_install_contents "Break Composer install if patches don't apply" 1

# Exit on patch failure: false, warning expected.
ddev composer config extra.composer-exit-on-patch-failure --json false
check_composer_install_contents "Break Composer install if patches don't apply" 1

## Opt out.
# Exit on patch failure: opt-out, warning not expected.
ddev composer config extra.drainpipe.composer --json '{"disable-exit-on-patch-failure-check": true}'
check_composer_install_contents "Break Composer install if patches don't apply" 0
ddev composer config --unset extra.drainpipe.composer

# Exit on patch failure: true, warning not expected.
ddev composer config extra.composer-exit-on-patch-failure --json true
check_composer_install_contents "Break Composer install if patches don't apply" 0

# Drupal core patches level.
# Drupal core patches level: okay, warning not expected.
ddev composer config extra.patchLevel --json '{"drupal/core": "-p2"}'
check_composer_install_contents "Configure Composer patches to use \`-p2\` as \`patchLevel\` for Drupal core" 0

# Drupal core patches level: not set, warning expected.
ddev composer config --unset extra.patchLevel
check_composer_install_contents "Configure Composer patches to use \`-p2\` as \`patchLevel\` for Drupal core" 1

## Opt out.
# Drupal core patches level: opt-out, warning not expected.
ddev composer config extra.drainpipe.composer --json '{"disable-drupal-core-patches-level-check": true}'
check_composer_install_contents "Configure Composer patches to use \`-p2\` as \`patchLevel\` for Drupal core" 0
ddev composer config --unset extra.drainpipe.composer

# Patches configuration in composer.json
# Patches configuration in composer.json: defined, warning expected.
ddev composer config extra.patches-file "composer.patches.json"
check_composer_install_contents "Store Composer patches configuration in \`composer.json\`" 1

## Opt out.
# Patches configuration in composer.json: opt-out, warning not expected.
ddev composer config extra.drainpipe.composer --json '{"disable-drupal-core-patches-level-check": true}'
check_composer_install_contents "Configure Composer patches to use \`-p2\` as \`patchLevel\` for Drupal core" 0
ddev composer config --unset extra.drainpipe.composer

# Patches configuration in composer.json: not defined, warning not expected.
ddev composer config --unset extra.patches-file
check_composer_install_contents "Store Composer patches configuration in \`composer.json\`" 0

# Avoid remote patches
# Avoid remote patches: remote patch is defined, warning expected.
ddev composer config extra.patches --json '{"drupal":{"issue-x":"http"}}'
check_composer_install_contents "Use local copies of patch files." 1

## Opt out: disable-local-patches-check
# Avoid remote patches: opt-out, warning not expected.
ddev composer config extra.drainpipe.composer --json '{"disable-local-patches-check": true}'
check_composer_install_contents "Use local copies of patch files." 0
ddev composer config --unset extra.drainpipe.composer

# Avoid remote patches: no remote patches found, warning not expected.
ddev composer config extra.patches --json '{"drupal":{"issue-x":"local-path"}}'
check_composer_install_contents "Use local copies of patch files." 0

0 comments on commit 0f9280d

Please sign in to comment.