Code Monkey home page Code Monkey logo

magento / ece-tools Goto Github PK

View Code? Open in Web Editor NEW
114.0 114.0 82.0 4.49 MB

All Submissions you make to Magento Inc. (“Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here: https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html

License: Open Software License 3.0

PHP 99.30% HTML 0.66% Smarty 0.04%

ece-tools's People

Contributors

andrewbess avatar andriyshevtsov avatar arhiopterecs avatar bados avatar bbatsche avatar billygilbert avatar buskamuza avatar bwaters avatar dhorytskyi avatar drpayyne avatar dshevtsov avatar dsikkema-magento avatar glo72880 avatar hguthrie avatar jabrown-magento-com avatar jacobbrownaustin avatar mazhalai avatar meker12 avatar michaelcasey316 avatar nadiyas avatar ngeron avatar oshmyheliuk avatar shiftedreality avatar sikharam-adb avatar sivaram7 avatar tomreece avatar viktym avatar vkerkhoff avatar vrann avatar xmav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ece-tools's Issues

[ECE-Tools] Change Description for Cron Kill Processes

Internal ID: MAGECLOUD-3653

Background:

  • Currently if cron kill process cannot find the cron, which was identified as running at the beginning of deploy phase, it throws an error, while it mostly means that cron manged to finish before process tried to kill it. Example:
[2019-05-21 09:30:21] INFO: There is an error during killing the cron processes: The command "kill 8165" failed.

       Exit Code: 1(General error)

       Working directory: /app/23wcrj3xapteu

       Output:
       ================


       Error Output:
       ================
       sh: 1: kill: No such process

To Do:

  • Change message to explain better the behavior instead of sending error, which is a result of some expected behavior of the cron

[ECE-Tools] Conditionally Execute setup:upgrade During Deployment

During deploy phase bin/magento setup:upgrade --keep-generated is executed every time. This increase time necessary for actual deployment.
Magento 2.2 introduce the command bin/magento setup:db:status to check whether an upgrade is required or not.

Couldn't add this check in vendor/magento/ece-tools/src/Process/Deploy/InstallUpdate/Update/Setup.php to reduce unnecessary maintenance time?

Furthermore: Wouldn't this allow to avoid maintenance mode if no DB updates are required?

[Cloud Docker] Changes in .magento.app.yaml should affect hooks

Internal ID: MAGECLOUD-3505

As Magento developer, I want Cloud Docker to support custom hooks configuration, so I can test hook-related functionality more effectively.

Background:

  • We currently run separate custom commands to build and deploy Magento.
  • We disregard custom hooks now and build using default hooks only

To Do:

  • Add support for configuring hooks locally via .magento.app.yaml
  • Consider adding one integrated command to run whole deployment cycle (build+deploy+post_deploy)

pub/static/.htaccess file is deleted by StaticContentCleaner

During deployment pub/static/.htaccess is deleted when SCD_ON_DEMAND=true is set. This is because the whole directory "static" is cleaned without any excludes.

Without the .htaccess file Apache doesn't generate the static content on the fly as intended by the SCD_ON_DEMAND setting.

Adding ".htaccess" to the exclude array would resolve this issue.

Refactor Shell Implementation

Internal ID: MAGECLOUD-3475

Summary

The current implementation of Shell does not expect to have non-zero output from the command. This affects few commands which can return different codes like setup:db:status.

Proposal

We should use Symfony/Process component which has very good support and structure:

// Shell/execute
        $process = new \Symfony\Component\Process\Process('some command');
        $process->mustRun();

        return $process;

// Some client code
        $process = $this->shell->execute('command');

        $code = $process->getExitCode();
        $output = $process->getOutput();

Our Shell will create an instance of Process and run it with mustRun(). The return value will be Process with the result or ShellException

[Cloud Docker] Use /var/www/ece-tools for source code

Internal ID: MAGECLOUD-3714

Background:

  • We initialize our Functional Testing Framework with
        $composerRequireTask = $this->taskComposerRequire('composer')
            ->dependency('magento/magento-cloud-metapackage', $version)
            ->workingDir($this->_getConfig('system_magento_dir'))
            ->noInteraction()
            ->option('--no-update');
  • This forces installation of ECE-Tools from repository.

To Do:

  • We should test install using current source code with path:
        "ece": {
            "type": "path",
            "url": "/var/www/ece/tools"
        },

[Cloud Docker] Changes in .magento.app.yaml should affect PHP extensions

Internal ID: MAGECLOUD-3357

As a developer, I want my Docker environment to match Cloud as closely as possible. Clients are able to add or remove PHP extensions by modifying their .magento.app.yaml. It would be very useful if that same structure could be used to do the same in their Docker environment.

Background:

  • The standard PHP Docker image has docker-php-ext-install and docker-php-ext-enable commands that may be used to accomplish much of this. However, those commands might only work when building Docker images, as opposed to modifying existing containers. We should try to find the best solution for clients with images they've already downloaded.

To Do:

  • Add support for configuring PHP modules locally via .magento.app.yaml

[ECE-Tools] Add Command to Display Values from Encoded Environment Variables

Internal ID: MAGECLOUD-3451

Background:

  • We have a list of encoded variables on Cloud:
    -- MAGENTO_CLOUD_RELATIONSHIPS
    -- MAGENTO_CLOUD_ROUTES
    -- MAGENTO_CLOUD_VARIABLES
  • For better user experience, we need to add a command to ECE-Tools to show the values of those variables in a decoded format

To Do:

  • Add new command to display values of environment variables in an easier way than using decode commands.

[ECE-Tools] Error in UrlManager::getBaseUrl() When Secured URL isn't Configured

Internal ID: MAGECLOUD-4009

Error in UrlManager::getBaseUrl() method in case when secured URL isn't configured and CLI command from magento-cloud-components module failed (for example module is disabled in the config.php file)

{{\[2019-07-31 16:20:42] INFO: Initializing routes. }}
{{\[2019-07-31 16:20:42] CRITICAL: Notice: Undefined index: in /app/xxxxx/vendor/magento/ece-tools/src/Util/UrlManager.php on line 162 }}
{{W: }}
{{W: In ErrorHandler.php line 64: }}
{{W: }}
{{W: Notice: Undefined index: in /app/xxxxx/vendor/magento/ece-tool }}
{{W: s/src/Util/UrlManager.php on line 162 }}
{{W: }}
{{W: }}
{{W: post-deploy }}
{{W:}}

To Do:

  • Change logic to use unsercure (http) URL in case when secure (https) isn’t configured.

[Cloud Docker] Add Separate Post-deploy Hook to Cloud Docker

Internal ID: MAGECLOUD-3996

Background:

  • Currently we have build & merged deploy+post-deploy hooks in Cloud Docker
  • This conflicts with the idea to have similar behavior as on Cloud for Cloud Docker

To Do:

  • Investigate if magento/magento-cloud-docker#30 fixed this issue already, since we now read hooks or something is still missing in default flow
  • Add dedicated Cloud Docker command for split deploy / post-deploy flows, as we currently have for build
  • Maintain backward compatibility via aliases if required

ElasticSearch Version Validation occurs too late

By the time the ES Version check occurs, the new code has been deployed and db schema upgrades have been executed. Aborting deployment at this point will also abort static file generation - leaving a website half deployed.

The Cloud UI indicates the deployment is successful. Only if someone actually checks the var/log/cloud.log file will they realize something is wrong.

As such, it should never cause a critical/deployment fail and should only be a warning. Playing dice with whether a site is functional or not a very very bad idea.

[ECE-Tools] Cache Warm-up Fails if base_url isn't Set in Database

Internal ID: MAGECLOUD-3075

Background:

  • The following error appears if base_url isn't set in a database:
    [2019-01-11 15:37:32] NOTICE: Starting post-deploy.  
    [2019-01-11 15:37:32] INFO: Validating configuration  
    [2019-01-11 15:37:32] INFO: End of validation  
    [2019-01-11 15:37:32] INFO: Enable cron  
    [2019-01-11 15:37:32] INFO: Create backup of important files.  
    [2019-01-11 15:37:32] INFO: Backup /app/app/etc/env.php.bak for /app/app/etc/env.php was created.  
    [2019-01-11 15:37:32] INFO: Backup /app/app/etc/config.php.bak for /app/app/etc/config.php was created.  
    [2019-01-11 15:37:32] INFO: php ./bin/magento cache:flush --ansi --no-interaction   
    [2019-01-11 15:37:33] CRITICAL: Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of the type array, boolean returned  
    W: 
    W:                                                                                                                
    W:   [Magento\MagentoCloud\Process\ProcessException]                                                              
    W:   Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of the type array, boolean returned  
    W:                                                                                                                
    W: 
    W:                                                                                                                
    W:   [TypeError]                                                                                                  
    W:   Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of the type array, boolean returned  
    W:                                                                                                                
    W: 
    W: post-deploy
    W: 
    W: Unknown error executing post deploy hook, continuing anyway
  • The base_url might be set in files (config.php, env.php) or in the environment variables

To Do:

  • Add an ability to retrieve the base_url from other sources
  • Add the option for disabling the cache warm-up

[ECE-Tools] WARM UP : error when no "default" store code

Preconditions

  1. Magento 2.3.0
  2. ece-tools 2002.0.20

Steps to reproduce

  1. Have a site without a store with code "default"
  2. Set-up the WARM_UP_PAGES in the post-deploy node

Expected result

  1. Pages are warmed up

Actual result

  1. Error : Can't fetch base url. The command "php bin/magento config:show:store-url default" failed.

I guess there are many websites where the store with the "default" code have been removed. Why not taking "admin", which will (probably) never be deleted ?

Fix an Issue with db-dump Command Related to DEFINERS

Internal ID: MAGECLOUD-3510

Background:

Very often users are facing a problem when they can't import the dumped database as it contains DEFINERS user@host that doesn't match in different environments.

To Do:

  • Replace all DEFINERS after mysqldump command:
mysqldump -u username -p'password' db_name --single-transaction | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip > /path/to/save/db_no-definer.sql.gz
  • It can be implemented as an option which is true by default.

[Cloud Docker] env.php configuration is lost during a deploy

With Docker in developer mode, env.php is regenerated during a deploy. Configurations from before the deploy are lost. Also, the array format changes from [] to array().

Preconditions

Working Docker environment with the following in env.php. Notice the disabling of Google Analytics.

...

    'install' => [
        'date' => 'Thu, 06 Oct 2016 09:48:22 +0000'
    ],
    'system' => [
        'default' => [
            'catalog' => [
                'search' => [
                    'engine' => 'elasticsearch5',
                    'elasticsearch5_server_hostname' => 'elasticsearch',
                    'elasticsearch5_server_port' => '9200'
                ]
            ],
            'google' => [
                'analytics' => [
                    'active' => '0'
                ]
            ]
        ]
    ],
    'cache' => [
        'frontend' => [
            'default' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'port' => '6379',
                    'database' => 1
                ]
            ],
            'page_cache' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'port' => '6379',
                    'database' => 2
                ]
            ]
        ]
    ],

