Hello community, here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2019-11-09 23:43:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old) and /work/SRC/openSUSE:Factory/.platformsh-cli.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli" Sat Nov 9 23:43:59 2019 rev:85 rq:746717 version:3.49.3 Changes: -------- --- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2019-10-30 14:43:08.625884071 +0100 +++ /work/SRC/openSUSE:Factory/.platformsh-cli.new.2990/platformsh-cli.changes 2019-11-09 23:44:02.717624093 +0100 @@ -1,0 +2,14 @@ +Fri Nov 08 23:07:57 UTC 2019 - [email protected] + +- Update to version 3.49.3: + * Release v3.49.3 + * Warn about pushing to branches named "production" (#870) + * Add a @todo to follow up on #868 if/when possible + * Hide worker containers on enterprise (#868) + * Remove drush-aliases SSH calls to find the absolute app root (#869) + * Disallow . in Drush alias names (replace with -) + * Fix cases using the default argument incorrectly + * Fix choosing default option + * Allow --app option to correct select application + +------------------------------------------------------------------- Old: ---- platformsh-cli-3.49.2.tar.xz New: ---- platformsh-cli-3.49.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ platformsh-cli.spec ++++++ --- /var/tmp/diff_new_pack.XBzGtT/_old 2019-11-09 23:44:04.629626892 +0100 +++ /var/tmp/diff_new_pack.XBzGtT/_new 2019-11-09 23:44:04.633626898 +0100 @@ -17,7 +17,7 @@ Name: platformsh-cli -Version: 3.49.2 +Version: 3.49.3 Release: 0 Summary: Tool for managing Platform.sh services from the command line # See licenses.txt for dependency licenses. ++++++ _service ++++++ --- /var/tmp/diff_new_pack.XBzGtT/_old 2019-11-09 23:44:04.657626933 +0100 +++ /var/tmp/diff_new_pack.XBzGtT/_new 2019-11-09 23:44:04.657626933 +0100 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">refs/tags/v3.49.2</param> + <param name="revision">refs/tags/v3.49.3</param> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> <param name="scm">git</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.XBzGtT/_old 2019-11-09 23:44:04.673626956 +0100 +++ /var/tmp/diff_new_pack.XBzGtT/_new 2019-11-09 23:44:04.673626956 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> - <param name="changesrevision">fd65c82831cc8ca6d48d3d57fb52cdceff0e9b5b</param> + <param name="changesrevision">8eeeec8d0d62d07f5017169b8c8f1dbdeab1ba64</param> </service> </servicedata> ++++++ platformsh-cli-3.49.2.tar.xz -> platformsh-cli-3.49.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/dist/manifest.json new/platformsh-cli-3.49.3/dist/manifest.json --- old/platformsh-cli-3.49.2/dist/manifest.json 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/dist/manifest.json 2019-11-08 14:54:47.000000000 +0100 @@ -17,10 +17,10 @@ }, { "name": "platform.phar", - "sha1": "cf9fc3eaa8d8bdb5236292c93c7c71f9ccfbf48d", - "sha256": "21c7a95600043cf6cd713294f1254716e81553df1c809f4fb6b4209d9908d4f1", - "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.49.2/platform.phar", - "version": "3.49.2", + "sha1": "23898771039ae437822067c7f0e8f4f833b4a1dd", + "sha256": "d6ad31f38fabea442848d712ac7d33045de6a9528b89c1dfac0cb3d8a27ea22b", + "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.49.3/platform.phar", + "version": "3.49.3", "php": { "min": "5.5.9" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Command/CommandBase.php new/platformsh-cli-3.49.3/src/Command/CommandBase.php --- old/platformsh-cli-3.49.2/src/Command/CommandBase.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Command/CommandBase.php 2019-11-08 14:54:47.000000000 +0100 @@ -885,6 +885,7 @@ } $environment = $this->getSelectedEnvironment(); + try { $deployment = $this->api()->getCurrentDeployment( $environment, @@ -899,19 +900,26 @@ throw $e; } - // Validate the --app option, without doing anything with it. + // Read the --app and --worker options, if the latter is specified then it will be used. $appOption = $input->hasOption('app') ? $input->getOption('app') : null; + $workerOption = $includeWorkers && $input->hasOption('worker') ? $input->getOption('worker') : null; + if ($appOption !== null) { try { - $deployment->getWebApp($appOption); + $webApp = $deployment->getWebApp($appOption); } catch (\InvalidArgumentException $e) { throw new ConsoleInvalidArgumentException('Application not found: ' . $appOption); } + + // No worker option specified so select app directly. + if ($workerOption === null) { + return $this->remoteContainer = new RemoteContainer\App($webApp, $environment); + } + + unset($webApp); // object is no longer required. } - // Handle the --worker option first, as it's more specific. - $workerOption = $input->hasOption('worker') ? $input->getOption('worker') : null; - if ($includeWorkers && $workerOption !== null) { + if ($workerOption !== null) { // Check for a conflict with the --app option. if ($appOption !== null && strpos($workerOption, '--') !== false @@ -972,6 +980,13 @@ return $this->remoteContainer = new RemoteContainer\Worker($deployment->getWorker($workerName), $environment); } + // Enterprise environments do not have separate containers for workers. + // Disable interactive selection of worker. + // @todo revise this when the API provides an explicit list of SSH endpoints + if ($includeWorkers && $environment->deployment_target !== 'local') { + $includeWorkers = false; + } + // Prompt the user to choose between the app(s) or worker(s) that have // been found. $default = null; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Command/Db/DbDumpCommand.php new/platformsh-cli-3.49.3/src/Command/Db/DbDumpCommand.php --- old/platformsh-cli-3.49.2/src/Command/Db/DbDumpCommand.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Command/Db/DbDumpCommand.php 2019-11-08 14:54:47.000000000 +0100 @@ -110,7 +110,7 @@ } /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ $questionHelper = $this->getService('question_helper'); - $schema = $questionHelper->choose($choices, 'Enter a number to choose a schema:', $database['path'] ? $database['path'] . ' (default)' : null, true); + $schema = $questionHelper->choose($choices, 'Enter a number to choose a schema:', $database['path'], true); if (empty($schema)) { $this->stdErr->writeln('The --schema is required.'); if (!empty($schemas)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Command/Db/DbSqlCommand.php new/platformsh-cli-3.49.3/src/Command/Db/DbSqlCommand.php --- old/platformsh-cli-3.49.2/src/Command/Db/DbSqlCommand.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Command/Db/DbSqlCommand.php 2019-11-08 14:54:47.000000000 +0100 @@ -99,7 +99,7 @@ } /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ $questionHelper = $this->getService('question_helper'); - $schema = $questionHelper->choose($choices, 'Enter a number to choose a schema:', $default . ' (default)', true); + $schema = $questionHelper->choose($choices, 'Enter a number to choose a schema:', $default, true); $schema = $schema === '(none)' ? '' : $schema; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Command/Environment/EnvironmentPushCommand.php new/platformsh-cli-3.49.3/src/Command/Environment/EnvironmentPushCommand.php --- old/platformsh-cli-3.49.2/src/Command/Environment/EnvironmentPushCommand.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Command/Environment/EnvironmentPushCommand.php 2019-11-08 14:54:47.000000000 +0100 @@ -85,13 +85,17 @@ } // Guard against accidental pushing to production. + // @todo if/when the API provides "is this production" for an environment, use that instead of hardcoding branch names /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ $questionHelper = $this->getService('question_helper'); - if ($target === 'master' - && !$questionHelper->confirm( - 'Are you sure you want to push to the <comment>master</comment> (production) branch?' - )) { - return 1; + if (in_array($target, ['master', 'production'])) { + $questionText = sprintf( + 'Are you sure you want to push to the %s branch?', + '<comment>' . $target . '</comment>' . ($target === 'production' ? '' : ' (production)') + ); + if (!$questionHelper->confirm($questionText)) { + return 1; + } } // Determine whether the target environment is new. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Command/Local/LocalDrushAliasesCommand.php new/platformsh-cli-3.49.3/src/Command/Local/LocalDrushAliasesCommand.php --- old/platformsh-cli-3.49.2/src/Command/Local/LocalDrushAliasesCommand.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Command/Local/LocalDrushAliasesCommand.php 2019-11-08 14:54:47.000000000 +0100 @@ -5,7 +5,6 @@ use Platformsh\Cli\Command\CommandBase; use Platformsh\Cli\Exception\RootNotFoundException; use Platformsh\Cli\Local\BuildFlavor\Drupal; -use Platformsh\Cli\Model\Host\RemoteHost; use Platformsh\Cli\Service\Drush; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -50,8 +49,7 @@ /** @var \Platformsh\Cli\Service\Drush $drush */ $drush = $this->getService('drush'); - $apps = $drush->getDrupalApps($projectRoot); - if (empty($apps)) { + if (!$drush->getDrupalApps($projectRoot)) { $this->stdErr->writeln('No Drupal applications found.'); return 1; @@ -101,48 +99,13 @@ $environments = $this->api()->getEnvironments($project, true, false); - // Attempt to find the absolute application root directory for - // each Enterprise environment. This will be cached by the Drush - // service ($drush), for use while generating aliases. - /** @var \Platformsh\Cli\Service\RemoteEnvVars $envVarsService */ - $envVarsService = $this->getService('remote_env_vars'); - /** @var \Platformsh\Cli\Service\Ssh $ssh */ - $ssh = $this->getService('ssh'); - /** @var \Platformsh\Cli\Service\Shell $shell */ - $shell = $this->getService('shell'); + // Cache each environment's deployment information. + // This will at least be used for \Platformsh\Cli\Service\Drush::getSiteUrl(). foreach ($environments as $environment) { - - // Cache the environment's deployment information. - // This will at least be used for \Platformsh\Cli\Service\Drush::getSiteUrl(). if (!$this->api()->hasCachedCurrentDeployment($environment) && $environment->isActive()) { $this->debug('Fetching deployment information for environment: ' . $environment->id); $this->api()->getCurrentDeployment($environment); } - - if ($environment->deployment_target === 'local') { - continue; - } - foreach ($apps as $app) { - $sshUrl = $environment->getSshUrl($app->getName()); - if (empty($sshUrl)) { - continue; - } - try { - $appRoot = $envVarsService->getEnvVar('APP_DIR', new RemoteHost($sshUrl, $ssh, $shell)); - } catch (\Symfony\Component\Process\Exception\RuntimeException $e) { - $this->stdErr->writeln(sprintf( - 'Unable to find app root for environment %s, app %s', - $this->api()->getEnvironmentLabel($environment, 'comment'), - '<comment>' . $app->getName() . '</comment>' - )); - $this->stdErr->writeln($e->getMessage()); - continue; - } - if (!empty($appRoot)) { - $this->debug(sprintf('App root for %s: %s', $sshUrl, $appRoot)); - $drush->setCachedAppRoot($sshUrl, $appRoot); - } - } } $drush->createAliases($project, $projectRoot, $environments, $current_group); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Service/Drush.php new/platformsh-cli-3.49.3/src/Service/Drush.php --- old/platformsh-cli-3.49.2/src/Service/Drush.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Service/Drush.php 2019-11-08 14:54:47.000000000 +0100 @@ -39,9 +39,6 @@ /** @var string|null */ protected $executable; - /** @var string[] */ - protected $cachedAppRoots = []; - /** * @param Config|null $config * @param Shell|null $shellHelper @@ -71,25 +68,6 @@ } /** - * @param string $sshUrl - * @param string $enterpriseAppRoot - */ - public function setCachedAppRoot($sshUrl, $enterpriseAppRoot) - { - $this->cachedAppRoots[$sshUrl] = $enterpriseAppRoot; - } - - /** - * @param string $sshUrl - * - * @return string - */ - public function getCachedAppRoot($sshUrl) - { - return isset($this->cachedAppRoots[$sshUrl]) ? $this->cachedAppRoots[$sshUrl] : false; - } - - /** * Find the global Drush configuration directory. * * @return string diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/Service/QuestionHelper.php new/platformsh-cli-3.49.3/src/Service/QuestionHelper.php --- old/platformsh-cli-3.49.2/src/Service/QuestionHelper.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/Service/QuestionHelper.php 2019-11-08 14:54:47.000000000 +0100 @@ -85,7 +85,7 @@ return key($items); } $itemList = array_values($items); - $defaultKey = $default !== null ? array_search($default, $itemList, true) : null; + $defaultKey = $default !== null && isset($items[$default]) ? array_search($items[$default], $itemList, true) : null; $question = new ChoiceQuestion($text, $itemList, $defaultKey); $question->setMaxAttempts(5); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.49.2/src/SiteAlias/DrushAlias.php new/platformsh-cli-3.49.3/src/SiteAlias/DrushAlias.php --- old/platformsh-cli-3.49.2/src/SiteAlias/DrushAlias.php 2019-10-25 22:09:07.000000000 +0200 +++ new/platformsh-cli-3.49.3/src/SiteAlias/DrushAlias.php 2019-11-08 14:54:47.000000000 +0100 @@ -187,7 +187,7 @@ continue; } - $aliasName = $environment->id; + $aliasName = str_replace('.', '-', $environment->id); if (count($apps) > 1) { $aliasName .= '--' . $appId; } @@ -246,19 +246,9 @@ 'options' => [ $this->getAutoRemoveKey() => true, ], + 'root' => $app->getDocumentRoot(), ]; - // For most environments, we know the application root directory is - // '/app'. It's different in Enterprise environments. - if ($environment->deployment_target !== 'local') { - $appRoot = $this->drush->getCachedAppRoot($sshUrl); - if ($appRoot) { - $alias['root'] = rtrim($appRoot, '/') . '/' . $app->getDocumentRoot(); - } - } else { - $alias['root'] = '/app/' . $app->getDocumentRoot(); - } - list($alias['user'], $alias['host']) = explode('@', $sshUrl, 2); if ($url = $this->drush->getSiteUrl($environment, $app)) { ++++++ platformsh-cli-vendor.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/autoload.php new/vendor/autoload.php --- old/vendor/autoload.php 2019-10-28 01:01:23.383440075 +0100 +++ new/vendor/autoload.php 2019-11-09 00:07:59.861989668 +0100 @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit7e31159215f7bdd480e8d91b2aacfc84::getLoader(); +return ComposerAutoloaderInit6b8dd9b8d7451fbcb8a95552d6242185::getLoader(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/composer/autoload_real.php new/vendor/composer/autoload_real.php --- old/vendor/composer/autoload_real.php 2019-10-28 01:01:23.383440075 +0100 +++ new/vendor/composer/autoload_real.php 2019-11-09 00:07:59.861989668 +0100 @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit7e31159215f7bdd480e8d91b2aacfc84 +class ComposerAutoloaderInit6b8dd9b8d7451fbcb8a95552d6242185 { private static $loader; @@ -19,15 +19,15 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit7e31159215f7bdd480e8d91b2aacfc84', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit6b8dd9b8d7451fbcb8a95552d6242185', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit7e31159215f7bdd480e8d91b2aacfc84', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit6b8dd9b8d7451fbcb8a95552d6242185', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +48,19 @@ $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire7e31159215f7bdd480e8d91b2aacfc84($fileIdentifier, $file); + composerRequire6b8dd9b8d7451fbcb8a95552d6242185($fileIdentifier, $file); } return $loader; } } -function composerRequire7e31159215f7bdd480e8d91b2aacfc84($fileIdentifier, $file) +function composerRequire6b8dd9b8d7451fbcb8a95552d6242185($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/composer/autoload_static.php new/vendor/composer/autoload_static.php --- old/vendor/composer/autoload_static.php 2019-10-28 01:01:23.383440075 +0100 +++ new/vendor/composer/autoload_static.php 2019-11-09 00:07:59.861989668 +0100 @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84 +class ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185 { public static $files = array ( '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', @@ -193,9 +193,9 @@ public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit7e31159215f7bdd480e8d91b2aacfc84::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit6b8dd9b8d7451fbcb8a95552d6242185::$classMap; }, null, ClassLoader::class); }
