Skip to content
Snippets Groups Projects
Commit e857dcc9 authored by Ted Bowman's avatar Ted Bowman
Browse files

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
...@@ -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": {
......
...@@ -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::makeCommit($core_dir); static::doMakeCommit($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 makeCommit(string $core_dir): void { private static function doMakeCommit(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'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment