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
e857dcc9
Commit
e857dcc9
authored
1 year ago
by
Ted Bowman
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3350909
by tedbow: Core merge request conversion now incorrectly fails on phpstan
parent
bd0ef69e
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
composer.json
+4
-2
4 additions, 2 deletions
composer.json
scripts/src/Converter.php
+21
-2
21 additions, 2 deletions
scripts/src/Converter.php
with
25 additions
and
4 deletions
composer.json
+
4
−
2
View file @
e857dcc9
...
@@ -25,13 +25,15 @@
...
@@ -25,13 +25,15 @@
"Composer
\\
Config::disableProcessTimeout"
,
"Composer
\\
Config::disableProcessTimeout"
,
"scripts/phpunit.sh"
"scripts/phpunit.sh"
],
],
"core-convert"
:
"Drupal
\\
automatic_updates
\\
Development
\\
Converter::doConvert"
"core-convert"
:
"Drupal
\\
automatic_updates
\\
Development
\\
Converter::doConvert"
,
"core-commit"
:
"Drupal
\\
automatic_updates
\\
Development
\\
Converter::makeCommit"
},
},
"scripts-descriptions"
:
{
"scripts-descriptions"
:
{
"phpcbf"
:
"Automatically fixes standards violations where possible."
,
"phpcbf"
:
"Automatically fixes standards violations where possible."
,
"phpcs"
:
"Checks code for standards compliance."
,
"phpcs"
:
"Checks code for standards compliance."
,
"test"
:
"Runs PHPUnit tests."
,
"test"
:
"Runs PHPUnit tests."
,
"core-convert"
:
"Converts this module to a core merge request. Excepts 2 arguments. 1) The core clone directory. 2) The core merge request branch."
"core-convert"
:
"Converts this module to a core merge request. Excepts 2 arguments. 1) The core clone directory. 2) The core merge request branch."
,
"core-commit"
:
"Converts this module to a core merge request. Excepts 1 arguments. The core clone directory."
},
},
"autoload"
:
{
"autoload"
:
{
"psr-4"
:
{
"psr-4"
:
{
...
...
This diff is collapsed.
Click to expand it.
scripts/src/Converter.php
+
21
−
2
View file @
e857dcc9
...
@@ -141,7 +141,7 @@ class Converter {
...
@@ -141,7 +141,7 @@ class Converter {
else
{
else
{
self
::
info
(
'⚠️Skipped core checks'
);
self
::
info
(
'⚠️Skipped core checks'
);
}
}
static
::
m
akeCommit
(
$core_dir
);
static
::
doM
akeCommit
(
$core_dir
);
self
::
info
(
'Make commit'
);
self
::
info
(
'Make commit'
);
self
::
info
(
"Done. Probably good but you should check before you push. These are the files present in the contrib module absent in core:"
);
self
::
info
(
"Done. Probably good but you should check before you push. These are the files present in the contrib module absent in core:"
);
print
shell_exec
(
sprintf
(
"tree %s/package_manager > /tmp/contrib.txt && tree %s/core/modules/package_manager > /tmp/core.txt && diff /tmp/contrib.txt /tmp/core.txt"
,
self
::
getContribDir
(),
$core_dir
));
print
shell_exec
(
sprintf
(
"tree %s/package_manager > /tmp/contrib.txt && tree %s/core/modules/package_manager > /tmp/core.txt && diff /tmp/contrib.txt /tmp/core.txt"
,
self
::
getContribDir
(),
$core_dir
));
...
@@ -322,13 +322,32 @@ class Converter {
...
@@ -322,13 +322,32 @@ class Converter {
}
}
}
}
/**
* Makes the commit to the merge request.
*
* Should only be used if core code checks fail for a known reason that can
* be ignored.
*
* @param \Composer\Script\Event $event
* The Composer event.
*/
public
static
function
makeCommit
(
Event
$event
):
void
{
$args
=
$event
->
getArguments
();
$count_arg
=
count
(
$args
);
if
(
$count_arg
!==
1
)
{
throw
new
\Exception
(
"This scripts 1 required arguments: a directory that is a core clone"
);
}
$core_dir
=
$args
[
0
];
static
::
doMakeCommit
(
$core_dir
);
}
/**
/**
* Makes commit in the root of Drupal Core.
* Makes commit in the root of Drupal Core.
*
*
* @param string $core_dir
* @param string $core_dir
* The path to the root of Drupal Core.
* The path to the root of Drupal Core.
*/
*/
private
static
function
m
akeCommit
(
string
$core_dir
):
void
{
private
static
function
doM
akeCommit
(
string
$core_dir
):
void
{
chdir
(
self
::
getContribDir
());
chdir
(
self
::
getContribDir
());
self
::
ensureGitClean
();
self
::
ensureGitClean
();
$hash
=
trim
(
shell_exec
(
'git rev-parse HEAD'
));
$hash
=
trim
(
shell_exec
(
'git rev-parse HEAD'
));
...
...
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