Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Commits
f74d4daa
Commit
f74d4daa
authored
1 year ago
by
Adam G-H
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3408483
by phenaproxima, Wim Leers: Support cweagans/composer-patches 2.x
parent
a79ff6a4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!991
Allow cweagans/composer-patches 2.x
Pipeline
#75914
canceled
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package_manager/src/Validator/ComposerPatchesValidator.php
+16
-4
16 additions, 4 deletions
package_manager/src/Validator/ComposerPatchesValidator.php
package_manager/src/Validator/ComposerPluginsValidator.php
+1
-1
1 addition, 1 deletion
package_manager/src/Validator/ComposerPluginsValidator.php
with
17 additions
and
5 deletions
package_manager/src/Validator/ComposerPatchesValidator.php
+
16
−
4
View file @
f74d4daa
...
...
@@ -4,6 +4,7 @@ declare(strict_types = 1);
namespace
Drupal\package_manager\Validator
;
use
Composer\Semver\Semver
;
use
Drupal\Component\Serialization\Json
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\StringTranslation\StringTranslationTrait
;
...
...
@@ -155,15 +156,26 @@ final class ComposerPatchesValidator implements EventSubscriberInterface {
*/
private
function
computePatcherStatus
(
string
$working_dir
):
array
{
$list
=
$this
->
composerInspector
->
getInstalledPackagesList
(
$working_dir
);
$
is_
installed
=
isset
(
$list
[
static
::
PLUGIN_NAME
]
)
;
$installed
_version
=
$list
[
static
::
PLUGIN_NAME
]
?->
version
;
$info
=
$this
->
composerInspector
->
getRootPackageInfo
(
$working_dir
);
$is_root_requirement
=
array_key_exists
(
static
::
PLUGIN_NAME
,
$info
[
'requires'
]
??
[])
||
array_key_exists
(
static
::
PLUGIN_NAME
,
$info
[
'devRequires'
]
??
[]);
$extra
=
Json
::
decode
(
$this
->
composerInspector
->
getConfig
(
'extra'
,
$working_dir
));
$exit_on_failure
=
$extra
[
'composer-exit-on-patch-failure'
]
??
FALSE
;
// The 2.x version of the plugin always exits with an error if a patch can't
// be applied.
if
(
$installed_version
&&
Semver
::
satisfies
(
$installed_version
,
'^2'
))
{
$exit_on_failure
=
TRUE
;
}
else
{
$extra
=
Json
::
decode
(
$this
->
composerInspector
->
getConfig
(
'extra'
,
$working_dir
));
$exit_on_failure
=
$extra
[
'composer-exit-on-patch-failure'
]
??
FALSE
;
}
return
[
$is_installed
,
$is_root_requirement
,
$exit_on_failure
];
return
[
is_string
(
$installed_version
),
$is_root_requirement
,
$exit_on_failure
,
];
}
/**
...
...
This diff is collapsed.
Click to expand it.
package_manager/src/Validator/ComposerPluginsValidator.php
+
1
−
1
View file @
f74d4daa
...
...
@@ -64,7 +64,7 @@ final class ComposerPluginsValidator implements EventSubscriberInterface {
private
const
SUPPORTED_PLUGINS_THAT_DO_MODIFY
=
[
// cSpell:disable
// @see \Drupal\package_manager\Validator\ComposerPatchesValidator
'cweagans/composer-patches'
=>
'^1.7.3'
,
'cweagans/composer-patches'
=>
'^1.7.3
|| ^2
'
,
// @see \Drupal\package_manager\PathExcluder\VendorHardeningExcluder
'drupal/core-vendor-hardening'
=>
'*'
,
'php-http/discovery'
=>
'*'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment