Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cloud:config command to display encoded variables #486

Conversation

@vkerkhoff
Copy link
Contributor

commented May 7, 2019

Description

This command displays the base64 encoded cloud environment variables data in a friendly printed output.

./vendor/bin/ece-tools cloud:config command has the option to display the following variables:

services - Displays the relationship data from MAGENTO_CLOUD_RELATIONSHIPS environment variable that is configured thru the services.yaml file.
routes - Displays the routes configured for the project (displayed from MAGENTO_CLOUD_ROUTES environment variable)
variables - Displays the configured variables for the project (from MAGENTO_CLOUD_VARIABLES)

Fixed Issues (if relevant)

  1. #473: Add Command to Display Values from Encoded Environment Variables
    Link in Jira

Manual testing scenarios

Run the command vendor/bin/ece-tools cloud:config, optionally it's possible to display the configured services, routes and variables:

Example variables:
Screenshot 2019-05-07 at 13 18 05

Example routes:
Screenshot 2019-05-07 at 13 20 15

Example services (relationships):
Screenshot 2019-05-07 at 13 20 55

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

vkerkhoff added some commits Dec 12, 2018

@vkerkhoff vkerkhoff force-pushed the vkerkhoff:feature/ECETOOLS-473-display-encoded-variables branch from 87bea31 to d01ba1e May 7, 2019

Added cloud:config command
This command displays the base64 encoded cloud environment variables data in a friendly printed output.

./vendor/bin/ece-tools cloud:config command has the option to display the following variables:

services - Displays the relationship data from MAGENTO_CLOUD_RELATIONSHIPS environment variable that is configures thru the services.yaml file.
routes - Displays the routes configured for the project (displayed from MAGENTO_CLOUD_ROUTES environment variable)
variables - Displays the configured variables for the project (from MAGENTO_CLOUD_VARIABLES)

Fixed codestyle to pass validation

Moved command execute call to seperate function

Fixed typo in function name

@vkerkhoff vkerkhoff force-pushed the vkerkhoff:feature/ECETOOLS-473-display-encoded-variables branch from ea93959 to 814f2a4 May 7, 2019

src/Process/CloudConfig.php Outdated Show resolved Hide resolved
src/Process/CloudConfig.php Outdated Show resolved Hide resolved
src/Command/CloudConfig.php Outdated Show resolved Hide resolved
src/Process/CloudConfig.php Outdated Show resolved Hide resolved

@YPyltiai YPyltiai added the review label May 7, 2019

@YPyltiai YPyltiai added this to Dev in progress in ECE-Tools Improvements via automation May 7, 2019

@vkerkhoff

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

Thanks, will look into the comments and apply the changes, will try to do this later today.

vkerkhoffpon and others added some commits May 8, 2019

vkerkhoffpon added some commits May 9, 2019

Merge branch 'feature/ECETOOLS-473-display-encoded-variables' of gith…
…ub.com:vkerkhoff/ece-tools into feature/ECETOOLS-473-display-encoded-variables
@oshmyheliuk

This comment has been minimized.

Copy link
Collaborator

commented May 13, 2019

@vkerkhoff PR looks fine, please cover the new functionality with Unit tests

@vkerkhoff

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

@oshmyheliuk Will do but will be next week as I'm at Imagine currently, already made a start with it last week.

@mveeramneni mveeramneni added the onhold label May 13, 2019

ECE-Tools Improvements automation moved this from Dev in progress to Review in progress Jun 4, 2019

*/
private $outputFormatterMock;
protected function setUp()

This comment has been minimized.

Copy link
@shiftedreality

shiftedreality Jun 4, 2019

Member

Please add @inheritdoc

->addArgument(
'variable',
InputArgument::IS_ARRAY,
"Environment variables to display, possible options: " . implode(',', $this->allowedVariables),

This comment has been minimized.

Copy link
@shiftedreality

shiftedreality Jun 4, 2019

Member

Please use single quotes

{
$output->writeln(PHP_EOL . "<info>{$title}:</info>");
$table = new Table($output);
$table

This comment has been minimized.

Copy link
@shiftedreality

shiftedreality Jun 4, 2019

Member

No newline needed

* @param $depth
* @return string
*/
protected function indentValue($name, $depth)

This comment has been minimized.

Copy link
@shiftedreality

shiftedreality Jun 4, 2019

Member

Please change protected to private on all new methods, protected modifier should not be used

*/
class ConfigShow extends Command
{
const NAME = 'config:show';

This comment has been minimized.

Copy link
@NadiyaS

NadiyaS Jun 4, 2019

Contributor

We have config:dump CLI command in ece-tools, where under the config we mean Magento configurations (ok, part of Magento configurations)
This command displays absolutely different configurations. So, just to avoid confusion, I would recommend to rename it.

This comment has been minimized.

Copy link
@YPyltiai

YPyltiai Jun 4, 2019

Contributor

@NadiyaS I'm fine with that. It can be something like cloud:config:show or similar

@NadiyaS

NadiyaS approved these changes Jun 6, 2019

@andriyShevtsov andriyShevtsov self-assigned this Jun 6, 2019

ECE-Tools Improvements automation moved this from Review in progress to QA in progress Jun 6, 2019

@shiftedreality shiftedreality added qa and removed review labels Jun 6, 2019

@andriyShevtsov

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2019

QA approved

@andriyShevtsov andriyShevtsov removed the qa label Jun 7, 2019

@andriyShevtsov andriyShevtsov removed their assignment Jun 7, 2019

@shiftedreality shiftedreality merged commit b37ac79 into magento:develop Jun 7, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
licence/cla Contributor License Agreement is signed.
Details

ECE-Tools Improvements automation moved this from QA in progress to Done Jun 7, 2019

@contribution-survey

This comment has been minimized.

Copy link

commented Jun 7, 2019

Hi @vkerkhoff, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@shiftedreality

This comment has been minimized.

Copy link
Member

commented Jun 7, 2019

@vkerkhoff thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.