...

Steps to reproduce

docker-compose run deploy cloud-deploy

Expected result

GA would continue to be disabled in env.php.

Actual result

GA configuration was lost.

...

  'install' => 
  array (
    'date' => 'Thu, 06 Oct 2016 09:48:22 +0000',
  ),
  'system' => 
  array (
    'default' => 
    array (
      'catalog' => 
      array (
        'search' => 
        array (
          'engine' => 'elasticsearch5',
          'elasticsearch5_server_hostname' => 'elasticsearch',
          'elasticsearch5_server_port' => '9200',
        ),
      ),
    ),
  ),
  'cache' => 
  array (
    'frontend' => 
    array (
      'default' => 
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' => 
        array (
          'server' => 'redis',
          'port' => '6379',
          'database' => 1,
        ),
      ),
      'page_cache' => 
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' => 
        array (
          'server' => 'redis',
          'port' => '6379',
          'database' => 2,
        ),
      ),
    ),
  ),

...

AdminCredentials class updates wrong user

The AdminCredentials class updates the 1st user in the admin_user table. This is clearly wrong.

Since the admin user of magento setup:install is installed as one of the last actions of the install process, any users added by modules during install will have a lower user_id and will be updated instead when someone changes the ADMIN_PASSWORD env value.

Another scenario where it fails: if user # 1 is deleted in the admin by another admin, changing AMDIN_PASSWORD would change # 2's password regardless of who # 2 is.

