Hello community, here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2019-09-26 20:41:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old) and /work/SRC/openSUSE:Factory/.platformsh-cli.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli" Thu Sep 26 20:41:11 2019 rev:81 rq:733212 version:3.48.1 Changes: -------- --- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2019-09-23 12:46:31.761520016 +0200 +++ /work/SRC/openSUSE:Factory/.platformsh-cli.new.2352/platformsh-cli.changes 2019-09-26 20:41:18.258531226 +0200 @@ -1,0 +2,14 @@ +Wed Sep 25 16:34:21 UTC 2019 - [email protected] + +- Update to version 3.48.1: + * Release v3.48.1 + * Fix default message for HttpException + * Fix push --activate for new environments + * Unused imports + * Fix flickering activity state + * Don't prompt to run the original command if it is empty + * Pass along the previous exception in the event subscriber + * Make `activity:get --property description` return HTML + * Assume activity state is 'in progress' while reading the log + +------------------------------------------------------------------- Old: ---- platformsh-cli-3.48.0.tar.xz New: ---- platformsh-cli-3.48.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ platformsh-cli.spec ++++++ --- /var/tmp/diff_new_pack.CMxgs7/_old 2019-09-26 20:41:19.090529003 +0200 +++ /var/tmp/diff_new_pack.CMxgs7/_new 2019-09-26 20:41:19.094528992 +0200 @@ -17,7 +17,7 @@ Name: platformsh-cli -Version: 3.48.0 +Version: 3.48.1 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.CMxgs7/_old 2019-09-26 20:41:19.126528907 +0200 +++ /var/tmp/diff_new_pack.CMxgs7/_new 2019-09-26 20:41:19.126528907 +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.48.0</param> + <param name="revision">refs/tags/v3.48.1</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.CMxgs7/_old 2019-09-26 20:41:19.146528853 +0200 +++ /var/tmp/diff_new_pack.CMxgs7/_new 2019-09-26 20:41:19.146528853 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> - <param name="changesrevision">c64df424857511299deb42aa582df794f98050dd</param> + <param name="changesrevision">3f960466bf40dcdd444bd86c42eee4ebefb8c68f</param> </service> </servicedata> ++++++ platformsh-cli-3.48.0.tar.xz -> platformsh-cli-3.48.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/dist/manifest.json new/platformsh-cli-3.48.1/dist/manifest.json --- old/platformsh-cli-3.48.0/dist/manifest.json 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/dist/manifest.json 2019-09-25 15:03:55.000000000 +0200 @@ -17,10 +17,10 @@ }, { "name": "platform.phar", - "sha1": "ddabbe3dbc750b98a0d1967dd5cc672d05f2f78d", - "sha256": "b74bb0fa52d3681685dccc9733099d3f82640134f2c216160b86832affa6bcf2", - "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.48.0/platform.phar", - "version": "3.48.0", + "sha1": "9daaba6fdf5c7dd49c29e625eb7780242be15884", + "sha256": "0cb0494695ce00567aeca984d43699d653dab0525671b72c38fb9cc5f08aba6f", + "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.48.1/platform.phar", + "version": "3.48.1", "php": { "min": "5.5.9" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Command/Activity/ActivityGetCommand.php new/platformsh-cli-3.48.1/src/Command/Activity/ActivityGetCommand.php --- old/platformsh-cli-3.48.0/src/Command/Activity/ActivityGetCommand.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Command/Activity/ActivityGetCommand.php 2019-09-25 15:03:55.000000000 +0200 @@ -70,10 +70,7 @@ if (!$input->getOption('property') && !$table->formatIsMachineReadable()) { $properties['description'] = ActivityMonitor::getFormattedDescription($activity, true); } else { - $properties['description'] = ActivityMonitor::getFormattedDescription($activity, false); - if ($input->getOption('property')) { - $properties['description_html'] = $activity->description; - } + $properties['description'] = $activity->description; } // Add the fake "duration" property. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Command/CommandBase.php new/platformsh-cli-3.48.1/src/Command/CommandBase.php --- old/platformsh-cli-3.48.0/src/Command/CommandBase.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Command/CommandBase.php 2019-09-25 15:03:55.000000000 +0200 @@ -289,10 +289,8 @@ // Ensure classes are auto-loaded if they may be needed after the // update. - /** @var \Platformsh\Cli\Service\Shell $shell */ - $shell = $this->getService('shell'); - /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ - $questionHelper = $this->getService('question_helper'); + $this->getService('question_helper'); + $this->getService('shell'); $currentVersion = $this->config()->get('application.version'); /** @var \Platformsh\Cli\Service\SelfUpdater $cliUpdater */ @@ -313,32 +311,56 @@ $state->set('updates.last_checked', $timestamp); - // If the update was successful, and it's not a major version change, - // then prompt the user to continue after updating. if ($newVersion !== false) { - $exitCode = 0; - list($currentMajorVersion,) = explode('.', $currentVersion, 2); - list($newMajorVersion,) = explode('.', $newVersion, 2); - if ($newMajorVersion === $currentMajorVersion - && isset($this->input) - && $this->input instanceof ArgvInput - && is_executable($pharFilename)) { - $originalCommand = $this->input->__toString(); - $questionText = "\n" - . 'Original command: <info>' . $originalCommand . '</info>' - . "\n\n" . 'Continue?'; - if ($questionHelper->confirm($questionText)) { - $this->stdErr->writeln(''); - $exitCode = $shell->executeSimple(escapeshellarg($pharFilename) . ' ' . $originalCommand); - } - } - exit($exitCode); + $this->continueAfterUpdating($currentVersion, $newVersion, $pharFilename); } $this->stdErr->writeln(''); } /** + * Prompts the user to continue with the original command after updating. + * + * This only applies if it's not a major version change. + * + * @param string $currentVersion + * @param string $newVersion + * @param string $pharFilename + * + * @return void + */ + private function continueAfterUpdating($currentVersion, $newVersion, $pharFilename) { + if (!isset($this->input) || !$this->input instanceof ArgvInput || !is_executable($pharFilename)) { + return; + } + list($currentMajorVersion,) = explode('.', $currentVersion, 2); + list($newMajorVersion,) = explode('.', $newVersion, 2); + if ($newMajorVersion !== $currentMajorVersion) { + return; + } + + /** @var \Platformsh\Cli\Service\Shell $shell */ + $shell = $this->getService('shell'); + + $originalCommand = $this->input->__toString(); + if (empty($originalCommand)) { + $exitCode = $shell->executeSimple(escapeshellarg($pharFilename)); + exit($exitCode); + } + + /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */ + $questionHelper = $this->getService('question_helper'); + $questionText = "\n" + . 'Original command: <info>' . $originalCommand . '</info>' + . "\n\n" . 'Continue?'; + if ($questionHelper->confirm($questionText)) { + $this->stdErr->writeln(''); + $exitCode = $shell->executeSimple(escapeshellarg($pharFilename) . ' ' . $originalCommand); + exit($exitCode); + } + } + + /** * Log in the user. * * This is called via the 'login_required' event. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Command/Environment/EnvironmentPushCommand.php new/platformsh-cli-3.48.1/src/Command/Environment/EnvironmentPushCommand.php --- old/platformsh-cli-3.48.0/src/Command/Environment/EnvironmentPushCommand.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Command/Environment/EnvironmentPushCommand.php 2019-09-25 15:03:55.000000000 +0200 @@ -116,7 +116,7 @@ } // Determine whether to activate the environment after pushing. - if ($targetEnvironment && $targetEnvironment->status === 'inactive') { + if (!$targetEnvironment || ($targetEnvironment && $targetEnvironment->status === 'inactive')) { $activate = $input->getOption('activate') || ($input->isInteractive() && $questionHelper->confirm(sprintf( 'Activate <info>%s</info> after pushing?', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Console/EventSubscriber.php new/platformsh-cli-3.48.1/src/Console/EventSubscriber.php --- old/platformsh-cli-3.48.0/src/Console/EventSubscriber.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Console/EventSubscriber.php 2019-09-25 15:03:55.000000000 +0200 @@ -52,7 +52,7 @@ $event->setException(new ConnectionFailedException( "Failed to connect to host: " . $request->getHost() . " \nPlease check your Internet connection.", - $request + $exception )); $event->stopPropagation(); } @@ -62,8 +62,7 @@ && ($response = $exception->getResponse())) { $request = $exception->getRequest(); $requestConfig = $request->getConfig(); - $response->getBody()->seek(0); - $json = (array) json_decode($response->getBody()->getContents(), true); + $json = (array) json_decode($response->getBody()->__toString(), true); // Create a friendlier message for the OAuth2 "Invalid refresh token" // error. @@ -72,28 +71,25 @@ && $json['error_description'] === 'Invalid refresh token') { $event->setException(new LoginRequiredException( 'Invalid refresh token.', - $request, - $response, - $this->config + $this->config, + $exception )); $event->stopPropagation(); } elseif ($response->getStatusCode() === 401 && $requestConfig['auth'] === 'oauth2') { $event->setException(new LoginRequiredException( 'Unauthorized.', - $request, - $response, - $this->config + $this->config, + $exception )); $event->stopPropagation(); } elseif ($response->getStatusCode() === 403 && $requestConfig['auth'] === 'oauth2') { $event->setException(new PermissionDeniedException( "Permission denied. Check your project or environment permissions.", - $request, - $response + $exception )); $event->stopPropagation(); } else { - $event->setException(new HttpException(null, $request, $response)); + $event->setException(new HttpException(null, $exception)); $event->stopPropagation(); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Exception/HttpException.php new/platformsh-cli-3.48.1/src/Exception/HttpException.php --- old/platformsh-cli-3.48.0/src/Exception/HttpException.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Exception/HttpException.php 2019-09-25 15:03:55.000000000 +0200 @@ -2,30 +2,16 @@ namespace Platformsh\Cli\Exception; -use GuzzleHttp\Message\RequestInterface; -use GuzzleHttp\Message\ResponseInterface; -use Platformsh\Client\Exception\ApiResponseException; - class HttpException extends \RuntimeException { - protected $message = 'An API error occurred.'; - /** - * @param string $message - * @param RequestInterface $request - * @param ResponseInterface $response + * @param string|null $message + * @param \Throwable|null $previous */ - public function __construct($message = null, RequestInterface $request = null, ResponseInterface $response = null) + public function __construct($message = null, $previous = null) { - $message = $message ?: $this->message; - if ($request !== null && $response !== null) { - $details = "[url] " . $request->getUrl(); - $details .= " [status code] " . $response->getStatusCode(); - $details .= " [reason phrase] " . $response->getReasonPhrase(); - $details .= ApiResponseException::getErrorDetails($response); - $message .= "\n\nDetails:\n" . wordwrap(trim($details)); - } + $message = $message ?: 'An HTTP error occurred'; - parent::__construct($message, $this->code); + parent::__construct($message, $this->code, $previous); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Exception/LoginRequiredException.php new/platformsh-cli-3.48.1/src/Exception/LoginRequiredException.php --- old/platformsh-cli-3.48.0/src/Exception/LoginRequiredException.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Exception/LoginRequiredException.php 2019-09-25 15:03:55.000000000 +0200 @@ -2,8 +2,6 @@ namespace Platformsh\Cli\Exception; -use GuzzleHttp\Message\RequestInterface; -use GuzzleHttp\Message\ResponseInterface; use Platformsh\Cli\Service\Config; class LoginRequiredException extends HttpException @@ -14,9 +12,8 @@ public function __construct( $message = null, - RequestInterface $request = null, - ResponseInterface $response = null, - Config $config = null) + Config $config = null, + $previous = null) { $message = $message ?: $this->message; $this->config = $config ?: new Config(); @@ -26,7 +23,7 @@ $message .= "\n\n" . $aHelp; } - parent::__construct($message, $request, $response); + parent::__construct($message, $previous); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.48.0/src/Service/ActivityMonitor.php new/platformsh-cli-3.48.1/src/Service/ActivityMonitor.php --- old/platformsh-cli-3.48.0/src/Service/ActivityMonitor.php 2019-09-22 00:53:23.000000000 +0200 +++ new/platformsh-cli-3.48.1/src/Service/ActivityMonitor.php 2019-09-25 15:03:55.000000000 +0200 @@ -87,8 +87,9 @@ // The progress bar will show elapsed time and the activity's state. $bar = $this->newProgressBar($stdErr); - $bar->setPlaceholderFormatterDefinition('state', function () use ($activity) { - return $this->formatState($activity->state); + $overrideState = ''; + $bar->setPlaceholderFormatterDefinition('state', function () use ($activity, &$overrideState) { + return $this->formatState($overrideState ?: $activity->state); }); $startTime = $this->getStart($activity) ?: time(); $bar->setPlaceholderFormatterDefinition('elapsed', function () use ($startTime) { @@ -108,6 +109,7 @@ // to do, then refresh the activity. if (feof($logStream) || microtime(true) - $lastRefresh >= $pollInterval) { $activity->refresh(); + $overrideState = ''; $lastRefresh = microtime(true); } @@ -126,6 +128,11 @@ continue; } + // If there is log output, assume the activity must be in progress. + if ($activity->state === Activity::STATE_PENDING) { + $overrideState = Activity::STATE_IN_PROGRESS; + } + // Format log items. $formatted = $this->formatLog($items, $timestamps); ++++++ 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-09-22 23:10:06.207179283 +0200 +++ new/vendor/autoload.php 2019-09-25 18:34:23.822431623 +0200 @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit98e26c02a670366c2914a5212c64b8a6::getLoader(); +return ComposerAutoloaderInit05f10ad0f1b923b7e835bf4d88be530b::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-09-22 23:10:06.207179283 +0200 +++ new/vendor/composer/autoload_real.php 2019-09-25 18:34:23.822431623 +0200 @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit98e26c02a670366c2914a5212c64b8a6 +class ComposerAutoloaderInit05f10ad0f1b923b7e835bf4d88be530b { private static $loader; @@ -19,15 +19,15 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit98e26c02a670366c2914a5212c64b8a6', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit05f10ad0f1b923b7e835bf4d88be530b', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit98e26c02a670366c2914a5212c64b8a6', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit05f10ad0f1b923b7e835bf4d88be530b', '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\ComposerStaticInit98e26c02a670366c2914a5212c64b8a6::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b::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\ComposerStaticInit98e26c02a670366c2914a5212c64b8a6::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire98e26c02a670366c2914a5212c64b8a6($fileIdentifier, $file); + composerRequire05f10ad0f1b923b7e835bf4d88be530b($fileIdentifier, $file); } return $loader; } } -function composerRequire98e26c02a670366c2914a5212c64b8a6($fileIdentifier, $file) +function composerRequire05f10ad0f1b923b7e835bf4d88be530b($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-09-22 23:10:06.207179283 +0200 +++ new/vendor/composer/autoload_static.php 2019-09-25 18:34:23.822431623 +0200 @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit98e26c02a670366c2914a5212c64b8a6 +class ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b { 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 = ComposerStaticInit98e26c02a670366c2914a5212c64b8a6::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit98e26c02a670366c2914a5212c64b8a6::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit98e26c02a670366c2914a5212c64b8a6::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit05f10ad0f1b923b7e835bf4d88be530b::$classMap; }, null, ClassLoader::class); }
