From 4469abaac1d38a7fef3cf69b78c7042371f2905d Mon Sep 17 00:00:00 2001 From: Sara McCutcheon Date: Wed, 20 Feb 2019 11:26:56 -0800 Subject: [PATCH] [AL-1762] - Advance version to 2.0.0 (#1954) * Updated to version 2.0.0 * Fixed unreachable-logger error when plugins are outdated * Incremented version number to 2.0.0 --- CHANGELOG.md | 2 +- composer.lock | 52 ++++++++++++++----- config/constants.yml | 2 +- src/Terminus.php | 4 +- tests/features/plugins.feature | 7 +++ .../no-namespace/plugin-example/composer.json | 2 +- .../outdated/plugin-example/composer.json | 11 ++++ .../src/HasBaseClassCommand.php | 28 ++++++++++ .../plugin-example/src/HelloCommand.php | 22 ++++++++ .../src/PluginProvidedBaseClass.php | 20 +++++++ .../plugin-example/composer.json | 2 +- .../plugin-example/composer.json | 2 +- 12 files changed, 135 insertions(+), 19 deletions(-) create mode 100644 tests/fixtures/functional/plugins/outdated/plugin-example/composer.json create mode 100644 tests/fixtures/functional/plugins/outdated/plugin-example/src/HasBaseClassCommand.php create mode 100644 tests/fixtures/functional/plugins/outdated/plugin-example/src/HelloCommand.php create mode 100644 tests/fixtures/functional/plugins/outdated/plugin-example/src/PluginProvidedBaseClass.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c8be1b30b..f6131850d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org) -## MASTER +## 2.0.0 - 2019-02-20 ### Added - New `plan:list` command lists the plans available to a site. (#1901) - New `plan:set` command sets a site's plan. (#1901) diff --git a/composer.lock b/composer.lock index e8aa9da34..0b2398346 100644 --- a/composer.lock +++ b/composer.lock @@ -166,16 +166,16 @@ }, { "name": "consolidation/config", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/consolidation/config.git", - "reference": "925231dfff32f05b787e1fddb265e789b939cf4c" + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/config/zipball/925231dfff32f05b787e1fddb265e789b939cf4c", - "reference": "925231dfff32f05b787e1fddb265e789b939cf4c", + "url": "https://api.github.com/repos/consolidation/config/zipball/11ab7ecd19131ce084390171b9c070eedecf7dab", + "reference": "11ab7ecd19131ce084390171b9c070eedecf7dab", "shasum": "" }, "require": { @@ -184,9 +184,9 @@ "php": ">=5.4.0" }, "require-dev": { - "g1a/composer-test-scenarios": "^1", + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^1", "phpunit/phpunit": "^5", - "satooshi/php-coveralls": "^1.0", "squizlabs/php_codesniffer": "2.*", "symfony/console": "^2.5|^3|^4", "symfony/yaml": "^2.8.11|^3|^4" @@ -196,6 +196,33 @@ }, "type": "library", "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4.0" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + }, + "symfony2": { + "require-dev": { + "symfony/console": "^2.8", + "symfony/event-dispatcher": "^2.8", + "phpunit/phpunit": "^4.8.36" + }, + "remove": [ + "php-coveralls/php-coveralls" + ], + "config": { + "platform": { + "php": "5.4.8" + } + } + } + }, "branch-alias": { "dev-master": "1.x-dev" } @@ -216,7 +243,7 @@ } ], "description": "Provide configuration services for a commandline tool.", - "time": "2018-10-24T17:55:35+00:00" + "time": "2019-02-16T01:18:47+00:00" }, { "name": "consolidation/log", @@ -366,16 +393,16 @@ }, { "name": "consolidation/robo", - "version": "1.4.4", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "8bec6a6ea54a7d03d56552a4250c49dec3b3083d" + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/8bec6a6ea54a7d03d56552a4250c49dec3b3083d", - "reference": "8bec6a6ea54a7d03d56552a4250c49dec3b3083d", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", + "reference": "d4805a1abbc730e9a6d64ede2eba56f91a2b4eb3", "shasum": "" }, "require": { @@ -470,7 +497,7 @@ } ], "description": "Modern task runner", - "time": "2019-02-08T20:59:23+00:00" + "time": "2019-02-17T05:32:27+00:00" }, { "name": "consolidation/self-update", @@ -2975,6 +3002,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, { diff --git a/config/constants.yml b/config/constants.yml index 2bcca5488..6222ba9ea 100644 --- a/config/constants.yml +++ b/config/constants.yml @@ -7,7 +7,7 @@ --- # App -TERMINUS_VERSION: '1.9.1-dev' +TERMINUS_VERSION: '2.0.0' # Connectivity TERMINUS_HOST: 'terminus.pantheon.io' diff --git a/src/Terminus.php b/src/Terminus.php index 90a7cc3a7..bb2b2f422 100644 --- a/src/Terminus.php +++ b/src/Terminus.php @@ -75,6 +75,8 @@ public function __construct(Config $config, InputInterface $input = null, Output $this->configureContainer(); + $this->setLogger($container->get('logger')); + $this->addBuiltInCommandsAndHooks(); $this->addPluginsCommandsAndHooks(); @@ -86,8 +88,6 @@ public function __construct(Config $config, InputInterface $input = null, Output $this->runner = new RoboRunner(); $this->runner->setContainer($container); - $this->setLogger($container->get('logger')); - date_default_timezone_set($config->get('time_zone')); setlocale(LC_MONETARY, $config->get('monetary_locale')); } diff --git a/tests/features/plugins.feature b/tests/features/plugins.feature index 95abb572b..7f252defe 100644 --- a/tests/features/plugins.feature +++ b/tests/features/plugins.feature @@ -53,5 +53,12 @@ Feature: Plugin Commands [notice] Hello, yd! """ + Scenario: Running a simple plugin command that needs autoloading for its base class + When I am using "outdated" plugins + And I run "terminus global:hello" + Then I should get: + """ + [warning] Could not load plugin pantheon-systems/terminus-plugin-example because it is not compatible with this version of Terminus. + """ diff --git a/tests/fixtures/functional/plugins/no-namespace/plugin-example/composer.json b/tests/fixtures/functional/plugins/no-namespace/plugin-example/composer.json index 229282008..6aa75c007 100644 --- a/tests/fixtures/functional/plugins/no-namespace/plugin-example/composer.json +++ b/tests/fixtures/functional/plugins/no-namespace/plugin-example/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "extra": { "terminus": { - "compatible-version": "1.*" + "compatible-version": "2.*" } } } diff --git a/tests/fixtures/functional/plugins/outdated/plugin-example/composer.json b/tests/fixtures/functional/plugins/outdated/plugin-example/composer.json new file mode 100644 index 000000000..484002854 --- /dev/null +++ b/tests/fixtures/functional/plugins/outdated/plugin-example/composer.json @@ -0,0 +1,11 @@ +{ + "name": "pantheon-systems/terminus-plugin-example", + "description": "An example Terminus command", + "type": "terminus-plugin", + "license": "MIT", + "extra": { + "terminus": { + "compatible-version": "0.*" + } + } +} diff --git a/tests/fixtures/functional/plugins/outdated/plugin-example/src/HasBaseClassCommand.php b/tests/fixtures/functional/plugins/outdated/plugin-example/src/HasBaseClassCommand.php new file mode 100644 index 000000000..900a55551 --- /dev/null +++ b/tests/fixtures/functional/plugins/outdated/plugin-example/src/HasBaseClassCommand.php @@ -0,0 +1,28 @@ +whoToGreet(); + $this->log()->notice("Hello, $who!"); + } +} diff --git a/tests/fixtures/functional/plugins/outdated/plugin-example/src/HelloCommand.php b/tests/fixtures/functional/plugins/outdated/plugin-example/src/HelloCommand.php new file mode 100644 index 000000000..6bd8fff6a --- /dev/null +++ b/tests/fixtures/functional/plugins/outdated/plugin-example/src/HelloCommand.php @@ -0,0 +1,22 @@ +log()->notice("Hello, World!"); + } +} diff --git a/tests/fixtures/functional/plugins/outdated/plugin-example/src/PluginProvidedBaseClass.php b/tests/fixtures/functional/plugins/outdated/plugin-example/src/PluginProvidedBaseClass.php new file mode 100644 index 000000000..a98b90cbd --- /dev/null +++ b/tests/fixtures/functional/plugins/outdated/plugin-example/src/PluginProvidedBaseClass.php @@ -0,0 +1,20 @@ +