Of course, this applies to all the other ADMIN_* vars as well since it's always updating the first user found by id.

[Proposal] Scenario-based deployments

Terms

Magento Cloud ecosystem

Current state

magento-cloud-ecosystem

Desired state

magento-cloud-ecosystem-desired

The desired state - is to have flexible Magento deployment tools which will be used by Community and will be an easily extendable system.

Introduction

ECE-Tools got a good adoption by the community as a robust and predictable too for Magento deployment. It also includes a bunch of useful tools and Cloud Docker environment.  From the beginning of ECE-Tools it was focused on only one type of deployment  (de-facto Platform.sh deployment scenario). This was satisfying our needs until ideas with universal Magento deployment solution were proposed.

With time ECE-Tools became a universal Tool, developers were building their custom deployments around. ECE-Tools will lack the next features:

  • Custom deploy scenarios
  • Possibility to extend scenarios
  • Possibility to remove not needed steps of default scenarios

The benefits will be next:

  • Very robust and flexible system to fit almost any type of deployment scenarios
  • All-in-one solution to deploy Magento
  • Support of Magento Open Source (Previously CE)
  • Extended debug and logging features
  • An API endpoints with backward compatibility guarantees
  • Possibilities to introduce own implementations of common API's

Design

The design proposal fits the current Magento Cloud infrastructure.

Terms

  • Scenario - an XML configuration files which describes sequence and configuration parameters to deploy Magento

  • Step - an XML structure which describes a programmatic step to be executed

New ECE-Tools implementation will be targeted to deliver maximum flexibility to end-users. ECE-Tools will provide an easy to use API and predefined scenarios and steps to fit Magento's Cloud infrastructure.

Scenarios

Definition

Magento will will provide default scenarios to deploy Magento in **XML **format. Scenarios can be combined and replaced to satisfy customer's needs.

hooks:
    build: |
        set -e
        php ./vendor/bin/ece-tools run scenario/generate.xml
        php ./vendor/bin/ece-tools run scenario/transfer.xml
    deploy: |
        php ./vendor/bin/ece-tools run scenario/deploy.xml
    post_deploy: |
        php ./vendor/bin/ece-tools run scenario/post-deploy.xml

Composite step

<step name="set-production-mode" type="Magento\MagentoCloud\Step\SetProductionMode">
    <argument name="steps">
        <item name="stepA" type="Magento\MagentoCloud\Step\SetProductionMode\A" priority="100" />
        <item name="stepB" type="Magento\MagentoCloud\Step\SetProductionMode\B" priority="200" />
    </argument>
</step>

Priority

  • Priority is determined from the step location in scenario

Default Scenarios

Magento MUST include default scenarios for supported Cloud deployment pipelines.

Steps

StepInterface definition

StepInterface is generally lightweight processing class

namespace VendorName\VendorModule\Step;

use Magento\MagentoCloud\Step\SetProductionMode as OriginalSetProductionMode;

class SetProductionMode implements StepInterface
{
    /**
     * @var OriginalSetProductionMode
     */
    private $step;

    public function __construct(OriginalSetProductionMode $step)
    {
        $this->step = $step;
    }

    public function run(): void
    {
        // Do something
        $this->step->run();
        // Do something
    }
}

StepException definition

Each step may throw only 1 type of exception - StepException

class StepException extends \Exception
{
}

Steps MUST NOT be aware of the existence of other steps and be fully replaceable.

Extensibility

By using the XML format of scenarios, an ECE-Tools will have the possibility to extend default scenarios by 3rd-party extensions.

Extending default deploy scenario

In this example, the custom scenario is merged on top of the default scenario.

hooks:
  deploy: |
    php ./vendor/bin/ece-tools run scenario/deploy.xml vendor/vendor-name/module-name/deploy.xml

Merging rules

  • Scenarios are prioritized from their positions. Where right has higher priority than left. (BA)
  • If Scenario B has a step StepA with the same name as step StepA in Scenario A, step from Scenario B will be used

Removing default steps

Custom scenario can remove steps from default scenarios:

<scenario>
    <step name="set-production-mode"  skip="true" />
</scenario>

Replacing steps

Custom scenarios can replace default steps and provide custom implementation.

<scenario>
    <step name="set-production-mode" type="VendorName\VendorModule\Step\SetProductionMode" />
</scenario>

SI MUST be able to call the original step:

Customizing steps

We'll provide the possibility to customize some of the default steps, like Shell execution:

<scenario>
    <step name="run-unit-tests" name="Magento\MagentoCloud\Shell\ShellRunner">
        <argument name="command">phpunit -c vendor/test.xml</argument>
    </step>
</scenario>

Validations

ECE-Tools MUST provide an XSD schema for scenarios validation with IDE and static tools.

Backward compatibility

  • Current hooks MUST BE compatible with new scenario-based flows
  • Current commands MUST BE compatible with new scenario-based flows

API introduction

ECE-Tools will provide an API interfaces which MUST follow Semantic Versioning standards.

  • All API interfaces MUST be marked with @api annotation
  • Changes to API interfaces MUST be approved by Architect

API interfaces MAY include but not limited to:

  • Public interfaces such as ShellInterface
  • Default scenarios names
  • Default steps names

Logging

  • Each deployment MUST begin with the info of executed/merged scenarios:
[2019-07-24 20:00:00] INFO: Starting scenario(s) "scenario/deploy.xml", "vendor/vendor-name/module-name/deploy.xml"
[2019-07-24 20:00:00] ...
[2019-07-24 21:00:00] INFO: Scenario(s) ended
  • The logging mechanism MUST reflect the history of executed steps. Steps are logged with INFO level verbosity. Names of steps are extracted from class name from  UpperCamelCase. Where:
    • SetProductionModeStep: "Set Production Mode"
    • DeployStaticContentStep: "Deploy Static Content" 
