Hello community,
here is the log from the commit of package platformsh-cli for openSUSE:Factory checked in at 2019-02-17 12:21:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/platformsh-cli (Old)
and /work/SRC/openSUSE:Factory/.platformsh-cli.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli"
Sun Feb 17 12:21:27 2019 rev:62 rq:676595 version:3.40.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/platformsh-cli/platformsh-cli.changes 2019-01-21 11:02:29.767109127 +0100
+++ /work/SRC/openSUSE:Factory/.platformsh-cli.new.28833/platformsh-cli.changes 2019-02-17 12:21:28.120198452 +0100
@@ -1,0 +2,19 @@
+Fri Feb 15 18:10:44 UTC 2019 - jimmy@boombatower.com
+
+- Update to version 3.40.0:
+ * Release v3.40.0
+ * Use a different Drush alias root for site-local versions 8 or 9 (#777)
+ * Fix non-interactive choice default handling
+ * Fix non-interactive choice questions with no default should return null instead of erroring
+ * Make db:size schema agnostic but warn about inaccessible schemas
+ * Filter schemas by endpoint privileges
+ * Present a choice between schemas
+ * Include the service name and schema in the dump filename
+ * Add --schema option to db:dump and db:sql
+ * Always include a line break after choose()
+ * Fix checkout command when there is only one branch
+ * Fix Drush lock files not being used
+ * Add some 3-letter aliases
+ * Remove experimental "server" commands from README
+
+-------------------------------------------------------------------
Old:
----
platformsh-cli-3.39.0.tar.xz
New:
----
platformsh-cli-3.40.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ platformsh-cli.spec ++++++
--- /var/tmp/diff_new_pack.MWd1w3/_old 2019-02-17 12:21:28.892198240 +0100
+++ /var/tmp/diff_new_pack.MWd1w3/_new 2019-02-17 12:21:28.896198239 +0100
@@ -17,7 +17,7 @@
Name: platformsh-cli
-Version: 3.39.0
+Version: 3.40.0
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.MWd1w3/_old 2019-02-17 12:21:28.928198230 +0100
+++ /var/tmp/diff_new_pack.MWd1w3/_new 2019-02-17 12:21:28.932198229 +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.39.0</param>
+ <param name="revision">refs/tags/v3.40.0</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.MWd1w3/_old 2019-02-17 12:21:28.948198224 +0100
+++ /var/tmp/diff_new_pack.MWd1w3/_new 2019-02-17 12:21:28.952198224 +0100
@@ -1,6 +1,6 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/platformsh/platformsh-cli.git</param>
- <param name="changesrevision">d0dd97e777b3c7b2fe5432004477ef3eb9f44fcf</param>
+ <param name="changesrevision">4d5f7dcd1eefbbf3473e0b7f091623cd7d83d355</param>
</service>
</servicedata>
++++++ platformsh-cli-3.39.0.tar.xz -> platformsh-cli-3.40.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/README.md new/platformsh-cli-3.40.0/README.md
--- old/platformsh-cli-3.39.0/README.md 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/README.md 2019-02-15 17:37:35.000000000 +0100
@@ -81,7 +81,7 @@
web Open the Web UI
activity
activity:get View detailed information on a single activity
- activity:list (activities) Get a list of activities for an environment or project
+ activity:list (activities, act) Get a list of activities for an environment or project
activity:log Display the log for an activity
app
app:config-get View the configuration of an app
@@ -117,7 +117,7 @@
environment:drush (drush) Run a drush command on the remote environment
environment:http-access (httpaccess) Update HTTP access settings for an environment
environment:info Read or set properties for an environment
- environment:list (environments) Get a list of environments
+ environment:list (environments, env) Get a list of environments
environment:logs (log) Read an environment's logs
environment:merge (merge) Merge an environment
environment:push (push) Push code to an environment
@@ -148,7 +148,7 @@
project:delete Delete a project
project:get (get) Clone a project locally
project:info Read or set properties for a project
- project:list (projects) Get a list of all active projects
+ project:list (projects, pro) Get a list of all active projects
project:set-remote Set the remote project for the current Git repository
repo
repo:cat Read a file in the project repository
@@ -159,11 +159,6 @@
self
self:install Install or update CLI configuration files
self:update (self-update) Update the CLI to the latest version
-server
- server:list (servers) List running local project web server(s)
- server:run Run a local PHP web server
- server:start Run PHP web server(s) for the local project
- server:stop Stop local project web server(s)
service
service:list (services) List services in the project
service:mongo:dump (mongodump) Create a binary archive dump of data from MongoDB
@@ -195,7 +190,7 @@
variable:create Create a variable
variable:delete Delete a variable
variable:get (vget) View a variable
- variable:list (variables) List variables
+ variable:list (variables, var) List variables
variable:update Update a variable
worker
worker:list (workers) Get a list of all deployed workers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/config.yaml new/platformsh-cli-3.40.0/config.yaml
--- old/platformsh-cli-3.39.0/config.yaml 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/config.yaml 2019-02-15 17:37:35.000000000 +0100
@@ -1,7 +1,7 @@
# Metadata about the CLI application itself.
application:
name: 'Platform.sh CLI'
- version: '3.39.0'
+ version: '3.40.0'
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.39.0/dist/manifest.json new/platformsh-cli-3.40.0/dist/manifest.json
--- old/platformsh-cli-3.39.0/dist/manifest.json 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/dist/manifest.json 2019-02-15 17:37:35.000000000 +0100
@@ -1,10 +1,10 @@
[
{
"name": "platform.phar",
- "sha1": "a522451e18a9aa6d50c93b76903e13efd7a4c9a6",
- "sha256": "f764ee7f83e659276e2876e3b80fda134045ab2ed9192d7f8574f2d56d559b28",
- "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.39.0/platf...",
- "version": "3.39.0",
+ "sha1": "72d7a75476e28557e49fbd14c1fd3265075a0891",
+ "sha256": "9d48efeff8ecfa4a0eea0826c6df8dba12827b8f3e9af0f3aa14b2bff299c420",
+ "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.40.0/platf...",
+ "version": "3.40.0",
"php": {
"min": "5.5.9"
},
@@ -167,6 +167,11 @@
"notes": "New features:\n\n* Add tunnel:single command (allow opening a tunnel without posix/pcntl).\n\nBug fixes:\n\n* Fix bug where login to a new account does not log out from the old account.\n* Account for differing app roots in Drush aliases - allows generated Drush\n aliases to work with Platform.sh Enterprise environments.\n* Fix Drush 9 alias compatibility (and remove Drush 9-beta compatibility).",
"show from": "3.38.0",
"hide from": "3.39.0"
+ },
+ {
+ "notes": "New features:\n\n* Support multiple schemas per database relationship:\n - Add --schema option to `db:dump` and `db:sql` commands.\n - Include the service name and schema in the `db:dump` default filename.\n - Present a choice between schemas if no schema is specified.\n - Make `db:size` schema agnostic but warn about inaccessible schemas.\n\nBug fixes:\n\n* Use a different Drush alias root for site-local versions 8 or 9. Drush 9\n fails to find a Drupal root via a relative path in some circumstances.\n* Fix behavior of choice questions with no default in non-interactive mode.\n* Fix checkout command when there is only one branch.\n* Fix Drush lock files not being used in local:build command.\n\nOther changes:\n\n* Add some 3-letter command aliases:\n - activity:list => activities => act\n - environment:list => environments => env\n - project:list => projects => pro\n - variable:list => variables => var",
+ "show from": "3.39.0",
+ "hide from": "3.40.0"
}
]
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/src/Command/Activity/ActivityListCommand.php new/platformsh-cli-3.40.0/src/Command/Activity/ActivityListCommand.php
--- old/platformsh-cli-3.39.0/src/Command/Activity/ActivityListCommand.php 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/src/Command/Activity/ActivityListCommand.php 2019-02-15 17:37:35.000000000 +0100
@@ -19,7 +19,7 @@
{
$this
->setName('activity:list')
- ->setAliases(['activities'])
+ ->setAliases(['activities', 'act'])
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Filter activities by type')
->addOption('limit', null, InputOption::VALUE_REQUIRED, 'Limit the number of results displayed', 10)
->addOption('start', null, InputOption::VALUE_REQUIRED, 'Only activities created before this date will be listed')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/src/Command/CommandBase.php new/platformsh-cli-3.40.0/src/Command/CommandBase.php
--- old/platformsh-cli-3.39.0/src/Command/CommandBase.php 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/src/Command/CommandBase.php 2019-02-15 17:37:35.000000000 +0100
@@ -877,8 +877,6 @@
$id = $questionHelper->choose($projectList, $text, null, false);
- $this->stdErr->writeln('');
-
return $id;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/src/Command/Db/DbDumpCommand.php new/platformsh-cli-3.40.0/src/Command/Db/DbDumpCommand.php
--- old/platformsh-cli-3.39.0/src/Command/Db/DbDumpCommand.php 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/src/Command/Db/DbDumpCommand.php 2019-02-15 17:37:35.000000000 +0100
@@ -18,7 +18,8 @@
{
$this->setName('db:dump')
->setDescription('Create a local dump of the remote database');
- $this->addOption('file', 'f', InputOption::VALUE_REQUIRED, 'A custom filename for the dump')
+ $this->addOption('schema', null, InputOption::VALUE_REQUIRED, 'The schema to dump. Omit to use the default schema (usually "main").')
+ ->addOption('file', 'f', InputOption::VALUE_REQUIRED, 'A custom filename for the dump')
->addOption('directory', 'd', InputOption::VALUE_REQUIRED, 'A custom directory for the dump')
->addOption('gzip', 'z', InputOption::VALUE_NONE, 'Compress the dump using gzip')
->addOption('timestamp', 't', InputOption::VALUE_NONE, 'Add a timestamp to the dump filename')
@@ -50,6 +51,59 @@
/** @var \Platformsh\Cli\Service\Filesystem $fs */
$fs = $this->getService('fs');
+ /** @var \Platformsh\Cli\Service\Relationships $relationships */
+ $relationships = $this->getService('relationships');
+
+ /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
+ $questionHelper = $this->getService('question_helper');
+
+ $database = $relationships->chooseDatabase($sshUrl, $input, $output);
+ if (empty($database)) {
+ return 1;
+ }
+
+ $schema = $input->getOption('schema');
+ if (empty($schema)) {
+ // Get information about the deployed service associated with the
+ // selected relationship.
+ $deployment = $this->api()->getCurrentDeployment($environment);
+ $service = $deployment->getService($database['service']);
+
+ // Get a list of schemas from the service configuration.
+ $schemas = !empty($service->configuration['schemas'])
+ ? $service->configuration['schemas']
+ : ['main'];
+
+ // Filter the list by the schemas accessible from the endpoint.
+ if (isset($database['rel'])
+ && isset($service->configuration['endpoints'][$database['rel']]['privileges'])) {
+ $schemas = array_intersect(
+ $schemas,
+ array_keys($service->configuration['endpoints'][$database['rel']]['privileges'])
+ );
+ }
+
+ // Provide the user with a choice of schemas.
+ $choices = [];
+ foreach ($schemas as $schema) {
+ $choices[$schema] = $schema;
+ if ($schema === $database['path']) {
+ $choices[$schema] .= ' (default)';
+ }
+ }
+ /** @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);
+ if (empty($schema)) {
+ $this->stdErr->writeln('The --schema is required.');
+ if (!empty($schemas)) {
+ $this->stdErr->writeln('Available schemas: ' . implode(', ', $schemas));
+ }
+
+ return 1;
+ }
+ }
+
$dumpFile = null;
if (!$input->getOption('stdout')) {
// Process the user --file option.
@@ -69,7 +123,8 @@
} else {
$defaultFilename = $this->getDefaultFilename(
$environment,
- $appName,
+ $database['service'],
+ $schema,
$includedTables,
$excludedTables,
$schemaOnly,
@@ -107,8 +162,6 @@
if ($dumpFile) {
if (file_exists($dumpFile)) {
- /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
- $questionHelper = $this->getService('question_helper');
if (!$questionHelper->confirm("File exists: <comment>$dumpFile</comment>. Overwrite?", false)) {
return 1;
}
@@ -120,17 +173,9 @@
));
}
- /** @var \Platformsh\Cli\Service\Relationships $relationships */
- $relationships = $this->getService('relationships');
-
- $database = $relationships->chooseDatabase($sshUrl, $input, $output);
- if (empty($database)) {
- return 1;
- }
-
switch ($database['scheme']) {
case 'pgsql':
- $dumpCommand = 'pg_dump --no-owner --clean --blobs ' . $relationships->getDbCommandArgs('pg_dump', $database);
+ $dumpCommand = 'pg_dump --no-owner --clean --blobs ' . $relationships->getDbCommandArgs('pg_dump', $database, $schema);
if ($schemaOnly) {
$dumpCommand .= ' --schema-only';
}
@@ -144,7 +189,7 @@
default:
$dumpCommand = 'mysqldump --single-transaction '
- . $relationships->getDbCommandArgs('mysqldump', $database);
+ . $relationships->getDbCommandArgs('mysqldump', $database, $schema);
if ($schemaOnly) {
$dumpCommand .= ' --no-data';
}
@@ -223,7 +268,8 @@
* Get the default dump filename.
*
* @param Environment $environment
- * @param string|null $appName
+ * @param string|null $dbServiceName
+ * @param string|null $schema
* @param array $includedTables
* @param array $excludedTables
* @param bool $schemaOnly
@@ -233,15 +279,19 @@
*/
private function getDefaultFilename(
Environment $environment,
- $appName = null,
+ $dbServiceName = null,
+ $schema = null,
array $includedTables = [],
array $excludedTables = [],
$schemaOnly = false,
$gzip = false)
{
$defaultFilename = $environment->project . '--' . $environment->machine_name;
- if ($appName !== null) {
- $defaultFilename .= '--' . $appName;
+ if ($dbServiceName !== null) {
+ $defaultFilename .= '--' . $dbServiceName;
+ }
+ if ($schema !== null) {
+ $defaultFilename .= '--' . $schema;
}
if ($includedTables) {
$defaultFilename .= '--' . implode(',', $includedTables);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.39.0/src/Command/Db/DbSizeCommand.php new/platformsh-cli-3.40.0/src/Command/Db/DbSizeCommand.php
--- old/platformsh-cli-3.39.0/src/Command/Db/DbSizeCommand.php 2019-01-18 12:39:27.000000000 +0100
+++ new/platformsh-cli-3.40.0/src/Command/Db/DbSizeCommand.php 2019-02-15 17:37:35.000000000 +0100
@@ -53,34 +53,19 @@
return 1;
}
- // Find the database's service name in the relationships.
- $dbServiceName = false;
- foreach ($appConfig['relationships'] as $relationshipName => $relationship) {
- if ($database['_relationship_name'] === $relationshipName) {
- list($dbServiceName,) = explode(':', $relationship, 2);
- break;
- }
- }
- if (!$dbServiceName) {
- $this->stdErr->writeln('Service name not found for relationship: ' . $database['_relationship_name']);
- return 1;
- }
-
- // Load services yaml.
- $services = $this->getProjectServiceConfig();
- if (!empty($services[$dbServiceName]['disk'])) {
- $allocatedDisk = $services[$dbServiceName]['disk'];
- } else {
- $this->stdErr->writeln('The allocated disk size could not be determined for service: <comment>' . $dbServiceName . '</comment>');
- $allocatedDisk = false;
- }
+ // Get information about the deployed service associated with the
+ // selected relationship.
+ $deployment = $this->api()->getCurrentDeployment($this->getSelectedEnvironment());
+ $dbServiceName = $database['service'];
+ $service = $deployment->getService($dbServiceName);
+ $allocatedDisk = $service->disk;
/** @var Shell $shell */
$shell = $this->getService('shell');
/** @var \Platformsh\Cli\Service\Ssh $ssh */
$ssh = $this->getService('ssh');
- $this->stdErr->writeln('Checking database <comment>' . $dbServiceName . '</comment>...');
+ $this->stdErr->writeln(sprintf('Checking database service <comment>%s</comment>...', $dbServiceName));
$command = ['ssh'];
$command = array_merge($command, $ssh->getSshArgs());
@@ -123,6 +108,23 @@
$this->stdErr->writeln('