Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3449631
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
automatic_updates-3449631
Commits
36f5ecd3
Commit
36f5ecd3
authored
2 years ago
by
Kunal Sachdev
Committed by
Adam G-H
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3342726
by kunal.sachdev, Wim Leers: UnknownPathExcluder doesn’t consider hidden files
parent
a8533e25
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package_manager/src/PathExcluder/UnknownPathExcluder.php
+2
-1
2 additions, 1 deletion
package_manager/src/PathExcluder/UnknownPathExcluder.php
package_manager/tests/src/Kernel/PathExcluder/UnknownPathExcluderTest.php
+20
-0
20 additions, 0 deletions
...tests/src/Kernel/PathExcluder/UnknownPathExcluderTest.php
with
22 additions
and
1 deletion
package_manager/src/PathExcluder/UnknownPathExcluder.php
+
2
−
1
View file @
36f5ecd3
...
@@ -64,7 +64,8 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
...
@@ -64,7 +64,8 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// @todo Refactor in https://www.drupal.org/project/automatic_updates/issues/3334994.
// @todo Refactor in https://www.drupal.org/project/automatic_updates/issues/3334994.
$core_packages
=
$event
->
stage
->
getActiveComposer
()
->
getCorePackages
();
$core_packages
=
$event
->
stage
->
getActiveComposer
()
->
getCorePackages
();
$scaffold_files_paths
=
$this
->
getScaffoldFiles
(
$core_packages
);
$scaffold_files_paths
=
$this
->
getScaffoldFiles
(
$core_packages
);
$paths_in_project_root
=
glob
(
"
$project_root
/*"
);
// Search for all files (including hidden ones) in project root.
$paths_in_project_root
=
glob
(
"
$project_root
/
{
,.
}
*"
,
GLOB_BRACE
);
$paths
=
[];
$paths
=
[];
$known_paths
=
array_merge
([
$vendor_dir
,
$web_root
,
"
$project_root
/composer.json"
,
"
$project_root
/composer.lock"
],
$scaffold_files_paths
);
$known_paths
=
array_merge
([
$vendor_dir
,
$web_root
,
"
$project_root
/composer.json"
,
"
$project_root
/composer.lock"
],
$scaffold_files_paths
);
foreach
(
$paths_in_project_root
as
$path_in_project_root
)
{
foreach
(
$paths_in_project_root
as
$path_in_project_root
)
{
...
...
This diff is collapsed.
Click to expand it.
package_manager/tests/src/Kernel/PathExcluder/UnknownPathExcluderTest.php
+
20
−
0
View file @
36f5ecd3
...
@@ -94,6 +94,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
...
@@ -94,6 +94,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
NULL
,
NULL
,
[
'unknown_file.txt'
],
[
'unknown_file.txt'
],
],
],
'unknown hidden file where web and project root same'
=>
[
FALSE
,
NULL
,
[
'.unknown_file'
],
],
'unknown hidden file where web and project root different'
=>
[
TRUE
,
NULL
,
[
'.unknown_file'
],
],
'unknown directory where web and project root same'
=>
[
'unknown directory where web and project root same'
=>
[
FALSE
,
FALSE
,
'unknown_dir'
,
'unknown_dir'
,
...
@@ -104,6 +114,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
...
@@ -104,6 +114,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
'unknown_dir'
,
'unknown_dir'
,
[
'unknown_dir/unknown_dir.README.md'
,
'unknown_dir/unknown_file.txt'
],
[
'unknown_dir/unknown_dir.README.md'
,
'unknown_dir/unknown_file.txt'
],
],
],
'unknown hidden directory where web and project root same'
=>
[
FALSE
,
'.unknown_dir'
,
[
'.unknown_dir/unknown_dir.README.md'
,
'.unknown_dir/unknown_file.txt'
],
],
'unknown hidden directory where web and project root different'
=>
[
TRUE
,
'.unknown_dir'
,
[
'.unknown_dir/unknown_dir.README.md'
,
'.unknown_dir/unknown_file.txt'
],
],
];
];
}
}
...
...
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