[2019-07-24 20:00:00] INFO: Run "Set Production Mode" step
[2019-07-24 20:00:00] DEBUG: Run command "bin/magento deploy:mode:set production"
[2019-07-24 20:00:00] INFO: Run "Deploy Static Content" step

New Commands

ece-tools run

This command executes the desired scenario.

Arguments

  • scenario - an array of scenarios in XML format to be execute. Value is the relative path to the scenario file

Options

Implementation phases

Phase 1

Introduce DI component

Laravel DI is a fast and reliable system, but it is too messy due to lack of XML configuration support.

  • Laravel must provide one of XML-based DI components:
    • Symfony Dependency Injection
    • Magento Dependency Injection

This will be essentially needed for 3rd-party developers for developing custom scenarios. Basic configuration is presented below (Using Symfony DI):

<container>
    <services>
        <defaults autowire="true" autoconfigure="true" public="true"/>
        <prototype namespace="Magento\CloudTools\" resource="../src/*" />
    </services>
</container>

Introduce scenarios processor and parser mechanism

  • Implement XSD schema
  • Add default scenarios

Refactor existing code to fit the new scenario-based deployments

  • Refactor all Processor classes into Step classes and fit to new scenarios
  • Refactor all unit tests

Introduce scenario merger mechanism

  • Add diff option to see the difference between default and actual scenarios

Introduce an API endpoints

  • All Steps are covered with @api annotation

  • Important interfaces are covered with @api annotation

Add coverage of new functionality to Functional Testing Framework

  • Verify that current tests are passing
  • Add scenario with custom steps

Document extensibility mechanism and API endpoints

  • An API interfaces and Steps must be marked with an @api annotation

Phase 2

Introduce extensibility mechanism based on Dependency Injection

  • Add merged of DI configurations
  • Add modules registrations for r-rd party modules

Introduce priority to Steps

  • Provide more flexibility to injecting steps

Dependencies

[ECE-Tools] env.php is Overwritten with 2002.0.18

Internal ID: MAGECLOUD-3668

Step to reproduce:

  • Install Magento on cloud
  • Connect by ssh
  • Run bin/magento app:config:dump
  • Open app/etc/env.php. Ensure that this file consist data about payment and shipments methods
  • Redeploy environment
  • Open app/etc/env.php

Actual and expected result:

  • Actual: After redeploy env.php is regular without any custom settings
  • Expected: After redeploy env.php should include custom settings

[Cloud Docker] Improve Error Handling

Internal ID: MAGECLOUD-3249

As a Magento developer, I want Cloud Docker solution to have better error handling & documentation, so I can easily follow the steps and be notified if I am doing something wrong.

To Do:

  • Add better error handling, so invalid arguments in config build command or wrong YAML configuration are appropriately handled and explained instead of throwing regular Notice.
  • Add better argument parsing for vendor/bin/ece-tools docker:build command. Currently the specified below commands executes successfully without any errors but also doesn't add any service images: vendor/bin/ece-tools docker:build --es

AdminCredentials class should throw an exception when updating an already used username

AdminCredentials issues only a warning to an unseen log file when a user updates ADMIN_USERNAME to one that is already used.

Since username is unique in admin_user, having 2 users with the same username will never be valid and an exception should be thrown. Instead, the magento-cloud vset or the web UI indicate success while only a single line out of hundreds in the log output indicate something may not have updated properly.

Deleting var/log while still writing to var/log/cloud.log

During the build phase of m2-ece-build, one of the build processes attempts to delete the var/log dir while another process still has var/log/cloud.log open for writing.

On an NFS system, this will cause an .nfsXXX file to be created when cloud.log is unlinked from one process while the other is still running. Consequently, a file system exception is thrown, and m2-ece-build is aborted.

While this may not be an issue in the Platform.sh containers, it is an error in the logic (to have one process delete a file that another is actively writing to), and we have to modify the code to use it locally.

Please consider fixing this logic error.

[ECE-Tools] Removed index.php from the URL Breaks Multi-website Setup

Internal ID: MAGECLOUD-3496

Background:

  • We've found a regression bug caused by #430

Steps to reproduce:

Pre-conditions:

Expected result:

  • every URL is generated without index.php and its URLs open correctly.

Actual result:

  • every URL is generated without index.php, but only base website URLs work correct, other returns 404.

Empty commit should trigger m2-ece-deploy

As a user, when I run git commit -m "redeploy" --allow-empty; git push, m2-ece-delpoy should run. Instead, I get a message about Reusing existing build for this tree ID. and m2-ece-deploy does not attempt to run.

If I'm committing an empty commit, it's probably because the previous push failed for 1 of many possible reasons, and m2-ece-deploy should be rerun.

Obviously, it's not required for the filesystem to change to rerun m2-ece-deploy. For example, setting a variable via the magento-cloud cli tool or web UI does not change the slug (built filesystem), but that action does cause m2-ece-deploy to run.

[ECE-Tools] _merge Parameter is not Documented in .magento.env.yaml.dist Properly

Internal ID: MAGECLOUD-3651

Background:

  • _merge parameter which allows customizing settings for different services (DB, ES, Redis, etc.) is not documented for every variable, which it can be used with. Currently it is documented for 2 variables only.

To Do:

  • Review all cases when _merge can be used
  • Review .magento.env.yaml.dist for missing _merge mentions
  • Add _merge documentation to variables, which support it

[ECE-Tools] Decrease Log Level for Shell Commands to Debug in cloud.log

Internal ID: MAGECLOUD-3277

Background:

We always display information about shell command which we execute and sometimes it's not needed in cloud.log with INFO log level:
INFO: echo 'Installation time: '$(date) | tee -a /app/var/log/install_upgrade.log

To Do:

  • Change log level for similar entries to DEBUG to reduce noise in cloud.log

[ECE-Tools] Reduce q-ty of Reports Created in /app/*/var/report

Internal ID: MAGECLOUD-3392

There is an issue with users having thousands of files in /app/PROJECT_ ID/var/report which are very hard to clean-up due to GlusterFS.

