Hello community, here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2018-04-05 15:34:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old) and /work/SRC/openSUSE:Factory/.platformsh-cli.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli" Thu Apr 5 15:34:40 2018 rev:43 rq:593647 version:3.31.6 Changes: -------- --- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2018-03-31 15:37:58.647317345 +0200 +++ /work/SRC/openSUSE:Factory/.platformsh-cli.new/platformsh-cli.changes 2018-04-05 15:34:44.917416720 +0200 @@ -1,0 +2,11 @@ +Wed Apr 04 23:08:02 UTC 2018 - [email protected] + +- Update to version 3.31.6: + * Release v3.31.6 + * [self:release] Validate version number against the last one [skip changelog] + * Use PhpExecutableFinder to execute 'php' commands + * Apply same "reset client" fix to auth:password-login + * [auth:browser-login] Reset API client after login + * [auth:browser-login] Log in again if an API request fails with 400 or 401 + +------------------------------------------------------------------- Old: ---- platformsh-cli-3.31.5.tar.xz New: ---- platformsh-cli-3.31.6.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ platformsh-cli.spec ++++++ --- /var/tmp/diff_new_pack.AW3gmG/_old 2018-04-05 15:34:45.545394024 +0200 +++ /var/tmp/diff_new_pack.AW3gmG/_new 2018-04-05 15:34:45.549393880 +0200 @@ -17,7 +17,7 @@ Name: platformsh-cli -Version: 3.31.5 +Version: 3.31.6 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.AW3gmG/_old 2018-04-05 15:34:45.585392578 +0200 +++ /var/tmp/diff_new_pack.AW3gmG/_new 2018-04-05 15:34:45.585392578 +0200 @@ -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.31.5</param> + <param name="revision">refs/tags/v3.31.6</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.AW3gmG/_old 2018-04-05 15:34:45.605391855 +0200 +++ /var/tmp/diff_new_pack.AW3gmG/_new 2018-04-05 15:34:45.605391855 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> - <param name="changesrevision">6602a8a0720a2208c777e2cf892fe130f274aaf6</param> + <param name="changesrevision">d1a3de82526448dd128320a43dcbcd581d027b72</param> </service> </servicedata> ++++++ platformsh-cli-3.31.5.tar.xz -> platformsh-cli-3.31.6.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/config.yaml new/platformsh-cli-3.31.6/config.yaml --- old/platformsh-cli-3.31.5/config.yaml 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/config.yaml 2018-04-04 11:19:14.000000000 +0200 @@ -1,7 +1,7 @@ # Metadata about the CLI application itself. application: name: 'Platform.sh CLI' - version: '3.31.5' + version: '3.31.6' executable: 'platform' package_name: 'platformsh/cli' installer_url: 'https://platform.sh/cli/installer' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/dist/manifest.json new/platformsh-cli-3.31.6/dist/manifest.json --- old/platformsh-cli-3.31.5/dist/manifest.json 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/dist/manifest.json 2018-04-04 11:19:14.000000000 +0200 @@ -1,10 +1,10 @@ [ { "name": "platform.phar", - "sha1": "7e194e6a78ae62e53e46cf0995b9f04c00e18c1c", - "sha256": "d530dfe7e98b592be2e2b878c62e8ea8341319aabe982d5d318d3f53ceae2008", - "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.31.5/platform.phar", - "version": "3.31.5", + "sha1": "b9367600e590716b63d913e122b7f6fe7178c258", + "sha256": "0860d24baa18ba7ee624221ddea0b715bea3d64dbdc8f6d0f64eb9249fa6ff9b", + "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.31.6/platform.phar", + "version": "3.31.6", "php": { "min": "5.5.9" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/src/Command/Auth/BrowserLoginCommand.php new/platformsh-cli-3.31.6/src/Command/Auth/BrowserLoginCommand.php --- old/platformsh-cli-3.31.5/src/Command/Auth/BrowserLoginCommand.php 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/src/Command/Auth/BrowserLoginCommand.php 2018-04-04 11:19:14.000000000 +0200 @@ -3,13 +3,16 @@ use CommerceGuys\Guzzle\Oauth2\AccessToken; use GuzzleHttp\Client; +use GuzzleHttp\Exception\BadResponseException; use Platformsh\Cli\Command\CommandBase; use Platformsh\Cli\Service\Filesystem; use Platformsh\Cli\Service\Url; use Platformsh\Cli\Util\PortUtil; +use Platformsh\Client\Session\SessionInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; class BrowserLoginCommand extends CommandBase @@ -53,14 +56,29 @@ } $connector = $this->api()->getClient(false)->getConnector(); if (!$input->getOption('force') && $connector->isLoggedIn()) { - $account = $this->api()->getMyAccount(); - $this->stdErr->writeln(sprintf('You are already logged in as <info>%s</info> (%s).', - $account['username'], - $account['mail'] - )); - // USE THE FORCE - $this->stdErr->writeln('Use the <comment>--force</comment> (<comment>-f</comment>) option to log in again.'); - return 0; + // Get account information, simultaneously checking whether the API + // login is still valid. If the request works, then do not log in + // again (unless --force is used). If the request fails, proceed + // with login. + try { + $account = $this->api()->getMyAccount(true); + + $this->stdErr->writeln(sprintf('You are already logged in as <info>%s</info> (%s).', + $account['username'], + $account['mail'] + )); + + // USE THE FORCE + $this->stdErr->writeln('Use the <comment>--force</comment> (<comment>-f</comment>) option to log in again.'); + + return 0; + } catch (BadResponseException $e) { + if ($e->getResponse() && in_array($e->getResponse()->getStatusCode(), [400, 401], true)) { + $this->debug('Already logged in, but a test request failed. Continuing with login.'); + } else { + throw $e; + } + } } // Set up the local PHP web server, which will serve an OAuth2 redirect @@ -109,7 +127,7 @@ // Start the local server. $process = new Process([ - 'php', + (new PhpExecutableFinder())->find() ?: PHP_BINARY, '-dvariables_order=egps', '-S', $localAddress, @@ -193,11 +211,14 @@ /** @var \Doctrine\Common\Cache\CacheProvider $cache */ $cache = $this->getService('cache'); $cache->flushAll(); - $this->saveAccessToken($token); + + // Reset the API client so that it will use the new tokens. + $client = $this->api()->getClient(false, true); + $this->saveAccessToken($token, $client->getConnector()->getSession()); $this->stdErr->writeln('You are logged in.'); // Show user account info. - $info = $this->api()->getClient(false)->getAccountInfo(); + $info = $client->getAccountInfo(); $this->stdErr->writeln(sprintf( "\nUsername: <info>%s</info>\nEmail address: <info>%s</info>", $info['username'], @@ -208,12 +229,12 @@ } /** - * @param array $tokenData + * @param array $tokenData + * @param SessionInterface $session */ - private function saveAccessToken(array $tokenData) + private function saveAccessToken(array $tokenData, SessionInterface $session) { $token = new AccessToken($tokenData['access_token'], $tokenData['token_type'], $tokenData); - $session = $this->api()->getClient(false)->getConnector()->getSession(); $session->setData([ 'accessToken' => $token->getToken(), 'tokenType' => $token->getType(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/src/Command/Auth/PasswordLoginCommand.php new/platformsh-cli-3.31.6/src/Command/Auth/PasswordLoginCommand.php --- old/platformsh-cli-3.31.5/src/Command/Auth/PasswordLoginCommand.php 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/src/Command/Auth/PasswordLoginCommand.php 2018-04-04 11:19:14.000000000 +0200 @@ -60,7 +60,7 @@ $cache = $this->getService('cache'); $cache->flushAll(); - $info = $this->api()->getClient(false)->getAccountInfo(); + $info = $this->api()->getClient(false, true)->getAccountInfo(); if (isset($info['username'], $info['mail'])) { $this->stdErr->writeln(''); $this->stdErr->writeln(sprintf( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/src/Command/Self/SelfReleaseCommand.php new/platformsh-cli-3.31.6/src/Command/Self/SelfReleaseCommand.php --- old/platformsh-cli-3.31.5/src/Command/Self/SelfReleaseCommand.php 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/src/Command/Self/SelfReleaseCommand.php 2018-04-04 11:19:14.000000000 +0200 @@ -7,6 +7,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Process\PhpExecutableFinder; class SelfReleaseCommand extends CommandBase { @@ -26,7 +27,8 @@ ->addOption('manifest-mode', null, InputOption::VALUE_REQUIRED, 'How to update the manifest file', 'update-latest') ->addOption('release-branch', null, InputOption::VALUE_REQUIRED, 'Override the release branch', $defaultReleaseBranch) ->addOption('last-version', null, InputOption::VALUE_REQUIRED, 'Specify the last version number') - ->addOption('no-check-changes', null, InputOption::VALUE_NONE, 'Skip check for uncommitted changes'); + ->addOption('no-check-changes', null, InputOption::VALUE_NONE, 'Skip check for uncommitted changes') + ->addOption('allow-lower', null, InputOption::VALUE_NONE, 'Allow releasing with a lower version number than the last'); } public function isEnabled() @@ -141,7 +143,11 @@ return $result; } } else { - $versionInPhar = $shell->execute(['php', $pharFilename, '--version'], null, true); + $versionInPhar = $shell->execute([ + (new PhpExecutableFinder())->find() ?: PHP_BINARY, + $pharFilename, + '--version' + ], null, true); if (strpos($versionInPhar, $newVersion) === false) { $this->stdErr->writeln('The file ' . $pharFilename . ' reports a different version: "' . $versionInPhar . '"'); @@ -201,6 +207,13 @@ $this->stdErr->writeln(' Found latest version: v' . $lastVersion); } + if (version_compare($newVersion, $lastVersion, '<') && !$input->getOption('allow-lower')) { + $this->stdErr->writeln(sprintf('The new version number <error>%s</error> is lower than the last version number <error>%s</error>.', $newVersion, $lastVersion)); + $this->stdErr->writeln('Use --allow-lower to skip this check.'); + + return 1; + } + $pharPublicFilename = $this->config()->get('application.executable') . '.phar'; $changelog = $this->getReleaseChangelog($lastVersion, $repoApiUrl); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/src/Command/Server/ServerCommandBase.php new/platformsh-cli-3.31.6/src/Command/Server/ServerCommandBase.php --- old/platformsh-cli-3.31.5/src/Command/Server/ServerCommandBase.php 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/src/Command/Server/ServerCommandBase.php 2018-04-04 11:19:14.000000000 +0200 @@ -5,6 +5,7 @@ use Platformsh\Cli\Util\PortUtil; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\StreamOutput; +use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; abstract class ServerCommandBase extends CommandBase @@ -246,7 +247,7 @@ $this->showSecurityWarning(); - $arguments[] = 'php'; + $arguments[] = (new PhpExecutableFinder())->find() ?: PHP_BINARY; foreach ($this->getServerPhpConfig() as $item => $value) { $arguments[] = sprintf('-d %s="%s"', $item, $value); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.31.5/src/Service/Api.php new/platformsh-cli-3.31.6/src/Service/Api.php --- old/platformsh-cli-3.31.5/src/Service/Api.php 2018-03-30 17:03:36.000000000 +0200 +++ new/platformsh-cli-3.31.6/src/Service/Api.php 2018-04-04 11:19:14.000000000 +0200 @@ -162,12 +162,13 @@ * * @param bool $autoLogin Whether to log in, if the client is not already * authenticated (default: true). + * @param bool $reset Whether to re-initialize the client. * * @return PlatformClient */ - public function getClient($autoLogin = true) + public function getClient($autoLogin = true, $reset = false) { - if (!isset(self::$client)) { + if (!isset(self::$client) || $reset) { $connectorOptions = []; $connectorOptions['accounts'] = rtrim($this->config->get('api.accounts_api_url'), '/') . '/'; $connectorOptions['verify'] = !$this->config->get('api.skip_ssl'); ++++++ 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 2018-03-31 02:59:16.463102901 +0200 +++ new/vendor/autoload.php 2018-04-05 01:08:05.393474032 +0200 @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit1d4b01237e44e16ca3a54bed97926edf::getLoader(); +return ComposerAutoloaderInit8c7f53e382a59bdd83922f140712d640::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 2018-03-31 02:59:16.463102901 +0200 +++ new/vendor/composer/autoload_real.php 2018-04-05 01:08:05.393474032 +0200 @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit1d4b01237e44e16ca3a54bed97926edf +class ComposerAutoloaderInit8c7f53e382a59bdd83922f140712d640 { private static $loader; @@ -19,15 +19,15 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit1d4b01237e44e16ca3a54bed97926edf', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit8c7f53e382a59bdd83922f140712d640', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit1d4b01237e44e16ca3a54bed97926edf', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit8c7f53e382a59bdd83922f140712d640', '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\ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit8c7f53e382a59bdd83922f140712d640::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\ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit8c7f53e382a59bdd83922f140712d640::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire1d4b01237e44e16ca3a54bed97926edf($fileIdentifier, $file); + composerRequire8c7f53e382a59bdd83922f140712d640($fileIdentifier, $file); } return $loader; } } -function composerRequire1d4b01237e44e16ca3a54bed97926edf($fileIdentifier, $file) +function composerRequire8c7f53e382a59bdd83922f140712d640($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 2018-03-31 02:59:16.463102901 +0200 +++ new/vendor/composer/autoload_static.php 2018-04-05 01:08:05.393474032 +0200 @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf +class ComposerStaticInit8c7f53e382a59bdd83922f140712d640 { public static $files = array ( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', @@ -195,9 +195,9 @@ public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit1d4b01237e44e16ca3a54bed97926edf::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit8c7f53e382a59bdd83922f140712d640::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit8c7f53e382a59bdd83922f140712d640::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit8c7f53e382a59bdd83922f140712d640::$classMap; }, null, ClassLoader::class); }