To Do:

  • Investigate options to reduce quantity of files generated, so we do not create thousands of files with single error/exception in one file. Proposed way to solve the issue is to change file nesting rules in that folder, making directory less flat.
  • Review implementation and deliver patches, covering all affected versions.

[Cloud Docker] Re-write ECE-Tools Integration Tests to Use Cloud Docker

Internal ID: MAGECLOUD-3129

As an ECE-Tools developer and user, I want all the functionality to be able to utilize Cloud Docker as a testing environment for integration tests, so I can be sure in the quality of code delivered and it's compatibility with Cloud solution.

Background:

  • We've delivered the base functionality to run integration testing using Cloud Docker implementation.
  • We now need to move our legacy tests to use new testing implementation, which will drive higher confidence in quality of code, being delivered.

To Do:

  • Migrate all viable tests to new integration testing implementation
  • If possible, define extension points, so we can educate users & other teams on how to integrate same functionality into their CICD process
  • Tests are paralleled to not hit 2-hr timeout on Travis, since build duration is expected to increase

[ECE-Tools] Cache Warm-up, Using RegEx to Warm-up Multiple Pages

Internal ID: MAGECLOUD-3258

As a Magento Cloud user, I want to warm-up multiple pages of the same type without changing the configurations significantly, so I can be sure that new pages are pre-warmed OOTB once needed.

To Do:

  • Add possibility to warm-up multiple pages which fit the RegEx (example: pre-warm all category pages)

Dependency to redis-cli

When defining the Redis connection in the cloud environment variable MAGENTO_CLOUD_RELATIONSHIPS and run vendor/bin/ece-tools deploy the class Magento\MagentoCloud\Process\Deploy\PreDeploy\CleanRedisCache will try to execute a shell command using redis-cli.

Since we use a different Docker setup this binary is missing and the deployment fails. IMHO redis-cli is an unnecessary dependency of ece-tools and should be replaced by using Redis class like Magento/CmRedis do to avoid additional dependencies.

[ECE-Tools] Add Split DB Support

Internal ID: MAGECLOUD-3287

As a Magento Cloud user, I want to be able supporting split DB, so I can offload part of DB-related operations to different instances to balance the load better and improve performance.

To Do:

  • Add possibility to spin up additional separate DB instances and have ECE-Tools auto-configure routing and related settings:
    ** On separate hosts (separate tier)
    ** On same hosts as current DB (DB tier)
  • New DB set can be configured and tuned independently from main DB
  • Add possibility to migrate data from monolith DB to split DBs

[Cloud Docker] Static files not available if these are created on build stage

I don't know if this issue should be reported here, but is seems like an ece-tools probem.
We've tested 3 different approaches using magento cloud docker on local (production mode) and one of them fails to deploy the static files correctly.
We've installed magento 2.3.2 using all steps from documentation, first time with no config.php and no .magento.env.yaml configurations and it worked ok, magento website was loading, all js/css files were present.
The second time, we've added a confg.php (using ece-tools config:dump command after the first try) and a .magento.env.yaml file in which we've added the following code:

stage:
  build:
    SCD_STRATEGY: "compact"
    SCD_THREADS: 1
    SCD_MATRIX:
      "Magento/luma":
        language:
          - en_US
      "Magento/backend":
        language:
          - en_US

After running all the required commands, the website returned a fatal error (var/report error) stating that the deployed_version.txt file was not found. While checking the fpm container, we've found that pub/static folder was empty and init/pub/static folder contents were wrong:

ssugar@sorin-sugar:~/Projects/magento-cloud-2.3.2$ docker exec -it magento-cloud-232_fpm_1 bash
root@a96f2d1c9e5e:/var/www/html# ls -al /app/pub/static
total 8
drwxrwxr-x 2 root root 4096 Aug  9 06:35 .
drwxrwxr-x 6 1000 1000 4096 Aug  9 06:35 ..
root@a96f2d1c9e5e:/var/www/html# ls -al /app/init/pub/static/
total 8
drwxr-xr-x 2 root root 4096 Aug  9 06:35 .
drwxr-xr-x 4 root root 4096 Aug  9 06:35 ..
lrwxrwxrwx 1 root root   30 Aug  9 06:35 .htaccess -> /app/init/pub/static/.htaccess
lrwxrwxrwx 1 root root   30 Aug  9 06:35 adminhtml -> /app/init/pub/static/adminhtml
lrwxrwxrwx 1 root root   25 Aug  9 06:35 base -> /app/init/pub/static/base
lrwxrwxrwx 1 root root   41 Aug  9 06:35 deployed_version.txt -> /app/init/pub/static/deployed_version.txt
lrwxrwxrwx 1 root root   29 Aug  9 06:35 frontend -> /app/init/pub/static/frontend

The third approach was using the following .magento.env.yaml file

stage:
  build:
    SKIP_SCD: true
  deploy:
    SCD_STRATEGY: "compact"
    SCD_THREADS: 1
    SCD_MATRIX:
      "Magento/luma":
        language:
          - en_US
      "Magento/backend":
        language:
          - en_US

This worked as expected and the static files were found. It is worth mentioning that we've run docker-sync clean after each run.

Preconditions

  1. Docker version 19.03.1, build 74b1e89e8a
  2. docker-compose version 1.24.1, build 4667896
  3. docker-sync 0.5.11
  4. Latest magento cloud docker images
  5. Operating system Ubuntu 16.04

Steps to reproduce

  1. Clone magento-cloud repo for 2.3.2
  2. Add the files attached to this issue samples.zip
  3. Run the following commands
docker-sync start
docker-compose up -d
docker-compose run --rm build cloud-build
docker-compose run --rm deploy cloud-deploy
docker-compose run --rm deploy magento-command config:set system/full_page_cache/caching_application 2
docker-compose run --rm deploy magento-command cache:flush

Expected result

  1. The fpm container should have static files inside /app/pub/static and website should work

Actual result

  1. The /app/pub/static folder is empty on fpm container and the site fails with a fatal error

MAGECLOUD-2956 still unresolved / Yaml::PARSE_CONSTANT

In our setup we've symfony/yaml v2.8.45 installed. Although some work has been done to poke around this issue I still get a PHP fatal error:

{code}Fatal error: Uncaught Error: Undefined class constant 'PARSE_CONSTANT' in /var/www/html/vendor/magento/ece-tools/src/Config/Environment/Reader.php:58{code}

So MAGECLOUD-2956 is still unresolved.

[ECE-Tools] Change Deployment Behavior for Cases when env.php is Missing

Internal ID: MAGECLOUD-3628

Step to Reproduce Scenario:

  • Install magento on cloud
  • rm -rf app/etc/env.php
  • Redeploy environment

To Do:

  • Update logic of handling missing env.php file
  • WARNING is written in log, saying that env.php was missing + the action taken based on the below logic
  • Try recovering env.php:
    -- If env.php.bak is available, recover from backup
    -- If env.php.bak is not available, generate new env.php using defaults

[Proposal] Using ECE Tools with Magento Open Source

As ECE Tools became open source and public available - it's good idea to add instructions how to use it with Magento OS. As result - people might try to use it on Magento OS and will report issues / send PRs.
I just tried and got few issues:

  • all docs are saying how to use it on Magento Commerce, but none are saying how to use them with Magento OS
  • package magento/ece-tools is not public available, even not available when I put my credentials w/o access to Magneto Commerce, there only one way to install it - use link to github repo as a composer repository

[ECE-Tools] Move Service Version Validation Higher and Merge ES/PHP Validation

Internal ID: MAGECLOUD-3535

Background:

  • We recently added global version mapping for docker build here: #445
    ** After task completion we realized that this should be moved to the higher level to be used globally instead of being a Docker-specific validation
  • We also have few cases of validating stack parts separately according to some custom logic:
    ** PHP: #396
    ** ES: #308 + #336

AC:

  • Core-to-service version mapping is moved out of Docker-specific code to a higher global level
  • Validation for currently validated services is modified/merged with new version mapping (where possible)
  • New checks are added for currently not validated stack parts (RabbitMQ, Redis, etc.) with same error level as current validations (WARNING)
  • Automated tests are added to provide coverage for all version-related changes:
    ** For example Docker-supported image versions should always be defined in service version mapping

Setting UPDATE_URLS to TRUE is not Possible for Some Environments

Internal ID: MAGECLOUD-2824

Background:

  • It is not possible to have the deploy variable UPDATE_URLS set to true for Master/Staging/Production environment on Cloud, since by design URLs cannot be changed for those environments
  • URLs are also not updated if you branch from any of these environments, causing redirect loop

To Do:

  • Look if behavior of UPDATE_URLS can be changed to integrate restrictions we have right now but having those able to override for specific edge cases some users may have

[Spike] Consider Adding PHPStan to Static Tests of ECE-Tools Code

Internal ID: MAGECLOUD-3578

Background:

  • https://github.com/phpstan/phpstan
  • PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

To Do:

  • Consider Adding PHPStan to Static Tests of ECE-Tools Code
  • Exclude Test directory from the code analyze
parameters:
	excludes_analyse:
		- %rootDir%/../../../tests/*/data/*
  • Run analyse command and fix all failed tests
  • Add PHPStan into Travis

Prefixes for DB Tables are not Supported

Internal ID: MAGECLOUD-2901

Background:

  • You can set up table prefixes via DATABASE_CONFIGURATION & _merge option but those look to be not supported during deployment, causing issues.

To Do:

  • Investigate if table prefixes can be supported on Cloud & current infrastructure
  • If yes - evaluate possible drawbacks / known restrictions or issues which can arise
  • If adding table prefixes looks safe, enable ECE-Tools to support those

Deploy fail when apply patches

Preconditions

  1. Magento Cloud 2.2.8
  2. ece-tool 2002.0.20
  3. Follow docker development in local environment

Steps to reproduce

  1. Remove all vendor folder
  2. Run composer install
  3. Run docker-compose run deploy cloud deploy

Expected result

  1. Deploy is successful

Actual result

  1. Deploy failed when apply patches

Starting eceupgrade_node_1 ...
Starting eceupgrade_db_1 ... done
Starting eceupgrade_redis_1 ...
Starting eceupgrade_node_1 ... done
[ ok ] Starting enhanced syslogd: rsyslogd.
Installing dependencies.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Running "build" hook.
[2019-07-11 16:40:36] NOTICE: Starting generate command. (magento/ece-tools version: 2002.0.20, magento/magento2-base version: 2.2.8)
[2019-07-11 16:40:36] INFO: Verbosity level is -vvv
[2019-07-11 16:40:36] INFO: Generated code exists from an old deployment - clearing it now. {"metadataPath":"/app/generated/code"}
[2019-07-11 16:40:36] INFO: Set Magento application mode to 'production'
[2019-07-11 16:40:36] NOTICE: Validating configuration
[2019-07-11 16:40:36] WARNING: Fix configuration with given suggestions:

  • Some configurations in your .magento.env.yaml file is deprecated.
    The SCD_EXCLUDE_THEMES variable is deprecated. Use SCD_MATRIX instead.

  • The configured state is not ideal
    SCD_ON_DEMAND variable is enabled

    Your application does not have the "post_deploy" hook enabled.
    In order to minimize downtime, add the following to ".magento.app.yaml":
    hooks:
    post_deploy: |
    php ./vendor/bin/ece-tools post-deploy
    [2019-07-11 16:40:36] NOTICE: End of validation
    [2019-07-11 16:40:36] NOTICE: Reconciling installed modules with shared config.
    [2019-07-11 16:40:40] NOTICE: End of reconciling modules.
    [2019-07-11 16:40:40] NOTICE: Applying patches.
    [2019-07-11 16:40:40] INFO: File static.php was copied.
    [2019-07-11 16:40:40] INFO: Applying patch Enable SCD on demand in production (/app/vendor/magento/ece-tools/patches/MAGECLOUD-1601__trim_static_content_path__2.1.4.patch) >=2.1.4.
    [2019-07-11 16:40:40] INFO: Applying patch Respect user-specified minification settings (/app/vendor/magento/ece-tools/patches/MAGECLOUD-1736__respect_minification_override__2.2.0.patch) ~2.2.0.
    [2019-07-11 16:40:40] INFO: Applying patch Add Zookeeper and flock locks (/app/vendor/magento/ece-tools/patches/MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.2.5.patch) 2.2.5 - 2.2.8.
    [2019-07-11 16:40:40] CRITICAL: The command "git apply --check --reverse /app/vendor/magento/ece-tools/patches/MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.2.5.patch" failed.

Exit Code: 1(General error)

Working directory: /app

Output:

Error Output:

error: patch failed: app/etc/di.xml:37
error: app/etc/di.xml: patch does not apply
error: vendor/magento/framework/Lock/Backend/FileLock.php: No such file or directory
error: vendor/magento/framework/Lock/Backend/Zookeeper.php: No such file or directory
error: vendor/magento/framework/Lock/LockBackendFactory.php: No such file or directory
error: patch failed: vendor/magento/framework/Lock/LockManagerInterface.php:3
error: vendor/magento/framework/Lock/LockManagerInterface.php: patch does not apply
error: vendor/magento/framework/Lock/Proxy.php: No such file or directory
error: patch failed: setup/src/Magento/Setup/Model/ConfigOptionsList.php:44
error: setup/src/Magento/Setup/Model/ConfigOptionsList.php: patch does not apply

[Magento\MagentoCloud\Shell\ShellException]
The command "git apply --check --reverse /app/vendor/magento/ece-tools/patches/MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.2.5.patch" failed.

Exit Code: 1(General error)

Working directory: /app

Output:

Error Output:

error: patch failed: app/etc/di.xml:37
error: app/etc/di.xml: patch does not apply
error: vendor/magento/framework/Lock/Backend/FileLock.php: No such file or directory
error: vendor/magento/framework/Lock/Backend/Zookeeper.php: No such file or directory
error: vendor/magento/framework/Lock/LockBackendFactory.php: No such file or directory
error: patch failed: vendor/magento/framework/Lock/LockManagerInterface.php:3
error: vendor/magento/framework/Lock/LockManagerInterface.php: patch does not apply
error: vendor/magento/framework/Lock/Proxy.php: No such file or directory
error: patch failed: setup/src/Magento/Setup/Model/ConfigOptionsList.php:44
error: setup/src/Magento/Setup/Model/ConfigOptionsList.php: patch does not apply

Download of media files shall skip cache directory

This is not a bug but rather an improvement request.
Cache directories as it name depicts are media files that are generated - so they can be also re-generated.
Size and number of this files is significant and there shall be at least a flag to exclude them from downloading when you just want to download media folder

Preconditions

  1. Have Magento up and running with products with pictures

Steps to reproduce

  1. Execute magento-cloud mount:download
  2. Choose pub/media
  3. Files will be downloaded including catalog/product/cache/

Expected result

  1. It would be nice if there is additional option to omit files that are generated by Magento (and can be re-generated)

Actual result

  1. Files will be downloaded including catalog/product/cache/ and it takes a lot of time

[Proposal] Event Driven Deployments

Problems

  1. ECE Tools currently has a tight coupling between commands and the individual steps necessary for them.
  2. There is no way for for third parties to inject their own steps in the middle of different commands (shell scripts may be run before or after a command but not around individual steps).

Goals

  1. Provide optimal flexibility for others to add their own steps inline with individual commands.
  2. Do not reinvent the wheel: wherever practical rely on common programming practices, APIs, and libraries.

Proposal

Update ECE Tools to be an event driven system. Externally, nothing would change; the same commands would be used to build Magento and deploy it on servers. Internally, the way these commands coordinate with their steps would be overhauled. Additionally, should users need it, there would be a way to add additional steps to the deployment flow.

Commands

Rather than having their steps injected to them, commands become pure event dispatchers. Their responsibility would be to dispatch their respective events in order and do basic error handling. More specific steps should be performed by individual event listeners.

Events

Events are referenced by their name. An event name is made up of multiple parts separated by .. An event name should start with a namespace. Some standard namespaces that will come with ECE Tools will be command and task. Other namespaces may be created as need be. After the namespace will be any additional sub-namespaces followed by the object's name. Lastly, the event name will end with a specific event for that object. Default specific events are starting, run, finished, and error. Other event names may be added as necessary. For example there may be specific events for validators such as passed and failed. Some example event names would be:

  • command.build.generate.starting
  • command.deploy.error
  • task.compile-di.finished
  • task.vendor-name.some-custom-task.run

Events for a given command or task will be dispatched in order (starting, run, finished). Other events may dispatched in between these as required. Unless an error occurs, all three events should always be dispatched. If an error does occur, the error event must be dispatched.

Configuring Event Listeners

Event listeners are PHP callables. Custom event listeners may be added in .magento.env.yaml. For example:

system:
  events:
    "command.build.generate.starting":                 # Run these listeners before the main steps of `build:generate`
      - \Vendor\Some\Invokable\ClassName               # An invokable class
      - [\Vendor\Some\Other\ClassName, someMethodName] # A method of a given class

ECE Tools will use its container to create an instance of whatever class is configured and call methods non-statically.

Events handlers may include a priority as well. The default priority is 0. Higher priorities will be called earlier in the event dispatch sequence.

system:
  events:
    "task.compile-di.ended": # Run these listeners immediately after the `di:compile` task
      - handler: \Vendor\Another\Invokable\ClassName
        priority: 100 # Make sure this listener is run before others, such as the task's own handler.

Tasks & Task Dispatcher

Tasks are specialized event subscribers. A task must implement a run() method that performs the primary duties of the task. A task may also implement before(), after(), and error() methods. These will listen for starting, finished, and error events respectively. The before() method should be use for any precondition work necessary for the task, such as verifying system state. The after() method can be used for any cleanup steps that should be run after the task. Finally, error() is the error handler for the task itself.

Tasks do not listen for command events directly. Instead, there is a task dispatcher that sits between the command events and individual tasks. Just like with generic events, tasks are configured via .magento.env.yaml:

system:
  tasks:
    "command.build.transfer.finished" # Run these task at the end of the `build:transfer` command
      - \Vendor\Tasks\MyFirstTask
      - \Vendor\Tasks\MySecondTask
    "command.deploy.starting" # Run these tasks at the begining of the `deploy` command
      - \Vendor\Tasks\MyDeployTask

The task dispatcher will register itself as a listener to the command.build.transfer.ended and command.deploy.starting events. Whenever it receives one of those events, it will in turn register the tasks for that event as subscribers and then dispatch the events for those tasks in order. The sequence would look like this:

Build Transfer Command
    Dispatches 'command.build.transfer.starting'
        // ...
    Dispatches 'command.build.transfer.run'
        // ...
    Dispatches 'command.build.transfer.finished'
        Task Dispatcher
            Dispatches 'task.vendor.my-first-task.starting'
            Dispatches 'task.vendor.my-first-task.run'
            Dispatches 'task.vendor.my-first-task.finished'
            Dispatches 'task.vendor.my-second-task.starting'
            Dispatches 'task.vendor.my-second-task.run'
            Dispatches 'task.vendor.my-second-task.finished'
            // ...

The use of tasks over generic events has several advantages for developers. First, it creates a consistent series of events for other listeners to be able to use. This means that third parties can easily listen for a particular task's starting or finished event and perform some actions before or after that task reliably. It also takes the onus of declaring and dispatching those events away from the client code. Instead the task dispatcher is responsible for the events and the task code can focus on simply performing whatever actions are necessary.

There are a couple of trade offs to generic event listeners however. Tasks always have the default priority of 0, so they are always run in the order that they are registered. On the other hand, tasks provide an easy short hand to setup a standard set of events that other listeners may be able to leverage.

Comparison to Scenario Based Deployments

Both scenarios based deployments and event driven APIs attempt to solve similar limitations of ECE Tools, but with different mechanisms and drawbacks. Event APIs are a common design pattern, with several different third party libraries implementing them already. Their behavior is predictable and well understood. The chosen syntax for configuring events is intentionally light weight, easy to understand, and fits into the existing Magento Cloud configuration scheme.

On the other hand, scenarios based deployments offers the ability to remove or re-order steps of the deployment process. The event API as laid out here would not offer that functionality. While it is technically feasible to de-register an event listener, exposing it though the API here would add additional complexity to the syntax. Additionally, removing deployment steps also introduces greater risk that some key process may be skipped or altered in such a way to break the deployment. For these reasons, it was decided that adding this to the event driven API was not worth the difficulty.

[ECE-Tools] Multi-threaded SCD Doesn’t Work as Expected

Internal ID: MAGECLOUD-3611

Background:

To Do:

  • Investigate if it’s the issue in code or some library is outdated (per @hostep comment)
  • Check if thread override for compact strategy still works as expected (in Slack users mentioned that it looks broken too)
  • Review PR mentioned in Slack, which is possibly able to help resolving the issue

Fix an Issue with Unrelated Warning Messages Appearing alongside Critical Error

Internal ID: MAGECLOUD-3178

Background:

  • If configuration includes critical and warning errors it will be shown in logs like this:
[2019-02-20 18:25:22] CRITICAL: Fix configuration with given suggestions:
- Variable RESOURCE_CONFIGURATION is not configured properly
  Add connection information to the following resources: new_data
- For Magento 2.3.0.0 recommended PHP version satisfying the constraint ~7.2.0. Currently installed PHP version 7.1.26
  Change the version of PHP to the version that satisfies the restriction conditions.
  Change the PHP version in the .magento.app.yaml file or create a support ticket
  • In this example version of php isn't critical but located in critical section. Such behavior can lead to confusion.

Step to reproduce:

  • Configure environment to have validation fail with critical and warning
  • Check logs

Expected result

CRITICAL: error about resource configuration
WARNING: error about PHP

Actual result

CRITICAL: error about resource configuration
error about PHP

Dubious decision to continue after patching fails

The script m2-ece-build applies patches via m2-apply-patches, but, unlike m2-apply-patches, m2-ece-build will continue execution after the first patch that can not be applied and a runtime exception is thrown.

m2-ece-build should either stop immediately OR attempt to apply all the remaining patches. The current implementation means some patches may be applied and some may not, and the warning is buried in a flood of output.

There are valid reasons for continuing to apply the remaining patchses. The patch that fails may be a hotfix that has since made it into an upstream repo and is no longer needed. However, the current logic will now prevent other necessary patches from being applied.

[ECE-Tools] Output in Console after Redeploy has More Info About Error than cloud.log

Internal ID: MAGECLOUD-3650

Steps to Reproduce:

  • Set environment variable env:CONFIG__DEFAULT__WEB__UNSECURE__BASE_URL
  • Run install on cloud

Information in cloud.log file

[2019-05-20 17:58:24] CRITICAL: Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of the type array, boolean returned

Information in output after redeploy:

[2019-05-20 20:30:13] DEBUG: Query bindings: array (
          0 => 'web/unsecure/base_url',
        )
        [2019-05-20 20:30:13] CRITICAL: Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of the type array, boolean returned
        W:
        W: In WarmUp.php line 105:
        W:
        W:   Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of
        W:   the type array, boolean returned
        W:
        W:
        W: In Connection.php line 95:
        W:
        W:   Return value of Magento\MagentoCloud\DB\Connection::selectOne() must be of
        W:   the type array, boolean returned
        W:
        W:
        W: post-deploy
        W:

To Do:

  • Make sure cloud.log is not missing any information related to Critical errors unless this is configured by logging level

Don't automatically apply env values to all branches on unrelated updates

Currently, env vars are always inherited in branches on ECE. AFAIK, we can not change that behavior or distinguish between an inherited value and an overridden value at the moment. We can change how we handle env vars, though.

Changing certain vars (e.g password) only makes sense per env. If a user branches master, and another user changes the admin password in master, eventually the password will be updated on the child branch arbitrarily when an unrelated change causes a redeploy. This will almost always be undesired.

One work around is to only allow env var changes on master (check if $_ENV['MAGENTO_CLOUD_BRANCH'] == "master"), and all others must be set by ADMIN_<VAR_NAME>_<BRANCH_NAME>.

So changing ADMIN_PASSWORD will change the password on master but not on childbranch1. However, the childbranch1 could be updated when ADMIN_PASSWORD_childbranch1 is set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.